[Xfce4-commits] [apps/xfdashboard] 01/04: Implement new signal "theme-changing" at XfdashboardApplication that is emitted before a new theme is going to loaded and to be changed to.
noreply at xfce.org
noreply at xfce.org
Thu Jun 30 10:03:29 CEST 2016
This is an automated email from the git hooks/post-receive script.
nomad pushed a commit to branch master
in repository apps/xfdashboard.
commit 2ff8fb6db412c5af6a8ff0ad1cda1e3d4d11a9c1
Author: Stephan Haller <nomad at froevel.de>
Date: Thu Jun 30 08:08:16 2016 +0200
Implement new signal "theme-changing" at XfdashboardApplication that is emitted before a new theme is going to loaded and to be changed to.
---
libxfdashboard/application.c | 30 ++++++++++++++++++++++++++++++
libxfdashboard/application.h | 1 +
2 files changed, 31 insertions(+)
diff --git a/libxfdashboard/application.c b/libxfdashboard/application.c
index b661f60..738ef3b 100644
--- a/libxfdashboard/application.c
+++ b/libxfdashboard/application.c
@@ -123,9 +123,13 @@ enum
SIGNAL_INITIALIZED,
SIGNAL_QUIT,
SIGNAL_SHUTDOWN_FINAL,
+
SIGNAL_SUSPEND,
SIGNAL_RESUME,
+
+ SIGNAL_THEME_CHANGING,
SIGNAL_THEME_CHANGED,
+
SIGNAL_APPLICATION_LAUNCHED,
/* Actions */
@@ -287,6 +291,9 @@ static void _xfdashboard_application_set_theme_name(XfdashboardApplication *self
/* Notify about property change */
g_object_notify_by_pspec(G_OBJECT(self), XfdashboardApplicationProperties[PROP_THEME_NAME]);
+ /* Emit signal that theme is going to be loaded and changed */
+ g_signal_emit(self, XfdashboardApplicationSignals[SIGNAL_THEME_CHANGING], 0, priv->theme);
+
/* Create new theme instance and load theme */
theme=xfdashboard_theme_new();
if(!xfdashboard_theme_load(theme, priv->themeName, &error))
@@ -1228,6 +1235,29 @@ static void xfdashboard_application_class_init(XfdashboardApplicationClass *klas
0);
/**
+ * XfdashboardApplication::theme-changing:
+ * @self: The application whose theme is going to change
+ * @inTheme: The new #XfdashboardTheme used
+ *
+ * The ::theme-changing signal is emitted when the theme of application
+ * is going to be loaded and changed. When this signal is received no file
+ * was loaded so far but will be. For example, at this moment it is possible
+ * to load a CSS file by a plugin before the CSS files of the new theme will
+ * be loaded to give the theme a chance to override the default CSS of plugin.
+ */
+ XfdashboardApplicationSignals[SIGNAL_THEME_CHANGING]=
+ g_signal_new("theme-changing",
+ G_TYPE_FROM_CLASS(klass),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET(XfdashboardApplicationClass, theme_changing),
+ NULL,
+ NULL,
+ g_cclosure_marshal_VOID__OBJECT,
+ G_TYPE_NONE,
+ 1,
+ XFDASHBOARD_TYPE_THEME);
+
+ /**
* XfdashboardApplication::theme-changed:
* @self: The application whose theme has changed
* @inTheme: The new #XfdashboardTheme used
diff --git a/libxfdashboard/application.h b/libxfdashboard/application.h
index 367e605..140d31a 100644
--- a/libxfdashboard/application.h
+++ b/libxfdashboard/application.h
@@ -114,6 +114,7 @@ struct _XfdashboardApplicationClass
void (*quit)(XfdashboardApplication *self);
void (*shutdown_final)(XfdashboardApplication *self);
+ void (*theme_changing)(XfdashboardApplication *self, XfdashboardTheme *inTheme);
void (*theme_changed)(XfdashboardApplication *self, XfdashboardTheme *inTheme);
void (*application_launched)(XfdashboardApplication *self, GAppInfo *inAppInfo);
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Xfce4-commits
mailing list