gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r29269 - gnunet-gtk/src/fs


From: gnunet
Subject: [GNUnet-SVN] r29269 - gnunet-gtk/src/fs
Date: Sun, 15 Sep 2013 20:45:13 +0200

Author: grothoff
Date: 2013-09-15 20:45:13 +0200 (Sun, 15 Sep 2013)
New Revision: 29269

Modified:
   gnunet-gtk/src/fs/gnunet-fs-gtk_main-window-view-toggles.c
Log:
hide entire extras vbox if neither preview nor metadata are shown

Modified: gnunet-gtk/src/fs/gnunet-fs-gtk_main-window-view-toggles.c
===================================================================
--- gnunet-gtk/src/fs/gnunet-fs-gtk_main-window-view-toggles.c  2013-09-15 
18:31:10 UTC (rev 29268)
+++ gnunet-gtk/src/fs/gnunet-fs-gtk_main-window-view-toggles.c  2013-09-15 
18:45:13 UTC (rev 29269)
@@ -51,6 +51,28 @@
 
 
 /**
+ * If nothing in the "GNUNET_GTK_main_window_extras_vbox" is visible,
+ * hide the entire vbox (and show it if anything is visible).
+ */
+static void
+check_extras ()
+{
+  GtkCheckMenuItem *m1;
+  GtkCheckMenuItem *m2;
+  GtkWidget *wbox;
+
+  m1 = GTK_CHECK_MENU_ITEM (GNUNET_FS_GTK_get_main_window_object 
("GNUNET_GTK_main_menu_view_metadata"));
+  m2 = GTK_CHECK_MENU_ITEM (GNUNET_FS_GTK_get_main_window_object 
("GNUNET_GTK_main_menu_view_preview"));
+  wbox = GTK_WIDGET (GNUNET_FS_GTK_get_main_window_object 
("GNUNET_GTK_main_window_extras_vbox"));
+  if ( (gtk_check_menu_item_get_active (m1)) ||
+       (gtk_check_menu_item_get_active (m2)) )
+    gtk_widget_show (wbox);
+  else
+    gtk_widget_hide (wbox);
+}
+
+
+/**
  * Preview view is toggled.
  *
  * @param dummy widget triggering the event
@@ -62,6 +84,7 @@
 {
   toggle_view ("GNUNET_GTK_main_window_preview_image",
                "GNUNET_GTK_main_menu_view_preview");
+  check_extras ();
 }
 
 
@@ -77,6 +100,8 @@
 {
   toggle_view ("GNUNET_GTK_main_window_metadata_treeview",
                "GNUNET_GTK_main_menu_view_metadata");
+  check_extras ();
+
 }
 
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]