forked from AuroraMiddleware/gtk
Apply a patch from Dennis Cranston to make dialogs more consistent
2006-03-10 Matthias Clasen <mclasen@redhat.com> Apply a patch from Dennis Cranston to make dialogs more consistent (#163850) * gtk/gtkcolorsel.c (make_label_spinbutton): Left-align labels. * gtk/gtkfontsel.c (gtk_font_selection_init): * gtk/gtkfontsel.c (gtk_font_selection_dialog_init): * gtk/gtkcolorsel.c (gtk_color_selection_init): * gtk/gtkcolorseldialog.c (gtk_color_selection_dialog_init): * gtk/gtkinputdialog.c (gtk_input_dialog_init): Update the layout of the dialog to follow HIG recommendations. Also update labels. * gtk/gtkmessagedialog.c (gtk_message_dialog_init): HIG-compatible spacing. (gtk_message_dialog_font_size_change): Merged into gtk_message_dialog_style_set.
This commit is contained in:
parent
26a1ba116e
commit
03dcf45d90
19
ChangeLog
19
ChangeLog
@ -1,3 +1,22 @@
|
||||
2006-03-10 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
Apply a patch from Dennis Cranston to make dialogs more
|
||||
consistent (#163850)
|
||||
|
||||
* gtk/gtkcolorsel.c (make_label_spinbutton): Left-align labels.
|
||||
|
||||
* gtk/gtkfontsel.c (gtk_font_selection_init):
|
||||
* gtk/gtkfontsel.c (gtk_font_selection_dialog_init):
|
||||
* gtk/gtkcolorsel.c (gtk_color_selection_init):
|
||||
* gtk/gtkcolorseldialog.c (gtk_color_selection_dialog_init):
|
||||
* gtk/gtkinputdialog.c (gtk_input_dialog_init): Update the layout
|
||||
of the dialog to follow HIG recommendations. Also update labels.
|
||||
|
||||
* gtk/gtkmessagedialog.c (gtk_message_dialog_init): HIG-compatible
|
||||
spacing.
|
||||
(gtk_message_dialog_font_size_change): Merged into
|
||||
gtk_message_dialog_style_set.
|
||||
|
||||
2006-03-10 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* gtk/gtkstyle.c: Remove g_return_if_fail() checks
|
||||
|
@ -1,3 +1,22 @@
|
||||
2006-03-10 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
Apply a patch from Dennis Cranston to make dialogs more
|
||||
consistent (#163850)
|
||||
|
||||
* gtk/gtkcolorsel.c (make_label_spinbutton): Left-align labels.
|
||||
|
||||
* gtk/gtkfontsel.c (gtk_font_selection_init):
|
||||
* gtk/gtkfontsel.c (gtk_font_selection_dialog_init):
|
||||
* gtk/gtkcolorsel.c (gtk_color_selection_init):
|
||||
* gtk/gtkcolorseldialog.c (gtk_color_selection_dialog_init):
|
||||
* gtk/gtkinputdialog.c (gtk_input_dialog_init): Update the layout
|
||||
of the dialog to follow HIG recommendations. Also update labels.
|
||||
|
||||
* gtk/gtkmessagedialog.c (gtk_message_dialog_init): HIG-compatible
|
||||
spacing.
|
||||
(gtk_message_dialog_font_size_change): Merged into
|
||||
gtk_message_dialog_style_set.
|
||||
|
||||
2006-03-10 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* gtk/gtkstyle.c: Remove g_return_if_fail() checks
|
||||
|
@ -1651,7 +1651,7 @@ make_label_spinbutton (GtkColorSelection *colorsel,
|
||||
label = gtk_label_new_with_mnemonic (text);
|
||||
gtk_label_set_mnemonic_widget (GTK_LABEL (label), *spinbutton);
|
||||
|
||||
gtk_misc_set_alignment (GTK_MISC (label), 1.0, 0.5);
|
||||
gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
|
||||
gtk_table_attach_defaults (GTK_TABLE (table), label, i, i+1, j, j+1);
|
||||
gtk_table_attach_defaults (GTK_TABLE (table), *spinbutton, i+1, i+2, j, j+1);
|
||||
}
|
||||
@ -1924,6 +1924,7 @@ gtk_color_selection_init (GtkColorSelection *colorsel)
|
||||
gint i, j;
|
||||
ColorSelectionPrivate *priv;
|
||||
AtkObject *atk_obj;
|
||||
GList *focus_chain = NULL;
|
||||
|
||||
gtk_widget_push_composite_child ();
|
||||
|
||||
@ -1935,11 +1936,10 @@ gtk_color_selection_init (GtkColorSelection *colorsel)
|
||||
priv->tooltips = gtk_tooltips_new ();
|
||||
g_object_ref_sink (priv->tooltips);
|
||||
|
||||
gtk_box_set_spacing (GTK_BOX (colorsel), 4);
|
||||
top_hbox = gtk_hbox_new (FALSE, 8);
|
||||
top_hbox = gtk_hbox_new (FALSE, 12);
|
||||
gtk_box_pack_start (GTK_BOX (colorsel), top_hbox, FALSE, FALSE, 0);
|
||||
|
||||
vbox = gtk_vbox_new (FALSE, 4);
|
||||
vbox = gtk_vbox_new (FALSE, 6);
|
||||
priv->triangle_colorsel = gtk_hsv_new ();
|
||||
g_signal_connect (priv->triangle_colorsel, "changed",
|
||||
G_CALLBACK (hsv_changed), colorsel);
|
||||
@ -1949,7 +1949,7 @@ gtk_color_selection_init (GtkColorSelection *colorsel)
|
||||
gtk_tooltips_set_tip (priv->tooltips, priv->triangle_colorsel,
|
||||
_("Select the color you want from the outer ring. Select the darkness or lightness of that color using the inner triangle."), NULL);
|
||||
|
||||
hbox = gtk_hbox_new (FALSE, 4);
|
||||
hbox = gtk_hbox_new (FALSE, 6);
|
||||
gtk_box_pack_end (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
|
||||
|
||||
frame = gtk_frame_new (NULL);
|
||||
@ -1974,12 +1974,12 @@ gtk_color_selection_init (GtkColorSelection *colorsel)
|
||||
button,
|
||||
_("Click the eyedropper, then click a color anywhere on your screen to select that color."), NULL);
|
||||
|
||||
top_right_vbox = gtk_vbox_new (FALSE, 4);
|
||||
top_right_vbox = gtk_vbox_new (FALSE, 6);
|
||||
gtk_box_pack_start (GTK_BOX (top_hbox), top_right_vbox, FALSE, FALSE, 0);
|
||||
table = gtk_table_new (8, 6, FALSE);
|
||||
gtk_box_pack_start (GTK_BOX (top_right_vbox), table, FALSE, FALSE, 0);
|
||||
gtk_table_set_row_spacings (GTK_TABLE (table), 4);
|
||||
gtk_table_set_col_spacings (GTK_TABLE (table), 4);
|
||||
gtk_table_set_row_spacings (GTK_TABLE (table), 6);
|
||||
gtk_table_set_col_spacings (GTK_TABLE (table), 12);
|
||||
|
||||
make_label_spinbutton (colorsel, &priv->hue_spinbutton, _("_Hue:"), table, 0, 0, COLORSEL_HUE,
|
||||
_("Position on the color wheel."));
|
||||
@ -1995,9 +1995,9 @@ gtk_color_selection_init (GtkColorSelection *colorsel)
|
||||
make_label_spinbutton (colorsel, &priv->blue_spinbutton, _("_Blue:"), table, 6, 2, COLORSEL_BLUE,
|
||||
_("Amount of blue light in the color."));
|
||||
gtk_table_attach_defaults (GTK_TABLE (table), gtk_hseparator_new (), 0, 8, 3, 4);
|
||||
|
||||
|
||||
priv->opacity_label = gtk_label_new_with_mnemonic (_("_Opacity:"));
|
||||
gtk_misc_set_alignment (GTK_MISC (priv->opacity_label), 1.0, 0.5);
|
||||
gtk_misc_set_alignment (GTK_MISC (priv->opacity_label), 0.0, 0.5);
|
||||
gtk_table_attach_defaults (GTK_TABLE (table), priv->opacity_label, 0, 1, 4, 5);
|
||||
adjust = GTK_ADJUSTMENT (gtk_adjustment_new (0.0, 0.0, 255.0, 1.0, 1.0, 0.0));
|
||||
g_object_set_data (G_OBJECT (adjust), I_("COLORSEL"), colorsel);
|
||||
@ -2022,9 +2022,9 @@ gtk_color_selection_init (GtkColorSelection *colorsel)
|
||||
G_CALLBACK (opacity_entry_changed), colorsel);
|
||||
gtk_table_attach_defaults (GTK_TABLE (table), priv->opacity_entry, 7, 8, 4, 5);
|
||||
|
||||
label = gtk_label_new_with_mnemonic (_("Color _Name:"));
|
||||
label = gtk_label_new_with_mnemonic (_("Color _name:"));
|
||||
gtk_table_attach_defaults (GTK_TABLE (table), label, 0, 1, 5, 6);
|
||||
gtk_misc_set_alignment (GTK_MISC (label), 1.0, 0.5);
|
||||
gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
|
||||
priv->hex_entry = gtk_entry_new ();
|
||||
|
||||
gtk_label_set_mnemonic_widget (GTK_LABEL (label), priv->hex_entry);
|
||||
@ -2040,9 +2040,20 @@ gtk_color_selection_init (GtkColorSelection *colorsel)
|
||||
_("You can enter an HTML-style hexadecimal color value, or simply a color name such as 'orange' in this entry."), NULL);
|
||||
|
||||
gtk_entry_set_width_chars (GTK_ENTRY (priv->hex_entry), 7);
|
||||
gtk_table_set_col_spacing (GTK_TABLE (table), 3, 15);
|
||||
gtk_table_attach_defaults (GTK_TABLE (table), priv->hex_entry, 1, 5, 5, 6);
|
||||
|
||||
|
||||
focus_chain = g_list_append (focus_chain, priv->hue_spinbutton);
|
||||
focus_chain = g_list_append (focus_chain, priv->sat_spinbutton);
|
||||
focus_chain = g_list_append (focus_chain, priv->val_spinbutton);
|
||||
focus_chain = g_list_append (focus_chain, priv->red_spinbutton);
|
||||
focus_chain = g_list_append (focus_chain, priv->green_spinbutton);
|
||||
focus_chain = g_list_append (focus_chain, priv->blue_spinbutton);
|
||||
focus_chain = g_list_append (focus_chain, priv->opacity_slider);
|
||||
focus_chain = g_list_append (focus_chain, priv->opacity_entry);
|
||||
focus_chain = g_list_append (focus_chain, priv->hex_entry);
|
||||
gtk_container_set_focus_chain (GTK_CONTAINER (table), focus_chain);
|
||||
g_list_free (focus_chain);
|
||||
|
||||
/* Set up the palette */
|
||||
table = gtk_table_new (GTK_CUSTOM_PALETTE_HEIGHT, GTK_CUSTOM_PALETTE_WIDTH, TRUE);
|
||||
gtk_table_set_row_spacings (GTK_TABLE (table), 1);
|
||||
@ -2055,19 +2066,16 @@ gtk_color_selection_init (GtkColorSelection *colorsel)
|
||||
}
|
||||
}
|
||||
set_selected_palette (colorsel, 0, 0);
|
||||
priv->palette_frame = gtk_frame_new (NULL);
|
||||
priv->palette_frame = gtk_vbox_new (FALSE, 6);
|
||||
label = gtk_label_new_with_mnemonic (_("_Palette"));
|
||||
gtk_frame_set_label_widget (GTK_FRAME (priv->palette_frame), label);
|
||||
gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
|
||||
gtk_box_pack_start (GTK_BOX (priv->palette_frame), label, FALSE, FALSE, 0);
|
||||
|
||||
gtk_label_set_mnemonic_widget (GTK_LABEL (label),
|
||||
priv->custom_palette[0][0]);
|
||||
|
||||
gtk_box_pack_end (GTK_BOX (top_right_vbox), priv->palette_frame, FALSE, FALSE, 0);
|
||||
vbox = gtk_vbox_new (FALSE, 4);
|
||||
gtk_container_add (GTK_CONTAINER (priv->palette_frame), vbox);
|
||||
gtk_box_pack_start (GTK_BOX (vbox), table, FALSE, FALSE, 0);
|
||||
|
||||
gtk_container_set_border_width (GTK_CONTAINER (vbox), 4);
|
||||
gtk_box_pack_start (GTK_BOX (priv->palette_frame), table, FALSE, FALSE, 0);
|
||||
|
||||
gtk_widget_show_all (top_hbox);
|
||||
|
||||
|
@ -81,18 +81,19 @@ gtk_color_selection_dialog_class_init (GtkColorSelectionDialogClass *klass)
|
||||
static void
|
||||
gtk_color_selection_dialog_init (GtkColorSelectionDialog *colorseldiag)
|
||||
{
|
||||
GtkWidget *frame;
|
||||
|
||||
frame = gtk_frame_new (NULL);
|
||||
gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_NONE);
|
||||
gtk_container_add (GTK_CONTAINER (GTK_DIALOG (colorseldiag)->vbox), frame);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (frame), 10);
|
||||
gtk_widget_show (frame);
|
||||
|
||||
GtkDialog *dialog = GTK_DIALOG (colorseldiag);
|
||||
|
||||
gtk_dialog_set_has_separator (dialog, FALSE);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (dialog), 5);
|
||||
gtk_box_set_spacing (GTK_BOX (dialog->vbox), 2); /* 2 * 5 + 2 = 12 */
|
||||
gtk_container_set_border_width (GTK_CONTAINER (dialog->action_area), 5);
|
||||
gtk_box_set_spacing (GTK_BOX (dialog->action_area), 6);
|
||||
|
||||
colorseldiag->colorsel = gtk_color_selection_new ();
|
||||
gtk_container_set_border_width (GTK_CONTAINER (colorseldiag->colorsel), 5);
|
||||
gtk_color_selection_set_has_palette (GTK_COLOR_SELECTION(colorseldiag->colorsel), FALSE);
|
||||
gtk_color_selection_set_has_opacity_control (GTK_COLOR_SELECTION(colorseldiag->colorsel), FALSE);
|
||||
gtk_container_add (GTK_CONTAINER (frame), colorseldiag->colorsel);
|
||||
gtk_container_add (GTK_CONTAINER (GTK_DIALOG (colorseldiag)->vbox), colorseldiag->colorsel);
|
||||
gtk_widget_show (colorseldiag->colorsel);
|
||||
|
||||
colorseldiag->cancel_button = gtk_dialog_add_button (GTK_DIALOG (colorseldiag),
|
||||
@ -119,6 +120,8 @@ gtk_color_selection_dialog_init (GtkColorSelectionDialog *colorseldiag)
|
||||
|
||||
gtk_window_set_title (GTK_WINDOW (colorseldiag),
|
||||
_("Color Selection"));
|
||||
|
||||
_gtk_dialog_set_ignore_separator (dialog, TRUE);
|
||||
}
|
||||
|
||||
GtkWidget*
|
||||
|
@ -315,6 +315,7 @@ gtk_font_selection_init (GtkFontSelection *fontsel)
|
||||
GtkWidget *text_box;
|
||||
GtkWidget *table, *label;
|
||||
GtkWidget *font_label, *style_label;
|
||||
GtkWidget *vbox;
|
||||
GtkListStore *model;
|
||||
GtkTreeViewColumn *column;
|
||||
GList *focus_chain = NULL;
|
||||
@ -322,12 +323,14 @@ gtk_font_selection_init (GtkFontSelection *fontsel)
|
||||
|
||||
gtk_widget_push_composite_child ();
|
||||
|
||||
gtk_box_set_spacing (GTK_BOX (fontsel), 12);
|
||||
fontsel->size = 12 * PANGO_SCALE;
|
||||
|
||||
/* Create the table of font, style & size. */
|
||||
table = gtk_table_new (3, 3, FALSE);
|
||||
gtk_widget_show (table);
|
||||
gtk_table_set_col_spacings (GTK_TABLE (table), 8);
|
||||
gtk_table_set_row_spacings (GTK_TABLE (table), 6);
|
||||
gtk_table_set_col_spacings (GTK_TABLE (table), 12);
|
||||
gtk_box_pack_start (GTK_BOX (fontsel), table, TRUE, TRUE, 0);
|
||||
|
||||
#ifdef INCLUDE_FONT_ENTRIES
|
||||
@ -545,23 +548,19 @@ gtk_font_selection_init (GtkFontSelection *fontsel)
|
||||
}
|
||||
|
||||
|
||||
vbox = gtk_vbox_new (FALSE, 6);
|
||||
gtk_widget_show (vbox);
|
||||
gtk_box_pack_start (GTK_BOX (fontsel), vbox, FALSE, TRUE, 0);
|
||||
|
||||
/* create the text entry widget */
|
||||
label = gtk_label_new_with_mnemonic (_("_Preview:"));
|
||||
gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
|
||||
gtk_widget_show (label);
|
||||
gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, TRUE, 0);
|
||||
|
||||
text_frame = gtk_frame_new (NULL);
|
||||
gtk_frame_set_label_widget (GTK_FRAME (text_frame), label);
|
||||
|
||||
gtk_widget_show (text_frame);
|
||||
gtk_frame_set_shadow_type (GTK_FRAME (text_frame), GTK_SHADOW_ETCHED_IN);
|
||||
gtk_box_pack_start (GTK_BOX (fontsel), text_frame,
|
||||
FALSE, TRUE, 0);
|
||||
|
||||
/* This is just used to get a 4-pixel space around the preview entry. */
|
||||
text_box = gtk_hbox_new (FALSE, 0);
|
||||
gtk_widget_show (text_box);
|
||||
gtk_container_add (GTK_CONTAINER (text_frame), text_box);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (text_box), 4);
|
||||
gtk_box_pack_start (GTK_BOX (vbox), text_box, FALSE, TRUE, 0);
|
||||
|
||||
fontsel->preview_entry = gtk_entry_new ();
|
||||
gtk_label_set_mnemonic_widget (GTK_LABEL (label), fontsel->preview_entry);
|
||||
@ -1371,19 +1370,22 @@ gtk_font_selection_dialog_class_init (GtkFontSelectionDialogClass *klass)
|
||||
static void
|
||||
gtk_font_selection_dialog_init (GtkFontSelectionDialog *fontseldiag)
|
||||
{
|
||||
GtkDialog *dialog;
|
||||
GtkDialog *dialog = GTK_DIALOG (fontseldiag);
|
||||
|
||||
gtk_dialog_set_has_separator (dialog, FALSE);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (dialog), 5);
|
||||
gtk_box_set_spacing (GTK_BOX (dialog->vbox), 2); /* 2 * 5 + 2 = 12 */
|
||||
gtk_container_set_border_width (GTK_CONTAINER (dialog->action_area), 5);
|
||||
gtk_box_set_spacing (GTK_BOX (dialog->action_area), 6);
|
||||
|
||||
gtk_widget_push_composite_child ();
|
||||
|
||||
dialog = GTK_DIALOG (fontseldiag);
|
||||
|
||||
gtk_container_set_border_width (GTK_CONTAINER (fontseldiag), 4);
|
||||
gtk_window_set_resizable (GTK_WINDOW (fontseldiag), TRUE);
|
||||
|
||||
fontseldiag->main_vbox = dialog->vbox;
|
||||
|
||||
fontseldiag->fontsel = gtk_font_selection_new ();
|
||||
gtk_container_set_border_width (GTK_CONTAINER (fontseldiag->fontsel), 4);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (fontseldiag->fontsel), 5);
|
||||
gtk_widget_show (fontseldiag->fontsel);
|
||||
gtk_box_pack_start (GTK_BOX (fontseldiag->main_vbox),
|
||||
fontseldiag->fontsel, TRUE, TRUE, 0);
|
||||
@ -1411,13 +1413,12 @@ gtk_font_selection_dialog_init (GtkFontSelectionDialog *fontseldiag)
|
||||
GTK_RESPONSE_CANCEL,
|
||||
-1);
|
||||
|
||||
|
||||
gtk_window_set_title (GTK_WINDOW (fontseldiag),
|
||||
_("Font Selection"));
|
||||
|
||||
gtk_dialog_set_has_separator (GTK_DIALOG (dialog), FALSE);
|
||||
|
||||
gtk_widget_pop_composite_child ();
|
||||
|
||||
_gtk_dialog_set_ignore_separator (dialog, TRUE);
|
||||
}
|
||||
|
||||
GtkWidget*
|
||||
|
@ -213,25 +213,32 @@ static void
|
||||
gtk_input_dialog_init (GtkInputDialog *inputd)
|
||||
{
|
||||
GtkInputDialogPrivate *private = gtk_input_dialog_get_private (inputd);
|
||||
GtkDialog *dialog = GTK_DIALOG (inputd);
|
||||
GtkWidget *util_box;
|
||||
GtkWidget *label;
|
||||
GtkWidget *mapping_menu;
|
||||
GtkWidget *menuitem;
|
||||
GtkWidget *separator;
|
||||
GtkWidget *notebook;
|
||||
|
||||
gtk_widget_push_composite_child ();
|
||||
|
||||
gtk_window_set_title (GTK_WINDOW (inputd), _("Input"));
|
||||
|
||||
gtk_dialog_set_has_separator (dialog, FALSE);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (dialog), 5);
|
||||
gtk_box_set_spacing (GTK_BOX (dialog->vbox), 2); /* 2 * 5 + 2 = 12 */
|
||||
gtk_container_set_border_width (GTK_CONTAINER (dialog->action_area), 5);
|
||||
gtk_box_set_spacing (GTK_BOX (dialog->action_area), 6);
|
||||
|
||||
/* main vbox */
|
||||
|
||||
private->main_vbox = gtk_vbox_new (FALSE, 4);
|
||||
private->main_vbox = gtk_vbox_new (FALSE, 12);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (private->main_vbox), 5);
|
||||
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (inputd)->vbox), private->main_vbox,
|
||||
TRUE, TRUE, 0);
|
||||
|
||||
private->no_devices_label = gtk_label_new (_("No extended input devices"));
|
||||
gtk_container_set_border_width (GTK_CONTAINER (private->main_vbox), 5);
|
||||
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (inputd)->vbox),
|
||||
private->no_devices_label,
|
||||
TRUE, TRUE, 0);
|
||||
@ -240,15 +247,15 @@ gtk_input_dialog_init (GtkInputDialog *inputd)
|
||||
|
||||
private->device_menu = gtk_menu_new ();
|
||||
|
||||
util_box = gtk_hbox_new (FALSE, 2);
|
||||
util_box = gtk_hbox_new (FALSE, 12);
|
||||
gtk_box_pack_start (GTK_BOX (private->main_vbox), util_box, FALSE, FALSE, 0);
|
||||
|
||||
label = gtk_label_new_with_mnemonic (_("_Device:"));
|
||||
gtk_box_pack_start (GTK_BOX (util_box), label, FALSE, FALSE, 2);
|
||||
gtk_box_pack_start (GTK_BOX (util_box), label, FALSE, FALSE, 0);
|
||||
|
||||
private->device_optionmenu = gtk_option_menu_new ();
|
||||
gtk_label_set_mnemonic_widget (GTK_LABEL (label), private->device_optionmenu);
|
||||
gtk_box_pack_start (GTK_BOX (util_box), private->device_optionmenu, TRUE, TRUE, 2);
|
||||
gtk_box_pack_start (GTK_BOX (util_box), private->device_optionmenu, TRUE, TRUE, 0);
|
||||
gtk_widget_show (private->device_optionmenu);
|
||||
gtk_option_menu_set_menu (GTK_OPTION_MENU (private->device_optionmenu), private->device_menu);
|
||||
|
||||
@ -281,12 +288,12 @@ gtk_input_dialog_init (GtkInputDialog *inputd)
|
||||
G_CALLBACK (gtk_input_dialog_set_mapping_mode),
|
||||
GINT_TO_POINTER (GDK_MODE_WINDOW));
|
||||
|
||||
label = gtk_label_new_with_mnemonic (_("_Mode: "));
|
||||
gtk_box_pack_start (GTK_BOX (util_box), label, FALSE, FALSE, 2);
|
||||
label = gtk_label_new_with_mnemonic (_("_Mode:"));
|
||||
gtk_box_pack_start (GTK_BOX (util_box), label, FALSE, FALSE, 0);
|
||||
|
||||
inputd->mode_optionmenu = gtk_option_menu_new ();
|
||||
gtk_label_set_mnemonic_widget (GTK_LABEL (label), inputd->mode_optionmenu);
|
||||
gtk_box_pack_start (GTK_BOX (util_box), inputd->mode_optionmenu, FALSE, FALSE, 2);
|
||||
gtk_box_pack_start (GTK_BOX (util_box), inputd->mode_optionmenu, FALSE, FALSE, 0);
|
||||
gtk_widget_show (inputd->mode_optionmenu);
|
||||
gtk_option_menu_set_menu (GTK_OPTION_MENU (inputd->mode_optionmenu), mapping_menu);
|
||||
|
||||
@ -294,16 +301,6 @@ gtk_input_dialog_init (GtkInputDialog *inputd)
|
||||
|
||||
gtk_widget_show (util_box);
|
||||
|
||||
util_box = gtk_hbox_new (FALSE, 2);
|
||||
gtk_box_pack_start (GTK_BOX(private->main_vbox), util_box, FALSE, FALSE, 0);
|
||||
|
||||
gtk_widget_show (label);
|
||||
gtk_widget_show (util_box);
|
||||
|
||||
separator = gtk_hseparator_new();
|
||||
gtk_box_pack_start (GTK_BOX (private->main_vbox), separator, FALSE, TRUE, 0);
|
||||
gtk_widget_show (separator);
|
||||
|
||||
/* Notebook */
|
||||
|
||||
notebook = gtk_notebook_new ();
|
||||
@ -312,9 +309,10 @@ gtk_input_dialog_init (GtkInputDialog *inputd)
|
||||
|
||||
/* The axis listbox */
|
||||
|
||||
label = gtk_label_new_with_mnemonic (_("_Axes"));
|
||||
label = gtk_label_new (_("Axes"));
|
||||
|
||||
inputd->axis_listbox = gtk_scrolled_window_new (NULL, NULL);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (inputd->axis_listbox), 12);
|
||||
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW(inputd->axis_listbox),
|
||||
GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
|
||||
|
||||
@ -329,9 +327,10 @@ gtk_input_dialog_init (GtkInputDialog *inputd)
|
||||
|
||||
/* Keys listbox */
|
||||
|
||||
label = gtk_label_new_with_mnemonic (_("_Keys"));
|
||||
label = gtk_label_new (_("Keys"));
|
||||
|
||||
inputd->keys_listbox = gtk_scrolled_window_new (NULL, NULL);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (inputd->keys_listbox), 12);
|
||||
gtk_widget_set_size_request (inputd->keys_listbox,
|
||||
KEYS_LIST_WIDTH, KEYS_LIST_HEIGHT);
|
||||
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (inputd->keys_listbox),
|
||||
@ -360,6 +359,8 @@ gtk_input_dialog_init (GtkInputDialog *inputd)
|
||||
gtk_widget_pop_composite_child ();
|
||||
|
||||
gtk_input_dialog_screen_changed (GTK_WIDGET (inputd), NULL);
|
||||
|
||||
_gtk_dialog_set_ignore_separator (dialog, TRUE);
|
||||
}
|
||||
|
||||
static void
|
||||
@ -549,18 +550,19 @@ gtk_input_dialog_fill_axes(GtkInputDialog *inputd, GdkDevice *info)
|
||||
static const char *const axis_use_strings[GDK_AXIS_LAST] =
|
||||
{
|
||||
"",
|
||||
N_("X"),
|
||||
N_("Y"),
|
||||
N_("Pressure"),
|
||||
N_("X Tilt"),
|
||||
N_("Y Tilt"),
|
||||
N_("Wheel")
|
||||
N_("_X:"),
|
||||
N_("_Y:"),
|
||||
N_("_Pressure:"),
|
||||
N_("X _tilt:"),
|
||||
N_("Y t_ilt:"),
|
||||
N_("_Wheel:")
|
||||
};
|
||||
|
||||
int i,j;
|
||||
GtkWidget *menu;
|
||||
GtkWidget *option_menu;
|
||||
GtkWidget *label;
|
||||
GtkWidget *viewport;
|
||||
|
||||
/* remove all the old items */
|
||||
if (inputd->axis_list)
|
||||
@ -569,8 +571,14 @@ gtk_input_dialog_fill_axes(GtkInputDialog *inputd, GdkDevice *info)
|
||||
gtk_widget_destroy (inputd->axis_list);
|
||||
}
|
||||
inputd->axis_list = gtk_table_new (GDK_AXIS_LAST, 2, 0);
|
||||
gtk_scrolled_window_add_with_viewport (GTK_SCROLLED_WINDOW (inputd->axis_listbox),
|
||||
inputd->axis_list);
|
||||
gtk_table_set_row_spacings (GTK_TABLE (inputd->axis_list), 6);
|
||||
gtk_table_set_col_spacings (GTK_TABLE (inputd->axis_list), 12);
|
||||
|
||||
viewport = gtk_viewport_new (NULL, NULL);
|
||||
gtk_container_add (GTK_CONTAINER (inputd->axis_listbox), viewport);
|
||||
gtk_viewport_set_shadow_type (GTK_VIEWPORT (viewport), GTK_SHADOW_NONE);
|
||||
gtk_widget_show (viewport);
|
||||
gtk_container_add (GTK_CONTAINER (viewport), inputd->axis_list);
|
||||
gtk_widget_show (inputd->axis_list);
|
||||
|
||||
gtk_widget_realize (inputd->axis_list);
|
||||
@ -581,9 +589,10 @@ gtk_input_dialog_fill_axes(GtkInputDialog *inputd, GdkDevice *info)
|
||||
{
|
||||
/* create the label */
|
||||
|
||||
label = gtk_label_new (_(axis_use_strings[i]));
|
||||
label = gtk_label_new_with_mnemonic (_(axis_use_strings[i]));
|
||||
gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5);
|
||||
gtk_table_attach (GTK_TABLE (inputd->axis_list), label, 0, 1, i, i+1,
|
||||
0, 0, 2, 2);
|
||||
GTK_FILL, 0, 2, 2);
|
||||
|
||||
/* and the use option menu */
|
||||
menu = gtk_menu_new();
|
||||
@ -608,8 +617,9 @@ gtk_input_dialog_fill_axes(GtkInputDialog *inputd, GdkDevice *info)
|
||||
}
|
||||
|
||||
inputd->axis_items[i] = option_menu = gtk_option_menu_new ();
|
||||
gtk_label_set_mnemonic_widget (GTK_LABEL (label), option_menu);
|
||||
gtk_table_attach (GTK_TABLE (inputd->axis_list), option_menu,
|
||||
1, 2, i, i+1, 0, 0, 2, 2);
|
||||
1, 2, i, i+1, GTK_EXPAND | GTK_FILL, 0, 2, 2);
|
||||
|
||||
gtk_widget_show (option_menu);
|
||||
gtk_option_menu_set_menu (GTK_OPTION_MENU (option_menu), menu);
|
||||
@ -699,6 +709,8 @@ gtk_input_dialog_fill_keys(GtkInputDialog *inputd, GdkDevice *info)
|
||||
int i;
|
||||
GtkWidget *label;
|
||||
GtkWidget *button;
|
||||
GtkWidget *hbox;
|
||||
GtkWidget *viewport;
|
||||
|
||||
char buffer[32];
|
||||
|
||||
@ -709,9 +721,15 @@ gtk_input_dialog_fill_keys(GtkInputDialog *inputd, GdkDevice *info)
|
||||
gtk_widget_destroy (inputd->keys_list);
|
||||
}
|
||||
|
||||
inputd->keys_list = gtk_table_new (info->num_keys, 3, FALSE);
|
||||
gtk_scrolled_window_add_with_viewport (GTK_SCROLLED_WINDOW (inputd->keys_listbox),
|
||||
inputd->keys_list);
|
||||
inputd->keys_list = gtk_table_new (info->num_keys, 2, FALSE);
|
||||
gtk_table_set_row_spacings (GTK_TABLE (inputd->keys_list), 6);
|
||||
gtk_table_set_col_spacings (GTK_TABLE (inputd->keys_list), 12);
|
||||
|
||||
viewport = gtk_viewport_new (NULL, NULL);
|
||||
gtk_container_add (GTK_CONTAINER (inputd->keys_listbox), viewport);
|
||||
gtk_viewport_set_shadow_type (GTK_VIEWPORT (viewport), GTK_SHADOW_NONE);
|
||||
gtk_widget_show (viewport);
|
||||
gtk_container_add (GTK_CONTAINER (viewport), inputd->keys_list);
|
||||
gtk_widget_show (inputd->keys_list);
|
||||
|
||||
gtk_widget_realize (inputd->keys_list);
|
||||
@ -726,17 +744,22 @@ gtk_input_dialog_fill_keys(GtkInputDialog *inputd, GdkDevice *info)
|
||||
|
||||
/* create the label */
|
||||
|
||||
g_snprintf (buffer, sizeof (buffer), "%d", i+1);
|
||||
label = gtk_label_new (buffer);
|
||||
g_snprintf (buffer, sizeof (buffer), "_%d:", i+1);
|
||||
label = gtk_label_new_with_mnemonic (buffer);
|
||||
gtk_table_attach (GTK_TABLE (inputd->keys_list), label, 0, 1, i, i+1,
|
||||
0, 0, 2, 2);
|
||||
GTK_FILL, 0, 2, 2);
|
||||
gtk_widget_show (label);
|
||||
|
||||
/* the entry */
|
||||
|
||||
hbox = gtk_hbox_new (FALSE, 6);
|
||||
gtk_table_attach (GTK_TABLE (inputd->keys_list), hbox, 1, 2, i, i+1,
|
||||
GTK_EXPAND | GTK_FILL, 0, 2, 2);
|
||||
gtk_widget_show (hbox);
|
||||
|
||||
key->entry = gtk_entry_new ();
|
||||
gtk_table_attach (GTK_TABLE (inputd->keys_list), key->entry, 1, 2, i, i+1,
|
||||
GTK_EXPAND | GTK_FILL , 0, 2, 2);
|
||||
gtk_label_set_mnemonic_widget (GTK_LABEL (label), key->entry);
|
||||
gtk_box_pack_start (GTK_BOX (hbox), key->entry, TRUE, TRUE, 0);
|
||||
gtk_widget_show (key->entry);
|
||||
|
||||
g_signal_connect (key->entry, "key_press_event",
|
||||
@ -746,9 +769,8 @@ gtk_input_dialog_fill_keys(GtkInputDialog *inputd, GdkDevice *info)
|
||||
|
||||
/* and clear button */
|
||||
|
||||
button = gtk_button_new_with_label (_("clear"));
|
||||
gtk_table_attach (GTK_TABLE (inputd->keys_list), button, 2, 3, i, i+1,
|
||||
0, 0, 2, 2);
|
||||
button = gtk_button_new_with_mnemonic (_("Cl_ear"));
|
||||
gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, TRUE, 0);
|
||||
gtk_widget_show (button);
|
||||
|
||||
g_signal_connect (button, "clicked",
|
||||
|
@ -66,10 +66,6 @@ static void gtk_message_dialog_get_property (GObject *object,
|
||||
static void gtk_message_dialog_add_buttons (GtkMessageDialog *message_dialog,
|
||||
GtkButtonsType buttons);
|
||||
|
||||
static void gtk_message_dialog_font_size_change (GtkWidget *widget,
|
||||
GtkStyle *prev_style,
|
||||
gpointer data);
|
||||
|
||||
enum {
|
||||
PROP_0,
|
||||
PROP_MESSAGE_TYPE,
|
||||
@ -279,12 +275,15 @@ gtk_message_dialog_init (GtkMessageDialog *dialog)
|
||||
hbox,
|
||||
FALSE, FALSE, 0);
|
||||
|
||||
gtk_container_set_border_width (GTK_CONTAINER (dialog), 5);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (hbox), 5);
|
||||
gtk_box_set_spacing (GTK_BOX (GTK_DIALOG (dialog)->vbox), 14); /* 14 + 2 * 5 = 24 */
|
||||
gtk_container_set_border_width (GTK_CONTAINER (GTK_DIALOG (dialog)->action_area), 5);
|
||||
gtk_box_set_spacing (GTK_BOX (GTK_DIALOG (dialog)->action_area), 6);
|
||||
|
||||
gtk_widget_show_all (hbox);
|
||||
|
||||
_gtk_dialog_set_ignore_separator (GTK_DIALOG (dialog), TRUE);
|
||||
|
||||
g_signal_connect (G_OBJECT (dialog), "style-set",
|
||||
G_CALLBACK (gtk_message_dialog_font_size_change), NULL);
|
||||
}
|
||||
|
||||
static GtkMessageType
|
||||
@ -489,15 +488,6 @@ gtk_message_dialog_get_property (GObject *object,
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_message_dialog_font_size_change (GtkWidget *widget,
|
||||
GtkStyle *prev_style,
|
||||
gpointer data)
|
||||
{
|
||||
setup_primary_label_font (GTK_MESSAGE_DIALOG (widget));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* gtk_message_dialog_new:
|
||||
* @parent: transient parent, or %NULL for none
|
||||
@ -842,9 +832,10 @@ static void
|
||||
gtk_message_dialog_style_set (GtkWidget *widget,
|
||||
GtkStyle *prev_style)
|
||||
{
|
||||
GtkWidget *parent;
|
||||
gint border_width = 0;
|
||||
GtkMessageDialog *dialog = GTK_MESSAGE_DIALOG (widget);
|
||||
gboolean use_separator;
|
||||
GtkWidget *parent;
|
||||
gint border_width;
|
||||
|
||||
parent = GTK_WIDGET (GTK_MESSAGE_DIALOG (widget)->image->parent);
|
||||
|
||||
@ -854,16 +845,19 @@ gtk_message_dialog_style_set (GtkWidget *widget,
|
||||
&border_width, NULL);
|
||||
|
||||
gtk_container_set_border_width (GTK_CONTAINER (parent),
|
||||
border_width);
|
||||
MAX (0, border_width - 7));
|
||||
}
|
||||
|
||||
gtk_widget_style_get (widget,
|
||||
"use-separator", &use_separator,
|
||||
NULL);
|
||||
|
||||
_gtk_dialog_set_ignore_separator (GTK_DIALOG (widget), FALSE);
|
||||
gtk_dialog_set_has_separator (GTK_DIALOG (widget), use_separator);
|
||||
_gtk_dialog_set_ignore_separator (GTK_DIALOG (widget), TRUE);
|
||||
|
||||
setup_primary_label_font (dialog);
|
||||
|
||||
if (GTK_WIDGET_CLASS (parent_class)->style_set)
|
||||
(GTK_WIDGET_CLASS (parent_class)->style_set) (widget, prev_style);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user