diff options
author | rbuj <[email protected]> | 2019-06-19 00:28:40 +0200 |
---|---|---|
committer | rbuj <[email protected]> | 2019-06-19 08:43:51 +0200 |
commit | 2e903d139874a5516c70698c3b688c71d0a805e1 (patch) | |
tree | ea032a969c31b41cc03b14cadef073afb18fb12a /capplets/time-admin/src/time-zone.c | |
parent | 51e386fd4f5c60750c57a815203981754580e01d (diff) | |
download | mate-control-center-2e903d139874a5516c70698c3b688c71d0a805e1.tar.bz2 mate-control-center-2e903d139874a5516c70698c3b688c71d0a805e1.tar.xz |
time-admin: shortcuts, images & shared code for buttons
- Add & enable mnemonic accelerator keys
- Show Save/Close button icons in Time/Date manager window
- Remove DialogAddButtonWithIconName from shares
Diffstat (limited to 'capplets/time-admin/src/time-zone.c')
-rw-r--r-- | capplets/time-admin/src/time-zone.c | 28 |
1 files changed, 17 insertions, 11 deletions
diff --git a/capplets/time-admin/src/time-zone.c b/capplets/time-admin/src/time-zone.c index 6f26fe12..b9bc4955 100644 --- a/capplets/time-admin/src/time-zone.c +++ b/capplets/time-admin/src/time-zone.c @@ -426,9 +426,7 @@ static void ChoooseTimezoneClose(GtkWidget *widget, void SetupTimezoneDialog(TimeAdmin *ta) { - GtkWidget *Vbox; - GtkWidget *TimeZoneFrame; - GtkWidget *Scrolled; + GtkWidget *Vbox, *TimeZoneFrame, *Scrolled, *image; ta->dialog = gtk_dialog_new_with_buttons (_("Time Zone Selection"), NULL, @@ -437,15 +435,23 @@ void SetupTimezoneDialog(TimeAdmin *ta) NULL); gtk_window_set_default_size (GTK_WINDOW (ta->dialog), 730, 520); - ta->TZclose = DialogAddButtonWithIconName(GTK_DIALOG(ta->dialog), - _("Close"), - "window-close", - GTK_RESPONSE_CANCEL); - ta->TZconfire = DialogAddButtonWithIconName(GTK_DIALOG(ta->dialog), - _("Confirm"), - "emblem-default", - GTK_RESPONSE_OK); + ta->TZclose = gtk_button_new_with_mnemonic (_("_Close")); + image = gtk_image_new_from_icon_name ("window-close", GTK_ICON_SIZE_BUTTON); + gtk_button_set_image (GTK_BUTTON (ta->TZclose), image); + gtk_button_set_use_underline (GTK_BUTTON (ta->TZclose), TRUE); + gtk_style_context_add_class (gtk_widget_get_style_context (ta->TZclose), "text-button"); + gtk_widget_set_can_default (ta->TZclose, TRUE); + gtk_dialog_add_action_widget (GTK_DIALOG (ta->dialog), ta->TZclose, GTK_RESPONSE_CANCEL); + + ta->TZconfire = gtk_button_new_with_mnemonic (_("Con_firm")); + image = gtk_image_new_from_icon_name ("emblem-default", GTK_ICON_SIZE_BUTTON); + gtk_button_set_image (GTK_BUTTON (ta->TZconfire), image); + gtk_button_set_use_underline (GTK_BUTTON (ta->TZconfire), TRUE); + gtk_style_context_add_class (gtk_widget_get_style_context (ta->TZconfire), "text-button"); + gtk_widget_set_can_default (ta->TZconfire, TRUE); + gtk_dialog_add_action_widget (GTK_DIALOG (ta->dialog), ta->TZconfire, GTK_RESPONSE_OK); + g_signal_connect (ta->TZconfire, "clicked", G_CALLBACK (ChoooseTimezoneDone), |