app: simpler and better-aligned packig in gimpviewablebox

This commit is contained in:
Michael Natterer
2018-04-14 02:19:50 +02:00
parent 4705684b0e
commit 257eb95258

View File

@ -629,7 +629,6 @@ gimp_viewable_box_new (GimpContainer *container,
GtkWidget *button; GtkWidget *button;
GtkWidget *vbox; GtkWidget *vbox;
GtkWidget *l; GtkWidget *l;
GtkWidget *entry_hbox = NULL;
GtkWidget *entry; GtkWidget *entry;
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, spacing); hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, spacing);
@ -661,25 +660,13 @@ gimp_viewable_box_new (GimpContainer *container,
gtk_widget_show (l); gtk_widget_show (l);
} }
if (editor_id)
{
entry_hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, spacing);
gtk_box_pack_end (GTK_BOX (vbox), entry_hbox, FALSE, FALSE, 0);
gtk_widget_show (entry_hbox);
}
entry = gimp_container_entry_new (container, context, view_size, 1); entry = gimp_container_entry_new (container, context, view_size, 1);
/* set a silly smally size request on the entry to disable /* set a silly smally size request on the entry to disable
* GtkEntry's minimal width of 150 pixels. * GtkEntry's minimal width of 150 pixels.
*/ */
gtk_entry_set_width_chars (GTK_ENTRY (entry), 4); gtk_entry_set_width_chars (GTK_ENTRY (entry), 4);
gtk_box_pack_end (GTK_BOX (vbox), entry, label ? FALSE : TRUE, FALSE, 0);
if (entry_hbox)
gtk_box_pack_start (GTK_BOX (entry_hbox), entry, TRUE, TRUE, 0);
else
gtk_box_pack_end (GTK_BOX (vbox), entry, label ? FALSE : TRUE, FALSE, 0);
gtk_widget_show (entry); gtk_widget_show (entry);
if (editor_id) if (editor_id)
@ -689,7 +676,7 @@ gimp_viewable_box_new (GimpContainer *container,
edit_button = gtk_button_new (); edit_button = gtk_button_new ();
gtk_button_set_relief (GTK_BUTTON (edit_button), GTK_RELIEF_NONE); gtk_button_set_relief (GTK_BUTTON (edit_button), GTK_RELIEF_NONE);
gtk_box_pack_end (GTK_BOX (entry_hbox), edit_button, FALSE, FALSE, 0); gtk_box_pack_end (GTK_BOX (hbox), edit_button, FALSE, FALSE, 0);
gtk_widget_show (edit_button); gtk_widget_show (edit_button);
if (editor_tooltip) if (editor_tooltip)