diff --git a/src/dialogs/colors.c b/src/dialogs/colors.c index ad4a201..a452a1c 100644 --- a/src/dialogs/colors.c +++ b/src/dialogs/colors.c @@ -194,8 +194,9 @@ static void V3270ColorSelection_init(V3270ColorSelection *widget) { - gtk_grid_set_row_spacing(GTK_GRID(widget),5); - gtk_grid_set_column_spacing(GTK_GRID(widget),5); + // https://developer.gnome.org/hig/stable/visual-layout.html.en + gtk_grid_set_row_spacing(GTK_GRID(widget),6); + gtk_grid_set_column_spacing(GTK_GRID(widget),12); { // Create colors list view. diff --git a/src/dialogs/commondialog.c b/src/dialogs/commondialog.c index 4a4d570..2e249ce 100644 --- a/src/dialogs/commondialog.c +++ b/src/dialogs/commondialog.c @@ -52,16 +52,21 @@ static GtkWidget * create_button(GtkWidget *dialog, const gchar *mnemonic, GCall LIB3270_EXPORT GtkWidget * v3270_dialog_new(const gchar *title, GtkWindow *parent, const gchar *apply) { + gboolean use_header; + g_object_get(gtk_settings_get_default(), "gtk-dialogs-use-header", &use_header, NULL); + GtkWidget * dialog = GTK_WIDGET(g_object_new( GTK_TYPE_DIALOG, - "use-header-bar", 1, + "use-header-bar", (use_header ? 1 : 0), NULL )); gtk_window_set_title(GTK_WINDOW(dialog), title); gtk_window_set_deletable(GTK_WINDOW(dialog),FALSE); - gtk_container_set_border_width(GTK_CONTAINER(gtk_dialog_get_content_area(GTK_DIALOG(dialog))),10); + + // https://developer.gnome.org/hig/stable/visual-layout.html.en + gtk_container_set_border_width(GTK_CONTAINER(gtk_dialog_get_content_area(GTK_DIALOG(dialog))),18); if(parent) { @@ -72,9 +77,20 @@ LIB3270_EXPORT GtkWidget * v3270_dialog_new(const gchar *title, GtkWindow *paren GtkWidget * header = gtk_dialog_get_header_bar(GTK_DIALOG(dialog)); - // Cancel button - gtk_header_bar_pack_start(GTK_HEADER_BAR(header),create_button(dialog,_("_Cancel"),G_CALLBACK(cancel_clicked))); - gtk_header_bar_pack_end(GTK_HEADER_BAR(header),create_button(dialog,apply,G_CALLBACK(apply_clicked))); + if(header) + { + gtk_header_bar_pack_start(GTK_HEADER_BAR(header),create_button(dialog,_("_Cancel"),G_CALLBACK(cancel_clicked))); + gtk_header_bar_pack_end(GTK_HEADER_BAR(header),create_button(dialog,apply,G_CALLBACK(apply_clicked))); + } + else + { + gtk_dialog_add_buttons( + GTK_DIALOG (dialog), + _("_Cancel"), GTK_RESPONSE_CANCEL, + apply, GTK_RESPONSE_APPLY, + NULL + ); + } return dialog; } diff --git a/src/dialogs/hostselect.c b/src/dialogs/hostselect.c index 2c754a7..76edd5f 100644 --- a/src/dialogs/hostselect.c +++ b/src/dialogs/hostselect.c @@ -51,7 +51,7 @@ ENTRY_COUNT }; - static const gchar *comboLabel[] = { N_("System _type:"), N_("_Color table:") }; + static const gchar *comboLabel[] = { N_("System _type"), N_("_Color table") }; struct _V3270HostSelectWidget { @@ -118,22 +118,22 @@ static void V3270HostSelectWidget_init(V3270HostSelectWidget *widget) { int f; - gtk_container_set_border_width(GTK_CONTAINER(widget),10); - - gtk_grid_set_row_spacing(GTK_GRID(widget),5); - gtk_grid_set_column_spacing(GTK_GRID(widget),10); + // https://developer.gnome.org/hig/stable/visual-layout.html.en + gtk_container_set_border_width(GTK_CONTAINER(widget),18); + gtk_grid_set_row_spacing(GTK_GRID(widget),6); + gtk_grid_set_column_spacing(GTK_GRID(widget),12); // Entry fields GtkWidget * label[ENTRY_COUNT] = { - gtk_label_new_with_mnemonic( _( "_Host:" ) ), - gtk_label_new_with_mnemonic( _( "_Service:" ) ) + gtk_label_new_with_mnemonic( _( "_Host" ) ), + gtk_label_new_with_mnemonic( _( "_Service" ) ) }; for(f=0;finput.entry[f] = GTK_ENTRY(gtk_entry_new()); - gtk_widget_set_halign(label[f],GTK_ALIGN_START); + gtk_widget_set_halign(label[f],GTK_ALIGN_END); gtk_label_set_mnemonic_widget(GTK_LABEL(label[f]),GTK_WIDGET(widget->input.entry[f])); } @@ -213,7 +213,7 @@ static void V3270HostSelectWidget_init(V3270HostSelectWidget *widget) for(f=0;f< (int) G_N_ELEMENTS(comboLabel);f++) { GtkWidget *label = gtk_label_new_with_mnemonic(gettext(comboLabel[f])); - gtk_widget_set_halign(label,GTK_ALIGN_START); + gtk_widget_set_halign(label,GTK_ALIGN_END); gtk_grid_attach(GTK_GRID(widget),label,0,f+2,1,1); gtk_grid_attach(GTK_GRID(widget),GTK_WIDGET(widget->input.combo[f]),1,f+2,2,1); } diff --git a/src/dialogs/print/print.c b/src/dialogs/print/print.c index e7a7503..b9638c5 100644 --- a/src/dialogs/print/print.c +++ b/src/dialogs/print/print.c @@ -84,8 +84,8 @@ { static const gchar * text[] = { - N_( "_Font:" ), - N_( "C_olor scheme:" ) + N_( "_Font" ), + N_( "C_olor scheme" ) }; size_t f; @@ -102,9 +102,10 @@ GtkWidget * color = v3270_color_scheme_new(); GtkWidget * selected = gtk_check_button_new_with_label( _("Print selection box") ); - gtk_container_set_border_width(GTK_CONTAINER(grid),10); - gtk_grid_set_row_spacing(grid,5); - gtk_grid_set_column_spacing(grid,5); + // https://developer.gnome.org/hig/stable/visual-layout.html.en + gtk_container_set_border_width(GTK_CONTAINER(grid),18); + gtk_grid_set_row_spacing(grid,6); + gtk_grid_set_column_spacing(grid,12); v3270_color_scheme_set_rgba(color,operation->colors); g_signal_connect(G_OBJECT(color),"update-colors",G_CALLBACK(color_scheme_changed),operation); @@ -115,7 +116,7 @@ for(f=0;f