[gnome-panel] add gp-text-color css class
- From: Alberts Muktupāvels <muktupavels src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-panel] add gp-text-color css class
- Date: Sat, 8 Oct 2016 12:58:32 +0000 (UTC)
commit 06b86cf59ea213441c8ad5465b550671fe6c3509
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date: Sat Oct 8 15:46:29 2016 +0300
add gp-text-color css class
applets/clock/clock.c | 2 ++
data/theme/Adwaita/gnome-panel-dark.css | 4 ++++
data/theme/Adwaita/gnome-panel.css | 4 ++++
data/theme/HighContrast/gnome-panel.css | 4 ++++
gnome-panel/panel-menu-bar.c | 6 ++++++
gnome-panel/panel-menu-items.c | 15 +++++++++++++++
6 files changed, 35 insertions(+), 0 deletions(-)
---
diff --git a/applets/clock/clock.c b/applets/clock/clock.c
index ec6ca79..22fe3a2 100644
--- a/applets/clock/clock.c
+++ b/applets/clock/clock.c
@@ -813,6 +813,8 @@ create_main_clock_label (ClockData *cd)
G_CALLBACK (clock_update_text_gravity),
NULL);
+ panel_applet_add_text_class (PANEL_APPLET (cd->applet), label);
+
return label;
}
diff --git a/data/theme/Adwaita/gnome-panel-dark.css b/data/theme/Adwaita/gnome-panel-dark.css
index 873a753..bfc23ef 100644
--- a/data/theme/Adwaita/gnome-panel-dark.css
+++ b/data/theme/Adwaita/gnome-panel-dark.css
@@ -2,6 +2,10 @@ panel-toplevel {
background-color: #393f3f;
}
+.gp-text-color {
+ color: #ffffff;
+}
+
.gnome-panel-menu-bar,
panel-applet > menubar {
background: transparent;
diff --git a/data/theme/Adwaita/gnome-panel.css b/data/theme/Adwaita/gnome-panel.css
index 2552c95..6eed945 100644
--- a/data/theme/Adwaita/gnome-panel.css
+++ b/data/theme/Adwaita/gnome-panel.css
@@ -2,6 +2,10 @@ panel-toplevel {
background-color: #e8e8e7;
}
+.gp-text-color {
+ color: #000000;
+}
+
.gnome-panel-menu-bar,
panel-applet > menubar {
background: transparent;
diff --git a/data/theme/HighContrast/gnome-panel.css b/data/theme/HighContrast/gnome-panel.css
index 1567d27..80a62b2 100644
--- a/data/theme/HighContrast/gnome-panel.css
+++ b/data/theme/HighContrast/gnome-panel.css
@@ -2,6 +2,10 @@ panel-toplevel {
background-color: #ffffff;
}
+.gp-text-color {
+ color: #000000;
+}
+
.gnome-panel-menu-bar,
panel-applet > menubar {
background: transparent;
diff --git a/gnome-panel/panel-menu-bar.c b/gnome-panel/panel-menu-bar.c
index d420969..9f59040 100644
--- a/gnome-panel/panel-menu-bar.c
+++ b/gnome-panel/panel-menu-bar.c
@@ -112,6 +112,8 @@ panel_menu_bar_init (PanelMenuBar *menubar)
{
gchar *applications_menu;
GtkIconSize icon_size;
+ GtkWidget *label;
+ GtkStyleContext *context;
menubar->priv = PANEL_MENU_BAR_GET_PRIVATE (menubar);
@@ -125,6 +127,10 @@ panel_menu_bar_init (PanelMenuBar *menubar)
gtk_menu_item_set_label (GTK_MENU_ITEM (menubar->priv->applications_item),
_("Applications"));
+ label = gtk_bin_get_child (GTK_BIN (menubar->priv->applications_item));
+ context = gtk_widget_get_style_context (label);
+ gtk_style_context_add_class (context, "gp-text-color");
+
icon_size = panel_menu_bar_object_icon_get_size ();
menubar->priv->image = gtk_image_new_from_icon_name (PANEL_ICON_MAIN_MENU, icon_size);
gtk_image_set_pixel_size (GTK_IMAGE (menubar->priv->image),
diff --git a/gnome-panel/panel-menu-items.c b/gnome-panel/panel-menu-items.c
index a5bc93e..b7a002d 100644
--- a/gnome-panel/panel-menu-items.c
+++ b/gnome-panel/panel-menu-items.c
@@ -1445,7 +1445,15 @@ panel_place_menu_item_new (gboolean use_image,
icon_name = PANEL_ICON_FOLDER;
if (in_menubar) {
+ GtkWidget *label;
+ GtkStyleContext *context;
+
gtk_menu_item_set_label (GTK_MENU_ITEM (menuitem), name);
+
+ label = gtk_bin_get_child (GTK_BIN (menuitem));
+ context = gtk_widget_get_style_context (label);
+ gtk_style_context_add_class (context, "gp-text-color");
+
if (use_image) {
GtkIconSize icon_size;
GtkWidget *image;
@@ -1493,9 +1501,16 @@ panel_desktop_menu_item_new (gboolean use_image,
/* if we're in a menubar, we don't want to use setup_* as it changes
* the size requests and can make the panels bigger than we'd like */
if (in_menubar) {
+ GtkWidget *label;
+ GtkStyleContext *context;
+
gtk_menu_item_set_label (GTK_MENU_ITEM (menuitem), name);
menuitem->priv->icon_size = panel_menu_bar_object_icon_get_size ();
+ label = gtk_bin_get_child (GTK_BIN (menuitem));
+ context = gtk_widget_get_style_context (label);
+ gtk_style_context_add_class (context, "gp-text-color");
+
if (use_image) {
GtkWidget *image;
image = gtk_image_new_from_icon_name (icon_name,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]