[gedit] replace-open-button: re-create a simple Open button



commit abab6529f6dae60d6d4f222ccf2860d73838008c
Author: Sébastien Wilmet <swilmet gnome org>
Date:   Tue Nov 26 09:26:28 2019 +0100

    replace-open-button: re-create a simple Open button

 gedit/gedit-window.c | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
---
diff --git a/gedit/gedit-window.c b/gedit/gedit-window.c
index 0e525fb5f..6f91fdb90 100644
--- a/gedit/gedit-window.c
+++ b/gedit/gedit-window.c
@@ -2643,6 +2643,23 @@ sync_fullscreen_actions (GeditWindow *window,
        g_object_unref (action);
 }
 
+static void
+init_open_button (GeditWindow *window)
+{
+       GtkWidget *open_button;
+
+       open_button = gtk_button_new_with_mnemonic (_("_Open"));
+       gtk_widget_set_tooltip_text (open_button, _("Open a file"));
+       gtk_actionable_set_action_name (GTK_ACTIONABLE (open_button), "win.open");
+       gtk_widget_show (open_button);
+
+       /* Add before the New Tab button. */
+       gtk_container_add_with_properties (GTK_CONTAINER (window->priv->headerbar),
+                                          open_button,
+                                          "position", 0,
+                                          NULL);
+}
+
 static void
 gedit_window_init (GeditWindow *window)
 {
@@ -2671,6 +2688,7 @@ gedit_window_init (GeditWindow *window)
        window->priv->message_bus = gedit_message_bus_new ();
 
        gtk_widget_init_template (GTK_WIDGET (window));
+       init_open_button (window);
 
        g_action_map_add_action_entries (G_ACTION_MAP (window),
                                         win_entries,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]