#include "gtkselectionmodel.h"
#include "gtkfilechooserutils.h"
#include "gtkfilechooserwidgetprivate.h"
+#include "gtklistitem.h"
struct _GtkFileChooserCell
{
GFileInfo *item;
gboolean selected;
guint position;
+ GtkListItem *list_item;
gboolean show_time;
};
PROP_SELECTED,
PROP_ITEM,
PROP_SHOW_TIME,
+ PROP_LIST_ITEM,
};
#define ICON_SIZE 16
return TRUE;
}
+static void
+update_list_item (GtkFileChooserCell *self)
+{
+ if (self->list_item)
+ gtk_list_item_set_selectable (self->list_item, get_selectable (self));
+}
+
static void
gtk_file_chooser_cell_set_property (GObject *object,
guint prop_id,
gtk_widget_remove_css_class (GTK_WIDGET (self), "dim-label");
else
gtk_widget_add_css_class (GTK_WIDGET (self), "dim-label");
+
+ update_list_item (self);
break;
case PROP_SHOW_TIME:
self->show_time = g_value_get_boolean (value);
break;
+ case PROP_LIST_ITEM:
+ self->list_item = g_value_get_object (value);
+
+ update_list_item (self);
+ break;
+
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
FALSE,
GTK_PARAM_READWRITE));
+ g_object_class_install_property (object_class, PROP_LIST_ITEM,
+ g_param_spec_object ("list-item", NULL, NULL,
+ GTK_TYPE_LIST_ITEM,
+ GTK_PARAM_WRITABLE));
+
gtk_widget_class_set_css_name (widget_class, I_("filelistcell"));
gtk_widget_class_set_layout_manager_type (widget_class, GTK_TYPE_BIN_LAYOUT);
}
<binding name="selected">
<lookup name="selected">GtkListItem</lookup>
</binding>
+ <property name="list-item">GtkListItem</property>
<child>
<object class="GtkBox">
<binding name="tooltip-text">
<binding name="selected">
<lookup name="selected">GtkListItem</lookup>
</binding>
+ <property name="list-item">GtkListItem</property>
<child>
<object class="GtkInscription">
<property name="hexpand">1</property>
<binding name="selected">
<lookup name="selected">GtkListItem</lookup>
</binding>
+ <property name="list-item">GtkListItem</property>
<child>
<object class="GtkLabel">
<property name="hexpand">1</property>
<binding name="selected">
<lookup name="selected">GtkListItem</lookup>
</binding>
+ <property name="list-item">GtkListItem</property>
<child>
<object class="GtkLabel">
<property name="hexpand">1</property>
<binding name="selected">
<lookup name="selected">GtkListItem</lookup>
</binding>
+ <property name="list-item">GtkListItem</property>
<child>
<object class="GtkBox">
<property name="spacing">6</property>
<binding name="selected">
<lookup name="selected">GtkListItem</lookup>
</binding>
+ <property name="list-item">GtkListItem</property>
<child>
<object class="GtkBox">
<property name="orientation">vertical</property>