Minor GUI tweaking - Alex
[terminatorX.git] / src / tX_pbutton.cc
index 5c3f702793e629861cc702f44aa035989a54802e..b14fcc824c567781f73e679340519ba4c269f70f 100644 (file)
@@ -77,29 +77,30 @@ GtkWidget *tx_xpm_label_box(int     icon_id, gchar *label_text, GtkWidget **labelwid
     GtkWidget *box1;
     GtkWidget *label;
     GtkWidget *pixmapwid;
-
-    /* Create box for xpm and label */
-    box1 = gtk_hbox_new (FALSE, 0);
-       gtk_container_set_border_width (GTK_CONTAINER (box1), 0);
        
-    if (globals.button_type != BUTTON_TYPE_TEXT)
-    {
-           pixmapwid=tx_pixmap_widget(icon_id);
-           gtk_box_pack_start (GTK_BOX (box1), pixmapwid, FALSE, FALSE, 0);
-           gtk_widget_show(pixmapwid);
-    }
-
-    if ((globals.button_type != BUTTON_TYPE_ICON) || (labelwidget!=NULL))
-    {
-           label = gtk_label_new (label_text);
-           gtk_box_pack_start (GTK_BOX (box1), label, FALSE, FALSE, 0);
-           gtk_widget_show(label); 
-               if (labelwidget!=NULL) {
-                       *labelwidget=label;
-               }
-    }
-
-    return(box1);
+       switch (globals.button_type) {
+               case BUTTON_TYPE_TEXT:
+                       label = gtk_label_new(label_text);
+                       gtk_widget_show(label);
+                       if (labelwidget!=NULL) *labelwidget=label;
+                       return label;
+                       break;
+               case BUTTON_TYPE_ICON:
+                       pixmapwid=tx_pixmap_widget(icon_id);
+                       gtk_widget_show(pixmapwid);
+                       return pixmapwid;
+                       break;
+               default:
+                       box1 = gtk_hbox_new (FALSE, 2);
+                       pixmapwid=tx_pixmap_widget(icon_id);
+                       gtk_box_pack_start (GTK_BOX (box1), pixmapwid, FALSE, FALSE, 0);
+                       gtk_widget_show(pixmapwid);
+                       label = gtk_label_new (label_text);
+                       gtk_box_pack_start (GTK_BOX (box1), label, FALSE, FALSE, 0);
+                       gtk_widget_show(label); 
+                       if (labelwidget!=NULL)  *labelwidget=label;
+                       return box1;
+       }    
 }
 
 //GtkWidget *tx_xpm_button_new(int icon_id, char *label, int toggle)
@@ -113,7 +114,7 @@ extern GtkWidget *tx_xpm_button_new(int icon_id, char *label, int toggle, GtkWid
        
        box=tx_xpm_label_box(icon_id, label, labelwidget);
        gtk_widget_show(box);
-    gtk_container_set_border_width (GTK_CONTAINER (button), 2);
+    gtk_container_set_border_width (GTK_CONTAINER (button), 3);
        gtk_container_add (GTK_CONTAINER (button), box);                
        
        return(button);