aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2011-12-11 11:02:37 +0000
committerChristian Grothoff <christian@grothoff.org>2011-12-11 11:02:37 +0000
commit3930419a863507653f78b7365fb48faa3bdb99d7 (patch)
tree447c8b335bcdd0b88252512b9458abdc5208dbf1
parent79f2d44eaeddce479082ade8ddbc9eb00a984cba (diff)
downloadgnunet-gtk-3930419a863507653f78b7365fb48faa3bdb99d7.tar.gz
gnunet-gtk-3930419a863507653f78b7365fb48faa3bdb99d7.zip
-LRN: Simplify visibility management
-rw-r--r--contrib/gnunet_fs_gtk_about_window.glade.in5
-rw-r--r--src/lib/about.c10
2 files changed, 5 insertions, 10 deletions
diff --git a/contrib/gnunet_fs_gtk_about_window.glade.in b/contrib/gnunet_fs_gtk_about_window.glade.in
index 880fddb4..ad940758 100644
--- a/contrib/gnunet_fs_gtk_about_window.glade.in
+++ b/contrib/gnunet_fs_gtk_about_window.glade.in
@@ -208,10 +208,11 @@
208 <child> 208 <child>
209 <object class="GtkScrolledWindow" id="about_license_scroller"> 209 <object class="GtkScrolledWindow" id="about_license_scroller">
210 <property name="can_focus">True</property> 210 <property name="can_focus">True</property>
211 <property name="hscrollbar_policy">automatic</property> 211 <property name="hscrollbar_policy">never</property>
212 <property name="vscrollbar_policy">automatic</property> 212 <property name="shadow_type">out</property>
213 <child> 213 <child>
214 <object class="GtkTextView" id="about_license_textview"> 214 <object class="GtkTextView" id="about_license_textview">
215 <property name="visible">True</property>
215 <property name="can_focus">True</property> 216 <property name="can_focus">True</property>
216 <property name="editable">False</property> 217 <property name="editable">False</property>
217 <property name="wrap_mode">word</property> 218 <property name="wrap_mode">word</property>
diff --git a/src/lib/about.c b/src/lib/about.c
index 7b7f27ee..52a01451 100644
--- a/src/lib/about.c
+++ b/src/lib/about.c
@@ -39,26 +39,21 @@ static void
39about_window_show_exclusively (GtkBuilder *builder, gchar *name) 39about_window_show_exclusively (GtkBuilder *builder, gchar *name)
40{ 40{
41 GtkWidget *about_credits_notebook; 41 GtkWidget *about_credits_notebook;
42 GtkWidget *about_license_textview;
43 GtkWidget *about_license_scroller; 42 GtkWidget *about_license_scroller;
44 about_credits_notebook = GTK_WIDGET (gtk_builder_get_object (builder, "about_credits_notebook")); 43 about_credits_notebook = GTK_WIDGET (gtk_builder_get_object (builder, "about_credits_notebook"));
45 about_license_textview = GTK_WIDGET (gtk_builder_get_object (builder, "about_license_textview"));
46 about_license_scroller = GTK_WIDGET (gtk_builder_get_object (builder, "about_license_scroller")); 44 about_license_scroller = GTK_WIDGET (gtk_builder_get_object (builder, "about_license_scroller"));
47 if (name == NULL) 45 if (name == NULL)
48 { 46 {
49 gtk_widget_hide (about_credits_notebook); 47 gtk_widget_hide (about_credits_notebook);
50 gtk_widget_hide (about_license_textview);
51 gtk_widget_hide (about_license_scroller); 48 gtk_widget_hide (about_license_scroller);
52 } 49 }
53 else if (strcmp ("about_credits_notebook", name) == 0) 50 else if (strcmp ("about_credits_notebook", name) == 0)
54 { 51 {
55 gtk_widget_show (about_credits_notebook); 52 gtk_widget_show (about_credits_notebook);
56 gtk_widget_hide (about_license_textview);
57 gtk_widget_hide (about_license_scroller); 53 gtk_widget_hide (about_license_scroller);
58 } 54 }
59 else if (strcmp ("about_license_textview", name) == 0) 55 else if (strcmp ("about_license_scroller", name) == 0)
60 { 56 {
61 gtk_widget_show (about_license_textview);
62 gtk_widget_show (about_license_scroller); 57 gtk_widget_show (about_license_scroller);
63 gtk_widget_hide (about_credits_notebook); 58 gtk_widget_hide (about_credits_notebook);
64 } 59 }
@@ -76,7 +71,6 @@ GNUNET_GTK_about_window_realized (GtkWidget *widget, gpointer user_data)
76 gtk_text_buffer_set_text (license_contents, license, -1); 71 gtk_text_buffer_set_text (license_contents, license, -1);
77 g_free (license); 72 g_free (license);
78 } 73 }
79 about_window_show_exclusively (builder, NULL);
80} 74}
81 75
82G_MODULE_EXPORT void 76G_MODULE_EXPORT void
@@ -106,7 +100,7 @@ G_MODULE_EXPORT void
106GNUNET_GTK_about_license_button_clicked (GtkButton *widget, gpointer user_data) 100GNUNET_GTK_about_license_button_clicked (GtkButton *widget, gpointer user_data)
107{ 101{
108 GtkBuilder *builder = GTK_BUILDER (user_data); 102 GtkBuilder *builder = GTK_BUILDER (user_data);
109 about_window_show_exclusively (builder, "about_license_textview"); 103 about_window_show_exclusively (builder, "about_license_scroller");
110} 104}
111 105
112/** 106/**