diff options
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | src/alertpanel.c | 12 | ||||
-rw-r--r-- | src/gtkutils.c | 2 | ||||
-rw-r--r-- | src/inputdialog.c | 6 |
4 files changed, 17 insertions, 9 deletions
@@ -1,5 +1,11 @@ 2014-11-13 + * src/gtkutils.c + src/alertpanel.c + src/inputdialog.c: made widget spacings dpi-aware. + +2014-11-13 + * src/gtkutils.[ch] src/main.c: added command line option '--dpi dpinum' (mainly for debugging). diff --git a/src/alertpanel.c b/src/alertpanel.c index 7da313ce..ebe288bb 100644 --- a/src/alertpanel.c +++ b/src/alertpanel.c @@ -219,6 +219,7 @@ static void alertpanel_create(const gchar *title, GtkWidget *button3; const gchar *label2; const gchar *label3; + gint spacing; debug_print(_("Creating alert panel dialog...\n")); @@ -241,8 +242,9 @@ static void alertpanel_create(const gchar *title, G_CALLBACK(alertpanel_focus_out), NULL); /* for title icon, label and message */ - hbox = gtk_hbox_new(FALSE, 12); - gtk_container_set_border_width(GTK_CONTAINER(hbox), 12); + spacing = 12 * gtkut_get_dpi_multiplier(); + hbox = gtk_hbox_new(FALSE, spacing); + gtk_container_set_border_width(GTK_CONTAINER(hbox), spacing); gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->vbox), hbox, FALSE, FALSE, 0); @@ -270,7 +272,7 @@ static void alertpanel_create(const gchar *title, gtk_box_pack_start(GTK_BOX(hbox), image, FALSE, FALSE, 0); /* for title and message */ - vbox = gtk_vbox_new(FALSE, 12); + vbox = gtk_vbox_new(FALSE, spacing); gtk_box_pack_start(GTK_BOX(hbox), vbox, TRUE, TRUE, 0); label = gtk_label_new(title); @@ -319,7 +321,7 @@ static void alertpanel_create(const gchar *title, gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(disable_chkbtn), TRUE); gtk_box_pack_start(GTK_BOX(hbox), disable_chkbtn, - FALSE, FALSE, 12); + FALSE, FALSE, spacing); g_signal_connect(G_OBJECT(disable_chkbtn), "toggled", G_CALLBACK(alertpanel_button_toggled), GUINT_TO_POINTER(G_ALERTDISABLE)); @@ -340,7 +342,7 @@ static void alertpanel_create(const gchar *title, gtk_box_pack_end(GTK_BOX(GTK_DIALOG(dialog)->action_area), confirm_area, FALSE, FALSE, 0); - gtk_container_set_border_width(GTK_CONTAINER(confirm_area), 5); + gtk_container_set_border_width(GTK_CONTAINER(confirm_area), 5 * gtkut_get_dpi_multiplier()); gtk_widget_grab_default(button1); gtk_widget_grab_focus(button1); if (button2_label && diff --git a/src/gtkutils.c b/src/gtkutils.c index ec8cd8a2..8240acc3 100644 --- a/src/gtkutils.c +++ b/src/gtkutils.c @@ -213,7 +213,7 @@ void gtkut_stock_button_set_create(GtkWidget **bbox, *bbox = gtk_hbutton_box_new(); gtk_button_box_set_layout(GTK_BUTTON_BOX(*bbox), GTK_BUTTONBOX_END); - gtk_box_set_spacing(GTK_BOX(*bbox), 6); + gtk_box_set_spacing(GTK_BOX(*bbox), 6 * gtkut_get_dpi_multiplier()); if (button3) { *button3 = gtk_button_new_from_stock(label3); diff --git a/src/inputdialog.c b/src/inputdialog.c index 928eb506..d5ef8385 100644 --- a/src/inputdialog.c +++ b/src/inputdialog.c @@ -180,7 +180,7 @@ static void input_dialog_create(InputDialogType dialog_type) gtk_window_set_resizable(GTK_WINDOW(dialog), FALSE); gtk_widget_set_size_request(dialog, DIALOG_WIDTH * gtkut_get_dpi_multiplier(), -1); gtk_container_set_border_width - (GTK_CONTAINER(GTK_DIALOG(dialog)->action_area), 5); + (GTK_CONTAINER(GTK_DIALOG(dialog)->action_area), 5 * gtkut_get_dpi_multiplier()); gtk_window_set_position(GTK_WINDOW(dialog), GTK_WIN_POS_CENTER_ON_PARENT); gtk_window_set_modal(GTK_WINDOW(dialog), TRUE); @@ -193,7 +193,7 @@ static void input_dialog_create(InputDialogType dialog_type) G_CALLBACK(focus_out), NULL); MANAGE_WINDOW_SIGNALS_CONNECT(dialog); - vbox = gtk_vbox_new(FALSE, 8); + vbox = gtk_vbox_new(FALSE, 8 * gtkut_get_dpi_multiplier()); gtk_container_add(GTK_CONTAINER(GTK_DIALOG(dialog)->vbox), vbox); gtk_container_set_border_width(GTK_CONTAINER(vbox), 8); @@ -204,7 +204,7 @@ static void input_dialog_create(InputDialogType dialog_type) gtk_box_pack_start(GTK_BOX(hbox), msg_label, FALSE, FALSE, 0); gtk_label_set_justify(GTK_LABEL(msg_label), GTK_JUSTIFY_LEFT); - hbox = gtk_hbox_new(FALSE, 4); + hbox = gtk_hbox_new(FALSE, 4 * gtkut_get_dpi_multiplier()); gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); type = dialog_type; |