summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPablo Barciela <[email protected]>2018-04-15 01:41:24 +0200
committerlukefromdc <[email protected]>2018-04-15 13:47:53 -0400
commit7ebb4948319de1e1615e18b6183388fc0b4a63ef (patch)
tree9c9ecd115d40942d1441f96162b8354912851dab
parent33e46553a2472ce0b5d5ada65797ee3d2474e77a (diff)
downloadmate-panel-7ebb4948319de1e1615e18b6183388fc0b4a63ef.tar.bz2
mate-panel-7ebb4948319de1e1615e18b6183388fc0b4a63ef.tar.xz
fish.c: avoid 'gtk_dialog_new_with_buttons' with stock id
-rw-r--r--applets/fish/fish.c36
1 files changed, 30 insertions, 6 deletions
diff --git a/applets/fish/fish.c b/applets/fish/fish.c
index 1a1e5807..c8dfd259 100644
--- a/applets/fish/fish.c
+++ b/applets/fish/fish.c
@@ -802,6 +802,26 @@ set_environment (gpointer display)
g_setenv ("DISPLAY", display, TRUE);
}
+static GtkWidget*
+panel_dialog_add_button (GtkDialog *dialog,
+ const gchar *button_text,
+ const gchar *icon_name,
+ gint response_id)
+{
+ GtkWidget *button;
+
+ button = gtk_button_new_with_mnemonic (button_text);
+ gtk_button_set_image (GTK_BUTTON (button), gtk_image_new_from_icon_name (icon_name, GTK_ICON_SIZE_BUTTON));
+
+ gtk_button_set_use_underline (GTK_BUTTON (button), TRUE);
+ gtk_style_context_add_class (gtk_widget_get_style_context (button), "text-button");
+ gtk_widget_set_can_default (button, TRUE);
+ gtk_widget_show (button);
+ gtk_dialog_add_action_widget (GTK_DIALOG (dialog), button, response_id);
+
+ return button;
+}
+
static void display_fortune_dialog(FishApplet* fish)
{
GError *error = NULL;
@@ -831,12 +851,16 @@ static void display_fortune_dialog(FishApplet* fish)
int screen_width;
int screen_height;
- fish->fortune_dialog =
- gtk_dialog_new_with_buttons (
- "", NULL, 0,
- _("_Speak again"), FISH_RESPONSE_SPEAK,
- "gtk-close", GTK_RESPONSE_CLOSE,
- NULL);
+ fish->fortune_dialog = gtk_dialog_new ();
+ gtk_window_set_title (GTK_WINDOW (fish->fortune_dialog), "");
+
+ gtk_dialog_add_button (GTK_DIALOG (fish->fortune_dialog),
+ _("_Speak again"),
+ FISH_RESPONSE_SPEAK);
+
+ panel_dialog_add_button (GTK_DIALOG (fish->fortune_dialog),
+ _("_Close"), "window-close",
+ GTK_RESPONSE_CLOSE);
gtk_window_set_icon_name (GTK_WINDOW (fish->fortune_dialog),
FISH_ICON);