[gnome-panel/gtk3] panel: Do not link the custom CSS for PanelMenuBar to one screen only
- From: Vincent Untz <vuntz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-panel/gtk3] panel: Do not link the custom CSS for PanelMenuBar to one screen only
- Date: Mon, 31 Jan 2011 14:53:15 +0000 (UTC)
commit 7230bad1c3bf2623d7fe2922422758ce56c95b16
Author: Vincent Untz <vuntz gnome org>
Date: Mon Jan 31 15:24:04 2011 +0100
panel: Do not link the custom CSS for PanelMenuBar to one screen only
Instead of calling gtk_style_context_add_provider_for_screen() in the
class init method (where we don't have a widget), call
gtk_style_context_add_provider in object init method.
gnome-panel/panel-menu-bar.c | 24 ++++++++++++------------
1 files changed, 12 insertions(+), 12 deletions(-)
---
diff --git a/gnome-panel/panel-menu-bar.c b/gnome-panel/panel-menu-bar.c
index 2dd196a..553e293 100644
--- a/gnome-panel/panel-menu-bar.c
+++ b/gnome-panel/panel-menu-bar.c
@@ -134,10 +134,22 @@ panel_menu_bar_setup_tooltip (PanelMenuBar *menubar)
static void
panel_menu_bar_init (PanelMenuBar *menubar)
{
+ GtkCssProvider *provider;
GtkWidget *image;
menubar->priv = PANEL_MENU_BAR_GET_PRIVATE (menubar);
+ provider = gtk_css_provider_new ();
+ gtk_css_provider_load_from_data (provider,
+ "PanelMenuBar {\n"
+ " border-width: 0px;\n"
+ "}",
+ -1, NULL);
+ gtk_style_context_add_provider (gtk_widget_get_style_context (GTK_WIDGET (menubar)),
+ GTK_STYLE_PROVIDER (provider),
+ GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
+ g_object_unref (provider);
+
menubar->priv->info = NULL;
menubar->priv->applications_menu = create_applications_menu ("applications.menu", NULL, TRUE);
@@ -276,7 +288,6 @@ panel_menu_bar_class_init (PanelMenuBarClass *klass)
{
GObjectClass *gobject_class = (GObjectClass *) klass;
GtkWidgetClass *widget_class = (GtkWidgetClass *) klass;
- GtkCssProvider *provider;
gobject_class->get_property = panel_menu_bar_get_property;
gobject_class->set_property = panel_menu_bar_set_property;
@@ -295,17 +306,6 @@ panel_menu_bar_class_init (PanelMenuBarClass *klass)
PANEL_TYPE_ORIENTATION,
PANEL_ORIENTATION_TOP,
G_PARAM_READWRITE));
-
- provider = gtk_css_provider_new ();
- gtk_css_provider_load_from_data (provider,
- "PanelMenuBar {\n"
- " border-width: 0px;\n"
- "}",
- -1, NULL);
- gtk_style_context_add_provider_for_screen (gdk_screen_get_default(),
- GTK_STYLE_PROVIDER (provider),
- GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
- g_object_unref (provider);
}
static gboolean
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]