[emerillon] Disable the sensitivity of the selection button if less than two pages are available
- From: Łukasz Jernaś <ljernas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [emerillon] Disable the sensitivity of the selection button if less than two pages are available
- Date: Tue, 4 May 2010 10:08:38 +0000 (UTC)
commit d91893c9cf810207ce94d4b058c8b72ebd231710
Author: Simon Wenner <simon wenner ch>
Date: Sun May 2 14:57:56 2010 +0200
Disable the sensitivity of the selection button if less than two pages are available
emerillon/sidebar.c | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
---
diff --git a/emerillon/sidebar.c b/emerillon/sidebar.c
index e487c34..03759f9 100644
--- a/emerillon/sidebar.c
+++ b/emerillon/sidebar.c
@@ -403,6 +403,7 @@ emerillon_sidebar_init (EmerillonSidebar *sidebar)
sidebar->priv->select_button = gtk_toggle_button_new ();
gtk_button_set_relief (GTK_BUTTON (sidebar->priv->select_button),
GTK_RELIEF_NONE);
+ gtk_widget_set_sensitive (sidebar->priv->select_button, FALSE);
g_signal_connect (sidebar->priv->select_button, "button_press_event",
G_CALLBACK (emerillon_sidebar_select_button_press_cb),
@@ -542,6 +543,9 @@ emerillon_sidebar_add_page (EmerillonSidebar *sidebar,
g_free (label_title);
+ if (gtk_notebook_get_n_pages (GTK_NOTEBOOK (sidebar->priv->notebook)) > 1)
+ gtk_widget_set_sensitive (sidebar->priv->select_button, TRUE);
+
g_signal_emit (G_OBJECT (sidebar), signals[SIGNAL_PAGE_ADDED],
0, main_widget);
}
@@ -604,6 +608,9 @@ emerillon_sidebar_remove_page (EmerillonSidebar *sidebar,
gtk_label_set_text (GTK_LABEL (sidebar->priv->label), "");
}
+ if (gtk_notebook_get_n_pages (GTK_NOTEBOOK (sidebar->priv->notebook)) <= 1)
+ gtk_widget_set_sensitive (sidebar->priv->select_button, FALSE);
+
g_signal_emit (G_OBJECT (sidebar),
signals[SIGNAL_PAGE_REMOVED], 0, main_widget);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]