[gedit/wip/open-recent-menu] Window: finer control of the open recent menu




commit dcaf5cc6a0d866d3d6a06263512c72afcc303467
Author: Sébastien Wilmet <swilmet informatique-libre be>
Date:   Thu Jul 21 17:04:56 2022 +0200

    Window: finer control of the open recent menu

 gedit/gedit-window.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)
---
diff --git a/gedit/gedit-window.c b/gedit/gedit-window.c
index 2f9a2076f..889b5541c 100644
--- a/gedit/gedit-window.c
+++ b/gedit/gedit-window.c
@@ -2626,7 +2626,7 @@ create_open_buttons (GeditWindow    *window,
        GtkWidget *open_dialog_button;
        GtkWidget *my_open_recent_button;
        AmtkApplicationWindow *amtk_window;
-       GtkWidget *recent_menu;
+       GtkRecentChooserMenu *recent_menu;
 
        /* It currently needs to be a GtkBox, not a GtkGrid, because GtkGrid and
         * GTK_STYLE_CLASS_LINKED doesn't work as expected in a RTL locale.
@@ -2643,9 +2643,13 @@ create_open_buttons (GeditWindow    *window,
        my_open_recent_button = gtk_menu_button_new ();
        gtk_widget_set_tooltip_text (my_open_recent_button, _("Open a recently used file"));
 
+       recent_menu = amtk_application_window_create_open_recent_menu_base ();
+
        amtk_window = amtk_application_window_get_from_gtk_application_window (GTK_APPLICATION_WINDOW 
(window));
-       recent_menu = amtk_application_window_create_open_recent_menu (amtk_window);
-       gtk_menu_button_set_popup (GTK_MENU_BUTTON (my_open_recent_button), recent_menu);
+       amtk_application_window_connect_recent_chooser_menu_to_statusbar (amtk_window, recent_menu);
+
+       gtk_menu_button_set_popup (GTK_MENU_BUTTON (my_open_recent_button),
+                                  GTK_WIDGET (recent_menu));
 
        gtk_container_add (GTK_CONTAINER (hbox), open_dialog_button);
        gtk_container_add (GTK_CONTAINER (hbox), my_open_recent_button);


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