[gnome-todo/wip/lists] storage-popover: update sensitivity of create button
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-todo/wip/lists] storage-popover: update sensitivity of create button
- Date: Fri, 12 Jun 2015 23:41:32 +0000 (UTC)
commit 9fd40e3c1e8af64e737d4dfa257e21ac49e0eb34
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date: Fri Jun 12 19:54:27 2015 -0300
storage-popover: update sensitivity of create button
data/ui/storage-popover.ui | 1 +
src/gtd-storage-popover.c | 18 ++++++++++++++++++
2 files changed, 19 insertions(+), 0 deletions(-)
---
diff --git a/data/ui/storage-popover.ui b/data/ui/storage-popover.ui
index 94ce75a..a0c80cf 100644
--- a/data/ui/storage-popover.ui
+++ b/data/ui/storage-popover.ui
@@ -72,6 +72,7 @@
<property name="can_focus">True</property>
<property name="hexpand">True</property>
<property name="width_chars">35</property>
+ <signal name="notify::text" handler="gtd_storage_popover__text_changed_cb"
object="GtdStoragePopover" swapped="yes" />
</object>
<packing>
<property name="expand">False</property>
diff --git a/src/gtd-storage-popover.c b/src/gtd-storage-popover.c
index af73453..ff24655 100644
--- a/src/gtd-storage-popover.c
+++ b/src/gtd-storage-popover.c
@@ -27,6 +27,7 @@ typedef struct
{
GtkWidget *change_location_button;
GtkWidget *location_provider_image;
+ GtkWidget *new_list_create_button;
GtkWidget *stack;
GtkWidget *storage_selector;
@@ -50,6 +51,21 @@ enum {
};
static void
+gtd_storage_popover__text_changed_cb (GtdStoragePopover *popover,
+ GParamSpec *spec,
+ GtkEntry *entry)
+{
+ GtdStoragePopoverPrivate *priv;
+
+ g_return_if_fail (GTD_IS_STORAGE_POPOVER (popover));
+ g_return_if_fail (GTK_IS_ENTRY (entry));
+
+ priv = popover->priv;
+
+ gtk_widget_set_sensitive (priv->new_list_create_button, gtk_entry_get_text_length (entry) > 0);
+}
+
+static void
gtd_storage_popover__change_location_clicked (GtdStoragePopover *popover,
GtkWidget *button)
{
@@ -190,11 +206,13 @@ gtd_storage_popover_class_init (GtdStoragePopoverClass *klass)
gtk_widget_class_bind_template_child_private (widget_class, GtdStoragePopover, change_location_button);
gtk_widget_class_bind_template_child_private (widget_class, GtdStoragePopover, location_provider_image);
+ gtk_widget_class_bind_template_child_private (widget_class, GtdStoragePopover, new_list_create_button);
gtk_widget_class_bind_template_child_private (widget_class, GtdStoragePopover, stack);
gtk_widget_class_bind_template_child_private (widget_class, GtdStoragePopover, storage_selector);
gtk_widget_class_bind_template_callback (widget_class, gtd_storage_popover__change_location_clicked);
gtk_widget_class_bind_template_callback (widget_class, gtd_storage_popover__storage_selected);
+ gtk_widget_class_bind_template_callback (widget_class, gtd_storage_popover__text_changed_cb);
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]