[gnome-panel] libpanel-applet: add panel_applet_add_text_class
- From: Alberts Muktupāvels <muktupavels src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-panel] libpanel-applet: add panel_applet_add_text_class
- Date: Sat, 8 Oct 2016 12:58:27 +0000 (UTC)
commit 4ff1e39813081c34b38a31945ce447d212bde8f4
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date: Sat Oct 8 15:18:59 2016 +0300
libpanel-applet: add panel_applet_add_text_class
libpanel-applet/panel-applet.c | 21 +++++++++++++++++++++
libpanel-applet/panel-applet.h | 3 +++
2 files changed, 24 insertions(+), 0 deletions(-)
---
diff --git a/libpanel-applet/panel-applet.c b/libpanel-applet/panel-applet.c
index 4cd1838..1a6ffcb 100644
--- a/libpanel-applet/panel-applet.c
+++ b/libpanel-applet/panel-applet.c
@@ -414,6 +414,27 @@ panel_applet_get_gtk_orientation (PanelApplet *applet)
return GTK_ORIENTATION_HORIZONTAL;
}
+/**
+ * panel_applet_add_text_class:
+ * @applet: a #PanelApplet
+ * @widget: a #GtkWidget
+ *
+ * Use this function to add css class to widgets that are visible on panel
+ * and shows text.
+ *
+ * Since: 3.22
+ */
+void
+panel_applet_add_text_class (PanelApplet *applet,
+ GtkWidget *widget)
+{
+ GtkStyleContext *context;
+
+ context = gtk_widget_get_style_context (widget);
+
+ gtk_style_context_add_class (context, "gp-text-color");
+}
+
/* Applets cannot set their orientation, so API is not public. */
static void
panel_applet_set_orient (PanelApplet *applet,
diff --git a/libpanel-applet/panel-applet.h b/libpanel-applet/panel-applet.h
index a970fd1..e41989d 100644
--- a/libpanel-applet/panel-applet.h
+++ b/libpanel-applet/panel-applet.h
@@ -164,6 +164,9 @@ GType panel_applet_get_type (void) G_GNUC_CONST;
PanelAppletOrient panel_applet_get_orient (PanelApplet *applet);
GtkOrientation panel_applet_get_gtk_orientation (PanelApplet *applet);
+void panel_applet_add_text_class (PanelApplet *applet,
+ GtkWidget *widget);
+
GSettings *panel_applet_settings_new (PanelApplet *applet,
const char *schema);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]