Commit Graph

82 Commits

Author SHA1 Message Date
Benjamin Otte
b5a8b7ef3b widget: Make _gtk_set_simple_clip() take an optional content clip 2014-08-21 00:54:07 +02:00
Matthias Clasen
87ad4ec2c2 GtkListBox: fix up docs 2014-08-16 21:40:39 -04:00
Timm Bäder
f09573757d GtkListBoxRow: Set clip
https://bugzilla.gnome.org/show_bug.cgi?id=734709
2014-08-14 00:13:18 -04:00
Florian Müllner
6f857f87dc listbox: Add missing ::row-selected emissions
Rows are not necessarily selected via select_row_internal(), add
the missing signal emissions there. Also the signal should be emitted
when removing the selection altogether.

https://bugzilla.gnome.org/show_bug.cgi?id=729809
2014-08-03 23:17:01 +02:00
Matthias Clasen
fffd58fca8 GtkListBox: Mention activatable and selectable in the docs 2014-07-15 23:57:34 -04:00
Matthias Clasen
0bfad993ac GtkListBox: Implement non-selectable rows
This commit changes things so that we never mark non-selectable
rows as selected.
2014-07-15 23:57:33 -04:00
Matthias Clasen
7932370ef8 GtkListBox: Style selectable rows differently
We now apply the .button style class to rows that are either
activatable or selectable. Selectable rows only get the .button
if the listbox allows selection. This implies that we need to
update row styles when the selection mode changes, or when the
row gets added to a listbox.
2014-07-15 23:56:47 -04:00
Matthias Clasen
71f589c0b0 GtkListBox: Add a GtkListBoxRow:selectable property
Having an explicit property for this will make it easier
to have a hover style only for rows which are activatable
or selectable.

Rows are selectable by default, to preserve compatibility.
2014-07-15 23:56:47 -04:00
Matthias Clasen
880c6678eb Fix documentation typos 2014-07-15 23:56:47 -04:00
Matthias Clasen
83e9e0bd8f GtkListBox: Refactor ::activatable implementation
Store the value in the row struct, and split the style updating
out into a separate function.
2014-07-15 22:42:29 -04:00
Matthias Clasen
27244fb9d7 listbox: Update docs
Multiple selection is supported now.
2014-07-14 08:48:33 -04:00
Matthias Clasen
a67570b9e0 listbox: Avoid a warning
Don't try to set an adjustment value if we don't have an adjustment.
2014-07-13 15:51:03 -04:00
Matthias Clasen
a2ac9e1baa listbox: Scroll headers on screen
The listbox code relies on the container focus adjustment handling
to scroll the cursor row on screen. But GtkContainer has no idea
about row headers, so ensure that we scroll the header on screen too.
2014-07-13 13:00:37 -04:00
Paolo Borelli
808705327d list-box: fix typo in natural size computation 2014-07-13 15:47:03 +02:00
Matthias Clasen
2b9285e52e GtkListBox: Add an activatable property for rows
This will let us theme activatable rows differently.
We also avoid emitting the ::row-activated signal for
rows that are not activatable. For compatibility reasons,
rows are activatable by default.

