Add "icon-size-changed" signal to LXPanel, emit it when icons size was changed.
authorAndriy Grytsenko <andrej@rep.kiev.ua>
Sat, 15 Nov 2014 12:37:37 +0000 (14:37 +0200)
committerAndriy Grytsenko <andrej@rep.kiev.ua>
Sat, 15 Nov 2014 12:37:37 +0000 (14:37 +0200)
ChangeLog
src/panel.c
src/panel.h.in
src/private.h

index 12ce44c..57084f8 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -23,6 +23,8 @@
 * Added API panel_config_hotkey_button_new() to use as CONF_TYPE_EXTERNAL
     widget to allow configure global hotkeys for plugins functions.
 * Added API panel_config_click_button_new() to configure mouse gestures.
+* Added "icon-size-changed" signal to LXPanel which is emitted when icons
+    size in configuration dialog was changed.
 
 0.7.2
 -------------------------------------------------------------------------
index bfa0177..e457838 100644 (file)
@@ -58,6 +58,14 @@ static void ah_stop(LXPanel *p);
 static void on_root_bg_changed(FbBg *bg, LXPanel* p);
 static void _panel_update_background(LXPanel * p);
 
+enum
+{
+    ICON_SIZE_CHANGED,
+    N_SIGNALS
+};
+
+static guint signals[N_SIGNALS];
+
 G_DEFINE_TYPE(PanelToplevel, lxpanel, GTK_TYPE_WINDOW);
 
 static void lxpanel_finalize(GObject *object)
@@ -291,6 +299,15 @@ static void lxpanel_class_init(PanelToplevelClass *klass)
     widget_class->style_set = lxpanel_style_set;
     widget_class->map_event = lxpanel_map_event;
     widget_class->button_press_event = lxpanel_button_press;
+
+    signals[ICON_SIZE_CHANGED] =
+        g_signal_new("icon-size-changed",
+                     G_TYPE_FROM_CLASS(klass),
+                     G_SIGNAL_RUN_LAST,
+                     G_STRUCT_OFFSET(PanelToplevelClass, icon_size_changed),
+                     NULL, NULL,
+                     g_cclosure_marshal_VOID__VOID,
+                     G_TYPE_NONE, 0, G_TYPE_NONE);
 }
 
 static void lxpanel_init(PanelToplevel *self)
@@ -334,6 +351,11 @@ static LXPanel* panel_allocate(void)
     return g_object_new(LX_TYPE_PANEL, NULL);
 }
 
+void _panel_emit_icon_size_changed(LXPanel *p)
+{
+    g_signal_emit(p, signals[ICON_SIZE_CHANGED], 0);
+}
+
 /* Normalize panel configuration after load from file or reconfiguration. */
 static void panel_normalize_configuration(Panel* p)
 {
index ada1104..e3b91a2 100644 (file)
@@ -57,6 +57,7 @@ struct _LXPanel
 struct _LXPanelClass
 {
     GtkWindowClass parent_class;
+    void (*icon_size_changed)(LXPanel *panel);
 };
 
 /**
index 5fdf847..b3a47e3 100644 (file)
@@ -231,6 +231,7 @@ void _panel_establish_autohide(LXPanel *p);
 void _panel_set_wm_strut(LXPanel *p);
 void _panel_set_panel_configuration_changed(LXPanel *p);
 void _panel_queue_update_background(LXPanel *p);
+void _panel_emit_icon_size_changed(LXPanel *p);
 
 void panel_configure(LXPanel* p, int sel_page);
 gboolean panel_edge_available(Panel* p, int edge, gint monitor);