mirror of https://github.com/GNOME/gimp.git
libgimpwidgets, plug-in: Reduce height of Load PDF dialog
This patch does the following to reduce the height of the Load PDF GUI: * Hides the title label if the PDF does not have a title. * Reduce the padding around elements * Reduces the requested height of the GimpPageSelector widget. * Alter the GimpPageSelector widget so that the layer/image combobox and the range entry are on the same line.
This commit is contained in:
parent
fa16da8ef0
commit
0097d34a8f
|
@ -280,42 +280,6 @@ gimp_page_selector_init (GimpPageSelector *selector)
|
|||
gtk_box_pack_start (GTK_BOX (vbox), selector->count_label, FALSE, FALSE, 0);
|
||||
gtk_widget_show (selector->count_label);
|
||||
|
||||
/* Select all button & range entry */
|
||||
|
||||
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
|
||||
gtk_box_pack_start (GTK_BOX (selector), hbox, FALSE, FALSE, 0);
|
||||
gtk_widget_show (hbox);
|
||||
|
||||
hbbox = gtk_button_box_new (GTK_ORIENTATION_HORIZONTAL);
|
||||
gtk_box_pack_start (GTK_BOX (hbox), hbbox, FALSE, FALSE, 0);
|
||||
gtk_widget_show (hbbox);
|
||||
|
||||
button = gtk_button_new_with_mnemonic (_("Select _All"));
|
||||
gtk_box_pack_start (GTK_BOX (hbbox), button, FALSE, FALSE, 0);
|
||||
gtk_widget_show (button);
|
||||
|
||||
g_signal_connect_swapped (button, "clicked",
|
||||
G_CALLBACK (gimp_page_selector_select_all),
|
||||
selector);
|
||||
|
||||
selector->range_entry = gtk_entry_new ();
|
||||
gtk_widget_set_size_request (selector->range_entry, 80, -1);
|
||||
gtk_box_pack_end (GTK_BOX (hbox), selector->range_entry, TRUE, TRUE, 0);
|
||||
gtk_widget_show (selector->range_entry);
|
||||
|
||||
g_signal_connect (selector->range_entry, "focus-out-event",
|
||||
G_CALLBACK (gimp_page_selector_range_focus_out),
|
||||
selector);
|
||||
g_signal_connect (selector->range_entry, "activate",
|
||||
G_CALLBACK (gimp_page_selector_range_activate),
|
||||
selector);
|
||||
|
||||
label = gtk_label_new_with_mnemonic (_("Select _range:"));
|
||||
gtk_box_pack_end (GTK_BOX (hbox), label, FALSE, FALSE, 0);
|
||||
gtk_widget_show (label);
|
||||
|
||||
gtk_label_set_mnemonic_widget (GTK_LABEL (label), selector->range_entry);
|
||||
|
||||
/* Target combo */
|
||||
|
||||
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
|
||||
|
@ -332,6 +296,38 @@ gimp_page_selector_init (GimpPageSelector *selector)
|
|||
|
||||
gtk_label_set_mnemonic_widget (GTK_LABEL (label), combo);
|
||||
|
||||
/* Select all button & range entry */
|
||||
|
||||
label = gtk_label_new_with_mnemonic (_("Select _range:"));
|
||||
gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
|
||||
gtk_widget_show (label);
|
||||
|
||||
selector->range_entry = gtk_entry_new ();
|
||||
gtk_widget_set_size_request (selector->range_entry, 40, -1);
|
||||
gtk_box_pack_start (GTK_BOX (hbox), selector->range_entry, TRUE, TRUE, 0);
|
||||
gtk_widget_show (selector->range_entry);
|
||||
|
||||
g_signal_connect (selector->range_entry, "focus-out-event",
|
||||
G_CALLBACK (gimp_page_selector_range_focus_out),
|
||||
selector);
|
||||
g_signal_connect (selector->range_entry, "activate",
|
||||
G_CALLBACK (gimp_page_selector_range_activate),
|
||||
selector);
|
||||
|
||||
gtk_label_set_mnemonic_widget (GTK_LABEL (label), selector->range_entry);
|
||||
|
||||
hbbox = gtk_button_box_new (GTK_ORIENTATION_HORIZONTAL);
|
||||
gtk_box_pack_end (GTK_BOX (hbox), hbbox, FALSE, FALSE, 0);
|
||||
gtk_widget_show (hbbox);
|
||||
|
||||
button = gtk_button_new_with_mnemonic (_("Select _All"));
|
||||
gtk_box_pack_start (GTK_BOX (hbbox), button, FALSE, FALSE, 0);
|
||||
gtk_widget_show (button);
|
||||
|
||||
g_signal_connect_swapped (button, "clicked",
|
||||
G_CALLBACK (gimp_page_selector_select_all),
|
||||
selector);
|
||||
|
||||
selector->default_thumbnail =
|
||||
gtk_icon_theme_load_icon (gtk_icon_theme_get_default (),
|
||||
"text-x-generic", 32, 0, NULL);
|
||||
|
|
|
@ -1048,13 +1048,15 @@ load_dialog (PopplerDocument *doc,
|
|||
|
||||
gint i;
|
||||
gint n_pages;
|
||||
gchar *title_text;
|
||||
|
||||
gboolean run;
|
||||
|
||||
GimpPageSelectorTarget target;
|
||||
gboolean white_background;
|
||||
|
||||
n_pages = poppler_document_get_n_pages (doc);
|
||||
n_pages = poppler_document_get_n_pages (doc);
|
||||
title_text = poppler_document_get_title (doc);
|
||||
|
||||
dialog = gimp_vector_load_procedure_dialog_new (GIMP_VECTOR_LOAD_PROCEDURE (procedure),
|
||||
GIMP_PROCEDURE_CONFIG (config),
|
||||
|
@ -1072,13 +1074,19 @@ load_dialog (PopplerDocument *doc,
|
|||
gtk_widget_show (vbox);
|
||||
|
||||
/* Title */
|
||||
title = gimp_prop_label_new (G_OBJECT (doc), "title");
|
||||
gtk_label_set_ellipsize (GTK_LABEL (title), PANGO_ELLIPSIZE_END);
|
||||
gtk_box_pack_start (GTK_BOX (vbox), title, FALSE, FALSE, 0);
|
||||
if (title_text && strlen (g_strstrip (title_text)) > 0)
|
||||
{
|
||||
title = gtk_label_new (title_text);
|
||||
gtk_label_set_ellipsize (GTK_LABEL (title), PANGO_ELLIPSIZE_END);
|
||||
gtk_box_pack_start (GTK_BOX (vbox), title, FALSE, FALSE, 0);
|
||||
gtk_widget_set_visible (title, TRUE);
|
||||
}
|
||||
if (title_text)
|
||||
g_free (title_text);
|
||||
|
||||
/* Page Selector */
|
||||
selector = gimp_page_selector_new ();
|
||||
gtk_widget_set_size_request (selector, 380, 360);
|
||||
gtk_widget_set_size_request (selector, 380, 300);
|
||||
gtk_box_pack_start (GTK_BOX (vbox), selector, TRUE, TRUE, 0);
|
||||
gtk_widget_show (selector);
|
||||
|
||||
|
|
Loading…
Reference in New Issue