Re: a new combo box




On 27/12/14 13:02, Matthias Clasen wrote:
over Christmas, I had some for a little side project, a  new combo
box. It is based on these mockups:
https://raw.githubusercontent.com/gnome-design-team/gnome-mockups/master/theming/widgets/combobox-replacements.png

It looks nice! I've had a look at gtkoptionlist.c and had a play with
the test application. On the api front I would echo Cosimo's comments
about removing groups, adding an existing group and being able to check
if an entry exists.

Having a string id is nice but there are times when it would be handy to
associate some data with a entry. I'm thinking about existing comboboxes
such as the preferences in sound-juicer where there's a
GstEncodingProfile associated with it's description, in
BraseroMediumSelection where a BraseroMedium is associated with a label
or ripping a CD in rhythmbox where the album selector associates an
album object with a label. In such cases it's a pain to create arbitrary
id's and write a mapping function to get the data from the id, it would
be much more convenient if GtkOptionList handled this for the application.

As Emmanuele mentioned it would be good to be able display a general
widget in the option list. At the moment GtkOptionList and
GtkOptionListRow are opaque so it's not possible to create a derived
widget to do this. Also there would need to be some api to add and
remove GtkOptionListRows to and from the GtkOptionList. This would make
it possible to recreate something like BraseroMediumSelection which
displays an icon next to the drive name.

The test app is really useful for giving a good feel for how things
work. I really like the search, it makes selecting from a long list so
much easier. It's great that it's matching substrings rather than prefixes.

It would be nice if the popover closed when the user pressed enter, it
always feels wrong to me to have to press escape to close something
which I don't want to cancel. I find this is a general problem with
popovers rather than this widget specifically. Of course it's not
straight forward for multiple selections, I'd be happy for space to
toggle the selection and enter to toggle the current item and close the
popover but can see that that could be confusing for users at first.
When searching, if there's only one match then it would be nice if enter
selected it and closed the popover.

When dealing with groups it would be nice if pressing the left arrow or
backspace went back to the main list.

When adding a custom item the resizing is a little clumsy as the stack
animation runs and then the popover resizes rather than there being a
smooth transition. Also the resizing causes other widgets to move up and
down when the GtkOptionList is embedded in the dialog which is distracting.

One question I need some feedback on is naming: We currently have
GtkComboBox and
GtkComboBoxText. I've gone with GtkCombo for now, which has the
downside that there is a widget by that name in gtk2. Alternatives
might be GtkChoice or GtkComboButton (with a possible avenue for
making the list-of-choices available for direct embeeding as
GtkComboWidget later).

I think calling it GtkChoice risks confusion with the various
GtkChoosers which are (mostly?) dialogs. Another possibility for the
name is something based on selector or selection - GtkSelectButton and
GtkSelector or GtkSelectionButton and GtkSelectionList maybe.

One last thing the documentation mentions #GtkOptionListBox I think this
must be a victim of search and replace when it was renamed from GtkCombo.

I hope you find these comments helpful, I think this is a nice
alternative to GtkComboBox.

Best Wishes

Phillip



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]