[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

gEDA-cvs: pcb.git: branch: master updated (57eabeda63fd819fa34d240b41c3f4cbc8f2a20a)



The branch, master has been updated
       via  57eabeda63fd819fa34d240b41c3f4cbc8f2a20a (commit)
       via  abe9eee3c7ad1f9534ca8d81dc4fcd659e67c4fa (commit)
       via  807bd0c38968e7df755df3f90935e5f8e640eecb (commit)
       via  8eec5e608210cfd6dd6742392cadf80f80617634 (commit)
      from  3258110fb9d36ceb0519271a42b09f9213192211 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


=========
 Summary
=========

 src/hid/gtk/gui-top-window.c |   87 ++++++++++++++++++------------------------
 src/hid/gtk/gui.h            |    2 +-
 2 files changed, 38 insertions(+), 51 deletions(-)


=================
 Commit Messages
=================

commit 57eabeda63fd819fa34d240b41c3f4cbc8f2a20a
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>

    hid/gtk: Remove some more temporary variable assignments
    
    These make the code harder to follow, as the same temporary variable
    is used again and again to refer to different widgets.

:100644 100644 283b345... 5c78543... M	src/hid/gtk/gui-top-window.c

commit abe9eee3c7ad1f9534ca8d81dc4fcd659e67c4fa
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>

    hid/gtk: Don't use an hbox to pack the board name label
    
    The hbox only has one child, so use the name label directly.

:100644 100644 651f7f5... 283b345... M	src/hid/gtk/gui-top-window.c
:100644 100644 e7e5f55... 8dfc203... M	src/hid/gtk/gui.h

commit 807bd0c38968e7df755df3f90935e5f8e640eecb
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>

    hid/gtk: Skip the generic "hbox" variable when storing the widget anyway
    
    For widgets we keep references to in the ghidgui structure, we avoid
    confusion by assigning directly to the more descriptive ghidgui variable.

:100644 100644 badc61b... 651f7f5... M	src/hid/gtk/gui-top-window.c

commit 8eec5e608210cfd6dd6742392cadf80f80617634
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>

    hid/gtk: Don't pack a frame around the menu bar

:100644 100644 d08a960... badc61b... M	src/hid/gtk/gui-top-window.c

=========
 Changes
=========

commit 57eabeda63fd819fa34d240b41c3f4cbc8f2a20a
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>

    hid/gtk: Remove some more temporary variable assignments
    
    These make the code harder to follow, as the same temporary variable
    is used again and again to refer to different widgets.

diff --git a/src/hid/gtk/gui-top-window.c b/src/hid/gtk/gui-top-window.c
index 283b345..5c78543 100644
--- a/src/hid/gtk/gui-top-window.c
+++ b/src/hid/gtk/gui-top-window.c
@@ -1231,8 +1231,10 @@ ghid_build_pcb_top_window (void)
   ghidgui->menu_hbox = gtk_hbox_new (FALSE, 0);
   gtk_box_pack_start (GTK_BOX (ghidgui->top_hbox), ghidgui->menu_hbox,
 		      FALSE, FALSE, 0);
-  vbox = gtk_vbox_new(FALSE, 0);
-  gtk_box_pack_start(GTK_BOX(ghidgui->menu_hbox), vbox, FALSE, FALSE, 0);
+
+  ghidgui->mode_buttons1_vbox = gtk_vbox_new (FALSE, 0);
+  gtk_box_pack_start (GTK_BOX (ghidgui->menu_hbox),
+                      ghidgui->mode_buttons1_vbox, FALSE, FALSE, 0);
 
   /* Build layer menus */
   ghidgui->layer_selector = ghid_layer_selector_new ();
@@ -1247,19 +1249,20 @@ ghid_build_pcb_top_window (void)
   /* Build main menu */
   ghidgui->menu_bar = ghid_load_menus ();
   make_actions (port);
-  gtk_box_pack_start(GTK_BOX(vbox), ghidgui->menu_bar, FALSE, FALSE, 0);
+  gtk_box_pack_start (GTK_BOX (ghidgui->mode_buttons1_vbox),
+                      ghidgui->menu_bar, FALSE, FALSE, 0);
 
-  frame = gtk_frame_new(NULL);
-  gtk_widget_show(frame);
-  g_object_ref(G_OBJECT(frame));
-  ghidgui->mode_buttons1_vbox = vbox;
-  ghidgui->mode_buttons1_frame = frame;
+  ghidgui->mode_buttons1_frame = gtk_frame_new (NULL);
+  gtk_widget_show (ghidgui->mode_buttons1_frame);
+  g_object_ref (ghidgui->mode_buttons1_frame);
   ghidgui->mode_buttons1_hbox = gtk_hbox_new (FALSE, 0);
-  gtk_container_add(GTK_CONTAINER(frame), ghidgui->mode_buttons1_hbox);
+  gtk_container_add (GTK_CONTAINER (ghidgui->mode_buttons1_frame),
+                     ghidgui->mode_buttons1_hbox);
 
   vbox = gtk_vbox_new(FALSE, 0);
   gtk_box_pack_end(GTK_BOX(ghidgui->top_hbox), vbox,
 		      FALSE, FALSE, 0);
+
   ghidgui->compact_vbox = gtk_vbox_new (FALSE, 0);
   gtk_box_pack_end (GTK_BOX (ghidgui->top_hbox), ghidgui->compact_vbox,
 		      FALSE, FALSE, 0);
@@ -1323,15 +1326,16 @@ ghid_build_pcb_top_window (void)
   gtk_box_pack_start (GTK_BOX(vbox), ghidgui->layer_selector,
                       FALSE, FALSE, 0);
 
-  vbox = gtk_vbox_new(FALSE, 0);
-  gtk_box_pack_start(GTK_BOX(vbox_left), vbox, FALSE, FALSE, 0);
-  ghidgui->mode_buttons0_frame_vbox = vbox;
-  frame = gtk_frame_new(NULL);
-  ghidgui->mode_buttons0_frame = frame;
-  gtk_widget_show(frame);
-  g_object_ref(G_OBJECT(frame));
-  ghidgui->mode_buttons0_vbox = gtk_vbox_new(FALSE, 0);
-  gtk_container_add(GTK_CONTAINER(frame), ghidgui->mode_buttons0_vbox);
+  ghidgui->mode_buttons0_frame_vbox = gtk_vbox_new (FALSE, 0);
+  gtk_box_pack_start (GTK_BOX(vbox_left),
+                      ghidgui->mode_buttons0_frame_vbox, FALSE, FALSE, 0);
+
+  ghidgui->mode_buttons0_frame = gtk_frame_new (NULL);
+  gtk_widget_show (ghidgui->mode_buttons0_frame);
+  g_object_ref (ghidgui->mode_buttons0_frame);
+  ghidgui->mode_buttons0_vbox = gtk_vbox_new (FALSE, 0);
+  gtk_container_add (GTK_CONTAINER (ghidgui->mode_buttons0_frame),
+                     ghidgui->mode_buttons0_vbox);
   make_mode_buttons (port);
 
   frame = gtk_frame_new(NULL);

commit abe9eee3c7ad1f9534ca8d81dc4fcd659e67c4fa
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>

    hid/gtk: Don't use an hbox to pack the board name label
    
    The hbox only has one child, so use the name label directly.

diff --git a/src/hid/gtk/gui-top-window.c b/src/hid/gtk/gui-top-window.c
index 651f7f5..283b345 100644
--- a/src/hid/gtk/gui-top-window.c
+++ b/src/hid/gtk/gui-top-window.c
@@ -636,13 +636,13 @@ ghid_window_set_name_label (gchar * name)
 
   if (ghidgui->ghid_title_window)
     {
-      gtk_widget_hide (ghidgui->label_hbox);
+      gtk_widget_hide (ghidgui->name_label);
       str = g_strdup_printf ("%s%s (%s) - PCB", PCB->Changed ? "*": "",
                              ghidgui->name_label_string, filename);
     }
   else
     {
-      gtk_widget_show (ghidgui->label_hbox);
+      gtk_widget_show (ghidgui->name_label);
       str = g_strdup_printf (" <b><big>%s</big></b> ",
                              ghidgui->name_label_string);
       gtk_label_set_markup (GTK_LABEL (ghidgui->name_label), str);
@@ -1271,20 +1271,15 @@ ghid_build_pcb_top_window (void)
    * The board name is optionally in compact_vbox and the position
    * labels will be packed below or to the side.
    */
-  ghidgui->label_hbox = gtk_hbox_new (FALSE, 0);
-  gtk_box_pack_start (GTK_BOX (ghidgui->compact_vbox), ghidgui->label_hbox, TRUE, FALSE, 2);
-
-  label = gtk_label_new ("");
-  gtk_label_set_use_markup (GTK_LABEL (label), TRUE);
+  ghidgui->name_label = gtk_label_new ("");
+  gtk_label_set_use_markup (GTK_LABEL (ghidgui->name_label), TRUE);
   if (ghidgui->name_label_string)
-    s =
-      g_strdup_printf (" <b><big>%s</big></b> ", ghidgui->name_label_string);
+    s = g_strdup_printf (" <b><big>%s</big></b> ", ghidgui->name_label_string);
   else
     s = g_strdup ("<b><big>%s</big></b>");
-  gtk_label_set_markup (GTK_LABEL (label), s);
+  gtk_label_set_markup (GTK_LABEL (ghidgui->name_label), s);
   g_free (s);
-  gtk_box_pack_start (GTK_BOX (ghidgui->label_hbox), label, FALSE, TRUE, 4);
-  ghidgui->name_label = label;
+  gtk_box_pack_start (GTK_BOX (ghidgui->compact_vbox), ghidgui->name_label, TRUE, FALSE, 6);
 
   /*
    * The position_box pack location depends on user setting of
diff --git a/src/hid/gtk/gui.h b/src/hid/gtk/gui.h
index e7e5f55..8dfc203 100644
--- a/src/hid/gtk/gui.h
+++ b/src/hid/gtk/gui.h
@@ -104,7 +104,7 @@ typedef struct
   GtkEntry *command_entry;
 
   GtkWidget *top_hbox,
-    *menu_hbox, *compact_vbox, *compact_hbox, *position_hbox, *label_hbox,
+    *menu_hbox, *compact_vbox, *compact_hbox, *position_hbox,
     *mode_buttons0_vbox, *mode_buttons1_hbox, *mode_buttons1_vbox,
     *mode_buttons0_frame, *mode_buttons1_frame, *mode_buttons0_frame_vbox;
   GtkWidget *menu_bar, *layer_selector;

commit 807bd0c38968e7df755df3f90935e5f8e640eecb
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>

    hid/gtk: Skip the generic "hbox" variable when storing the widget anyway
    
    For widgets we keep references to in the ghidgui structure, we avoid
    confusion by assigning directly to the more descriptive ghidgui variable.

diff --git a/src/hid/gtk/gui-top-window.c b/src/hid/gtk/gui-top-window.c
index badc61b..651f7f5 100644
--- a/src/hid/gtk/gui-top-window.c
+++ b/src/hid/gtk/gui-top-window.c
@@ -1208,7 +1208,7 @@ static void
 ghid_build_pcb_top_window (void)
 {
   GtkWidget *window;
-  GtkWidget *vbox_main, *vbox_left, *hbox_middle, *hbox = NULL;
+  GtkWidget *vbox_main, *vbox_left, *hbox_middle, *hbox;
   GtkWidget *viewport, *ebox, *vbox, *frame;
   GtkWidget *label;
   GHidPort *port = &ghid_port;
@@ -1221,9 +1221,8 @@ ghid_build_pcb_top_window (void)
   gtk_container_add (GTK_CONTAINER (window), vbox_main);
 
   /* -- Top control bar */
-  hbox = gtk_hbox_new (FALSE, 4);
-  gtk_box_pack_start (GTK_BOX (vbox_main), hbox, FALSE, FALSE, 0);
-  ghidgui->top_hbox = hbox;
+  ghidgui->top_hbox = gtk_hbox_new (FALSE, 4);
+  gtk_box_pack_start (GTK_BOX (vbox_main), ghidgui->top_hbox, FALSE, FALSE, 0);
 
   /*
    * menu_hbox will be made insensitive when the gui needs
@@ -1272,9 +1271,8 @@ ghid_build_pcb_top_window (void)
    * The board name is optionally in compact_vbox and the position
    * labels will be packed below or to the side.
    */
-  hbox = gtk_hbox_new (FALSE, 0);
-  gtk_box_pack_start (GTK_BOX (ghidgui->compact_vbox), hbox, TRUE, FALSE, 2);
-  ghidgui->label_hbox = hbox;
+  ghidgui->label_hbox = gtk_hbox_new (FALSE, 0);
+  gtk_box_pack_start (GTK_BOX (ghidgui->compact_vbox), ghidgui->label_hbox, TRUE, FALSE, 2);
 
   label = gtk_label_new ("");
   gtk_label_set_use_markup (GTK_LABEL (label), TRUE);
@@ -1285,7 +1283,7 @@ ghid_build_pcb_top_window (void)
     s = g_strdup ("<b><big>%s</big></b>");
   gtk_label_set_markup (GTK_LABEL (label), s);
   g_free (s);
-  gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, TRUE, 4);
+  gtk_box_pack_start (GTK_BOX (ghidgui->label_hbox), label, FALSE, TRUE, 4);
   ghidgui->name_label = label;
 
   /*

commit 8eec5e608210cfd6dd6742392cadf80f80617634
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>

    hid/gtk: Don't pack a frame around the menu bar

diff --git a/src/hid/gtk/gui-top-window.c b/src/hid/gtk/gui-top-window.c
index d08a960..badc61b 100644
--- a/src/hid/gtk/gui-top-window.c
+++ b/src/hid/gtk/gui-top-window.c
@@ -586,34 +586,25 @@ make_menu_actions (GtkActionGroup * actions, GHidPort * port)
 
 
 /*
- * Make a frame for the top menubar, load in actions for the menus and
- * load the ui_manager string.
+ * Load in actions for the menus and layer selector
  */
 static void
-make_top_menubar (GtkWidget *menu_bar, GtkWidget * hbox, GHidPort * port)
+make_actions (GHidPort * port)
 {
-  GtkWidget *frame;
   GtkActionGroup *actions;
 
-  frame = gtk_frame_new (NULL);
-  gtk_box_pack_start (GTK_BOX (hbox), frame, FALSE, TRUE, 0);
-  gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_ETCHED_OUT);
-
   actions = gtk_action_group_new ("Actions");
   gtk_action_group_set_translation_domain (actions, NULL);
   ghidgui->main_actions = actions;
 
   make_menu_actions (actions, port);
  
-  gtk_window_add_accel_group (GTK_WINDOW (gport->top_window),
+  gtk_window_add_accel_group (GTK_WINDOW (port->top_window),
 			      ghid_main_menu_get_accel_group
                                 (GHID_MAIN_MENU (ghidgui->menu_bar)));
-  gtk_window_add_accel_group (GTK_WINDOW (gport->top_window),
+  gtk_window_add_accel_group (GTK_WINDOW (port->top_window),
 			      ghid_layer_selector_get_accel_group
                                 (GHID_LAYER_SELECTOR (ghidgui->layer_selector)));
-
-  gtk_container_add (GTK_CONTAINER (frame), menu_bar);
-
 }
 
 
@@ -1243,8 +1234,6 @@ ghid_build_pcb_top_window (void)
 		      FALSE, FALSE, 0);
   vbox = gtk_vbox_new(FALSE, 0);
   gtk_box_pack_start(GTK_BOX(ghidgui->menu_hbox), vbox, FALSE, FALSE, 0);
-  hbox = gtk_hbox_new(FALSE, 0);
-  gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
 
   /* Build layer menus */
   ghidgui->layer_selector = ghid_layer_selector_new ();
@@ -1258,7 +1247,8 @@ ghid_build_pcb_top_window (void)
                     NULL);
   /* Build main menu */
   ghidgui->menu_bar = ghid_load_menus ();
-  make_top_menubar (ghidgui->menu_bar, hbox, port);
+  make_actions (port);
+  gtk_box_pack_start(GTK_BOX(vbox), ghidgui->menu_bar, FALSE, FALSE, 0);
 
   frame = gtk_frame_new(NULL);
   gtk_widget_show(frame);




_______________________________________________
geda-cvs mailing list
geda-cvs@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-cvs