elementary / switchboard-plug-display

Switchboard Displays Plug
https://elementary.io
GNU General Public License v3.0
14 stars 18 forks source link

Deprioritize unrecommended resolutions #301

Closed jeremypw closed 3 years ago

jeremypw commented 3 years ago

Fixes #178 Fixes #252

The resolution combobox is replaced by a MenuButton/Popover built from a MenuModel. This allows less recommended resolutions to be put in a submenu. The main menu just shows resolutions with native aspect ratio and width >= 1024 px.

If this design is accepted, then the other two comboboxes can be replaced by a similar design for consistency either in this PR on in further PRs.

jeremypw commented 3 years ago

@cassidyjames As this is in response to one of your PRs, I would welcome your comments.

jeremypw commented 3 years ago

Should resolutions with widths less than 1024px not be offered at all or put in a further submenu?

cassidyjames commented 3 years ago

@jeremypw

jeremypw commented 3 years ago

Now also fixes issue #252

cassidyjames commented 3 years ago

@jeremypw I'm happy with the organization of the data now, I think I just want to think about the UI. A popover in a popover is a bit awkward, and I don't think we've used this sort of pattern with a label and then a dropdown button with a popover next to it. Might be worth getting a second opinion from @elementary/ux—or I could take a stab at iterating on the whole display configuration popover design. :grimacing:

jeremypw commented 3 years ago

@cassidyjames I admit I am not too happy with the way Gtk.Popover implements submenus but that is an upstream issue. I wanted something that was supported in Gtk4. If we move away from using a submenu then there are other possibilities e.g. having a "Show all" switch which repopulates the list.

jeremypw commented 3 years ago

Is there anywhere else in elementary system that has the current value displayed with a list of alternative shown with a click which doesn't use a combobox? In most cases the number of alternatives is small so a combobox is suitable. But you cannot put a submenu in a combobox afaik.

We may have to build a custom widget to put in popover rather than using its native menu facility. I'll work on it.

jeremypw commented 3 years ago

Another case where there are a large number of alternatives in a combobox is when choosing a locale - in that case the list is so long that it gets put in a scrolled window the height of the screen - which is not ideal.

jeremypw commented 3 years ago

Applying flat styleclass to the menubutton ResolutionListFlatButton (1)

Recommended resolutions without aspect ratio ResolutionListNoRatio

After rejecting too small resolution, the "Other" list is more manageable ResolutionListRejecing

jeremypw commented 3 years ago

I've just realized that the combobox list does not have to be flat - it can have a tree structure. So it should be possible to hide the non-recommended resolutions in a "sub-folder" by preparing the underlying treemodel appropriately. I'll prepare an alternative PR on this basis.

jeremypw commented 3 years ago

Closing in favour of #302