pop-os / libcosmic

WIP library for COSMIC applications
https://pop-os.github.io/libcosmic/cosmic/
Mozilla Public License 2.0
429 stars 41 forks source link

Menus bounded by application window #258

Open jackpot51 opened 8 months ago

jackpot51 commented 8 months ago

Since these menus are drawn inside the application window, they cannot go beyond it. I've minimized the issues as much as possible (for example, with #257), but small window sizes still cut off menu content.

Ideally, we'd have a platform agnostic mechanism to make these their own windows. For wayland, these are called popups https://wayland-book.com/xdg-shell-in-depth/popups.html. There is an implementation of menus for Linux, macOS, and Windows here: https://github.com/tauri-apps/muda, but it uses GTK on Linux.

WatchMkr commented 5 months ago

We'll need menus to be bound by the application window for COSMIC apps to work well on small displays such as mobile devices. This needs design work but here are a few techniques we can use:

  1. Remove shortcuts when the width is too narrow
  2. Add scrolling when the length is too short
  3. Adjust the menu opening position so it will be within the window (rather than always on the left or right of the menu label)
  4. Open submenus inside the current menu with a back button at the top
maria-komarova commented 4 months ago

I am not sure shortcuts will be a problem but we should remove them only when absolutely necessary. The rest of the designs are described below (dev link to Figma sections). Menus (1)

WatchMkr commented 4 months ago

Should be completed with the Collapse the Menu design.

WatchMkr commented 1 month ago

Conclusion from alpha 1 summit discussions:

  1. Fork winit to support menus outside of window bounds for alpha 1
  2. For Epoch 2, consider implementing single-column for small screens and as a fallback if we detect a platform where our winit-fork can't properly do popups.