[gedit] Fix full screen open menu to set right recent menu limit
- From: Ignacio Casal Quinteiro <icq src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gedit] Fix full screen open menu to set right recent menu limit
- Date: Tue, 7 Jan 2014 23:18:01 +0000 (UTC)
commit 5c1c09604b23c2a7fbb6001087f6d9572294e065
Author: Ignacio Casal Quinteiro <icq gnome org>
Date: Wed Jan 8 00:17:31 2014 +0100
Fix full screen open menu to set right recent menu limit
gedit/gedit-open-menu-button.c | 12 +-----------
gedit/gedit-window-private.h | 1 +
gedit/gedit-window.c | 7 +++++++
3 files changed, 9 insertions(+), 11 deletions(-)
---
diff --git a/gedit/gedit-open-menu-button.c b/gedit/gedit-open-menu-button.c
index 212a7e1..522b658 100644
--- a/gedit/gedit-open-menu-button.c
+++ b/gedit/gedit-open-menu-button.c
@@ -106,6 +106,7 @@ gedit_open_menu_button_set_property (GObject *object,
{
case PROP_LIMIT:
priv->limit = g_value_get_int (value);
+ set_recent_menu (button);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
@@ -114,16 +115,6 @@ gedit_open_menu_button_set_property (GObject *object,
}
static void
-gedit_open_menu_button_constructed (GObject *object)
-{
- GeditOpenMenuButton *button = GEDIT_OPEN_MENU_BUTTON (object);
-
- set_recent_menu (button);
-
- G_OBJECT_CLASS (gedit_open_menu_button_parent_class)->constructed (object);
-}
-
-static void
gedit_open_menu_button_init (GeditOpenMenuButton *button)
{
GeditOpenMenuButtonPrivate *priv;
@@ -140,7 +131,6 @@ gedit_open_menu_button_class_init (GeditOpenMenuButtonClass *klass)
object_class->dispose = gedit_open_menu_button_dispose;
object_class->get_property = gedit_open_menu_button_get_property;
object_class->set_property = gedit_open_menu_button_set_property;
- object_class->constructed = gedit_open_menu_button_constructed;
g_object_class_install_property (object_class, PROP_LIMIT,
g_param_spec_int ("limit",
diff --git a/gedit/gedit-window-private.h b/gedit/gedit-window-private.h
index 24515a8..8d41f8e 100644
--- a/gedit/gedit-window-private.h
+++ b/gedit/gedit-window-private.h
@@ -65,6 +65,7 @@ struct _GeditWindowPrivate
/* Widgets for fullscreen mode */
GtkWidget *fullscreen_controls;
+ GtkWidget *fullscreen_open_menu;
GtkMenuButton *fullscreen_gear_button;
gboolean fullscreen_controls_setup;
guint fullscreen_animation_timeout_id;
diff --git a/gedit/gedit-window.c b/gedit/gedit-window.c
index 82bde2d..942ad12 100644
--- a/gedit/gedit-window.c
+++ b/gedit/gedit-window.c
@@ -435,6 +435,7 @@ gedit_window_class_init (GeditWindowClass *klass)
gtk_widget_class_bind_template_child_private (widget_class, GeditWindow, bottom_panel);
gtk_widget_class_bind_template_child_private (widget_class, GeditWindow, statusbar);
gtk_widget_class_bind_template_child_private (widget_class, GeditWindow, fullscreen_controls);
+ gtk_widget_class_bind_template_child_private (widget_class, GeditWindow, fullscreen_open_menu);
gtk_widget_class_bind_template_child_private (widget_class, GeditWindow, fullscreen_gear_button);
}
@@ -2039,6 +2040,12 @@ fullscreen_controls_setup (GeditWindow *window)
"win",
G_ACTION_GROUP (window));
+ g_settings_bind (window->priv->ui_settings,
+ GEDIT_SETTINGS_MAX_RECENTS,
+ window->priv->fullscreen_open_menu,
+ "limit",
+ G_SETTINGS_BIND_GET);
+
g_signal_connect (priv->fullscreen_controls, "enter-notify-event",
G_CALLBACK (on_fullscreen_controls_enter_notify_event),
window);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]