https://bugzilla.gnome.org/show_bug.cgi?id=733112
2014-07-13 09:26:27 -04:00
Matthias Clasen
6f6cedcc66 Trivial typo fix 2014-07-12 14:47:48 -04:00
Matthias Clasen
e31056f9b3 GtkListBox: Animate keybindings 2014-07-02 20:58:16 -04:00
Matthias Clasen
6e03ac9958 GtkListBox: Use G_PARAM_EXPLICIT_NOTIFY 2014-06-09 13:30:50 -04:00
Carlos Garnacho
933ff62f66 listbox: Use multipress gesture for row selection/activation
This gesture replaces the button_press/release_event handlers.
2014-06-05 16:15:54 +02:00
Evan Nemerson
54ec42f035 gtk: port many nullability annotation fixes from Vala bindings
https://bugzilla.gnome.org/show_bug.cgi?id=730745
2014-05-30 13:24:20 -07:00
Cosimo Cecchi
9eb1e1b15e listbox: don't use focus-line-width 2014-05-09 11:02:46 -07:00
Cosimo Cecchi
241b4c0c75 listbox: don't use focus padding 2014-05-09 11:02:43 -07:00
Matthias Clasen
c813765430 GtkListBox: improve the docs
The documentation was not really clear about ::row-selected
not working for multi-selection.
2014-05-08 07:33:01 -04:00
Paolo Borelli
abf10a74b7 listbox: check gsequence end iter in get_row_at_index 2014-05-04 19:45:28 +02:00
Cosimo Cecchi
24fd96d837 listbox: fix a segfault
Don't dereference a NULL pointer.
2014-05-01 19:48:41 +02:00
Benjamin Otte
d7a3e67025 listbox: Remove unneeded checks
Size vfuncs always get non-null out variables passed, so no need to
check for NULL.
2014-05-01 14:51:28 +02:00
Matthias Clasen
0d55346fbb list-box: Fix copy-paste error
The new function gtk_list_box_get_selected_rows was implemented
as gtk_list_box_get_selected_children.
2014-04-13 14:04:08 -07:00
Matthias Clasen
dbf3a0681a listbox: Emit ::row-selected as we used to
The listbox selection test was failing because we were not
emitting these signals anymore.
2014-04-13 14:04:08 -07:00
Matthias Clasen
69ef54bcd9 listbox: keep emitting ::row-selected
This was accidentally lost when multi-selection was added, causing
sidebars like the one in gnome-contacts or polari to not work any
more.
2014-04-07 23:17:56 -04:00
Matthias Clasen
125c9f207f list box: Avoid excessive signals
We were emitting the a11y ::selection-changed signal much more
often than ::selected-rows-changed. Thats not necessary.
2014-04-06 01:44:38 -04:00
Matthias Clasen
3fe243d346 list box: Cosmetic changes
Shorten variable names from list_box to box, throughout,
and use the BOX_PRIV macro everywhere.
2014-04-06 01:44:37 -04:00
Matthias Clasen
f652120347 list box: Implement multiple selection
This largely copies the flox box implementation, including the
same key bindings.
2014-04-06 01:44:36 -04:00
Matthias Clasen
463c89e540 listbox: Add multi-selection API
This commit adds API for dealing with multi-selection. It is identical
to the flow box API for this purpose. The implementation is still limited
to single-selection, and will be updated in subsequent commits.
2014-04-06 01:44:35 -04:00
William Jon McCann
469d333aa2 docs: use Returns: consistently
Instead of Return value:
2014-02-19 18:56:05 -05:00
William Jon McCann
e34bd4137d docs: use apostrophes in *n't 2014-02-07 13:32:47 -05:00
Carlos Garnacho
628b1f5e1c listbox: return GDK_EVENT_STOP if button events were handled
The button press/release handlers did invariably return FALSE, even
though it shouldn't if a row was found on the event coordinates. Also,
use GDK_EVENT_* defines for the return values.
2014-01-28 16:44:01 +01:00
Timm Bäder
dd6f4fb785 GtkListBox: Expand the placeholder
https://bugzilla.gnome.org/show_bug.cgi?id=711255
2013-11-09 10:50:02 -05:00
Florian Müllner
dd85acbaf1 listbox: Fix keynav_failed() parameter in move_cursor()
The 'direction' parameter to gtk_widget_keynav_failed() is based on
gtk_list_box_move_cursor()'s 'count' parameter. However if the passed
in movement is GTK_MOVEMENT_DISPLAY_LINES, 'count' is modified by
the keynav handling and will always be 0. To avoid messing up the
'direction' parameter, use a local variable for keynav handling and
leave 'count' untouched.

https://bugzilla.gnome.org/show_bug.cgi?id=709687
2013-10-11 13:11:59 +02:00
Timm Bäder
01d278a74f gtk_list_box_set_focus: Handle ist_box == NULL
Rows without a parent GtkListBox can happen in Glade and its previewer.
2013-10-03 14:05:12 +02:00
Matthias Clasen
3f6a1dc9a9 More formatting style adjustments
Lose a whole bunch of unnecessary 'real', shortening
excessively long function names.
2013-09-27 22:00:38 -04:00
Matthias Clasen
c31a34d5ee Some coding style improvements
Use g_return_if_fail in GTK+ style in all public APIs,
avoid dereferencing variables early, shorten some
function names.
2013-09-27 21:39:10 -04:00
Matthias Clasen
f0aba21fd2 Small cleanup for the previous commit
When setting an accessible type, we don't need to
set an accessible row anymore.
2013-09-21 20:56:46 -04:00
Matthias Clasen
c22e27f986 Add a GtkListBoxRow accessible
This lets us do two things:
1. Set the list-item role
2. Set selectable and selected states as appropriate

https://bugzilla.gnome.org/show_bug.cgi?id=692258
2013-09-21 20:51:22 -04:00
Alexander Larsson
7b7b8eaaff listbox: Don't crash if cursor_row is NULL in real_focus
https://bugzilla.gnome.org/show_bug.cgi?id=708320
2013-09-19 22:38:41 +02:00
Kalev Lember
5f62785d41 listbox: Jump over insensitive rows with keynav
https://bugzilla.gnome.org/show_bug.cgi?id=708128
2013-09-16 11:43:26 +02:00
Alejandro Piñeiro
c6943fcbcf a11y: set ATK_ROLE_LIST_ITEM to GtkListBoxRow
https://bugzilla.gnome.org/show_bug.cgi?id=707915
2013-09-13 11:01:44 +02:00
Alexander Larsson
90383300d2 listbox: Set activate_signal on listboxrow class
keyboard navigation didn't support activation since we moved
the keynav to the child row widgets. We fix this by adding a
activate signal handler for the row and setting
widget_class->activate_signal to it.

https://bugzilla.gnome.org/show_bug.cgi?id=707778
2013-09-10 16:20:56 +02:00
Alexander Larsson
5ed8db986f GtkListBox: ref_sink new object in set_header and set_adjustment
These are taking ownership of the object in the hierarchy, so should
sink any floating refs to make it easy to use in C code.
2013-09-04 21:01:50 +02:00
Kalev Lember
653fc4fd4b listbox: Reorder code
This just moves the gtk_list_box_insert function to where the rest of the
public API is defined.

https://bugzilla.gnome.org/show_bug.cgi?id=705558
2013-08-08 11:00:32 +02:00
Kalev Lember
43c68e118f listbox: Implement gtk_list_box_insert()
... to make it possible to insert rows in the middle of the list without having
to fiddle with the sort functions. One of the first users is going to be Glade.

https://bugzilla.gnome.org/show_bug.cgi?id=705558
2013-08-08 11:00:26 +02:00