[gtk+] GtkListBox: Implement non-selectable rows
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] GtkListBox: Implement non-selectable rows
- Date: Wed, 16 Jul 2014 03:59:00 +0000 (UTC)
commit 0bfad993ac888382d028afe28d8bc74305bcc45d
Author: Matthias Clasen <mclasen redhat com>
Date: Tue Jul 15 23:14:28 2014 -0400
GtkListBox: Implement non-selectable rows
This commit changes things so that we never mark non-selectable
rows as selected.
gtk/gtklistbox.c | 10 ++++++++++
1 files changed, 10 insertions(+), 0 deletions(-)
---
diff --git a/gtk/gtklistbox.c b/gtk/gtklistbox.c
index a679edb..1095f6f 100644
--- a/gtk/gtklistbox.c
+++ b/gtk/gtklistbox.c
@@ -1388,6 +1388,9 @@ static gboolean
gtk_list_box_row_set_selected (GtkListBoxRow *row,
gboolean selected)
{
+ if (!ROW_PRIV (row)->selectable)
+ return FALSE;
+
if (ROW_PRIV (row)->selected != selected)
{
ROW_PRIV (row)->selected = selected;
@@ -1448,11 +1451,15 @@ static void
gtk_list_box_select_row_internal (GtkListBox *box,
GtkListBoxRow *row)
{
+ if (!ROW_PRIV (row)->selectable)
+ return;
+
if (ROW_PRIV (row)->selected)
return;
if (BOX_PRIV (box)->selection_mode == GTK_SELECTION_NONE)
return;
+
if (BOX_PRIV (box)->selection_mode != GTK_SELECTION_MULTIPLE)
gtk_list_box_unselect_all_internal (box);
@@ -1521,6 +1528,9 @@ gtk_list_box_update_selection (GtkListBox *box,
if (priv->selection_mode == GTK_SELECTION_NONE)
return;
+ if (!ROW_PRIV (row)->selectable)
+ return;
+
if (priv->selection_mode == GTK_SELECTION_BROWSE)
{
gtk_list_box_unselect_all_internal (box);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]