diff options
author | Federico Mena Quintero <federico@ximian.com> | 2002-07-19 20:27:29 +0000 |
---|---|---|
committer | Federico Mena Quintero <federico@src.gnome.org> | 2002-07-19 20:27:29 +0000 |
commit | fa5dfae9e64e15843f21809e820276e7a54fec56 (patch) | |
tree | 8115a8114e175418ed4648de056cf0912c58ef48 /src | |
parent | dfff0b2322a9a56f7d80bc90d2212f2b438e3c86 (diff) | |
download | nautilus-fa5dfae9e64e15843f21809e820276e7a54fec56.tar.gz |
Fixes the Nautilus part of #46238; see eel for the other part.
2002-07-19 Federico Mena Quintero <federico@ximian.com>
Fixes the Nautilus part of #46238; see eel for the other part.
* components/hardware/nautilus-hardware-view.c
(nautilus_hardware_view_init): Do not set a hardcoded background
color; just use the color from the GTK+ theme. We still set up
the EelBackground as this handles dragged colors, but it does not
save them anywhere.
* components/notes/nautilus-notes.c (make_notes_view): Do not set
up an EelBackground at all for the text view; just let it use the
default color from the GTK+ theme. This code did not handle
dragged colors or anything, anyways.
* src/nautilus-property-browser.c
(nautilus_property_browser_init): Do not set a hardcoded
background color.
* src/nautilus-sidebar.c (nautilus_sidebar_style_set):
::style_set() handler; we act as if the theme changed.
* icons/gnome/gnome.xml: Removed hardcoded colors and background
images so that we follow the current GTK+ theme. It's bland but good.
Diffstat (limited to 'src')
-rw-r--r-- | src/nautilus-information-panel.c | 20 | ||||
-rw-r--r-- | src/nautilus-property-browser.c | 9 | ||||
-rw-r--r-- | src/nautilus-sidebar.c | 20 |
3 files changed, 40 insertions, 9 deletions
diff --git a/src/nautilus-information-panel.c b/src/nautilus-information-panel.c index dcb32fd38..275280aa9 100644 --- a/src/nautilus-information-panel.c +++ b/src/nautilus-information-panel.c @@ -38,6 +38,7 @@ #include <bonobo/bonobo-exception.h> #include <eel/eel-background.h> +#include <eel/eel-background-style.h> #include <eel/eel-glib-extensions.h> #include <eel/eel-gtk-extensions.h> #include <eel/eel-gtk-macros.h> @@ -122,6 +123,8 @@ static void nautilus_sidebar_drag_data_received (GtkWidget *widget static void nautilus_sidebar_read_theme (NautilusSidebar *sidebar); static void nautilus_sidebar_size_allocate (GtkWidget *widget, GtkAllocation *allocation); +static void nautilus_sidebar_style_set (GtkWidget *widget, + GtkStyle *previous_style); static void nautilus_sidebar_theme_changed (gpointer user_data); static void nautilus_sidebar_confirm_trash_changed (gpointer user_data); static void nautilus_sidebar_update_appearance (NautilusSidebar *sidebar); @@ -200,6 +203,7 @@ nautilus_sidebar_class_init (GtkObjectClass *object_klass) widget_class->button_press_event = nautilus_sidebar_press_event; widget_class->button_release_event = nautilus_sidebar_release_event; widget_class->size_allocate = nautilus_sidebar_size_allocate; + widget_class->style_set = nautilus_sidebar_style_set; /* add the "location changed" signal */ signals[LOCATION_CHANGED] = g_signal_new @@ -1706,6 +1710,22 @@ nautilus_sidebar_size_allocate (GtkWidget *widget, } } +/* ::style_set handler for the sidebar */ +static void +nautilus_sidebar_style_set (GtkWidget *widget, GtkStyle *previous_style) +{ + NautilusSidebar *sidebar; + GtkStyle *style; + + sidebar = NAUTILUS_SIDEBAR (widget); + + style = gtk_widget_get_style (widget); + + /* This is slightly hackish */ + if (!EEL_IS_BACKGROUND_STYLE (style)) + nautilus_sidebar_theme_changed (sidebar); +} + void nautilus_sidebar_setup_width (NautilusSidebar *sidebar) { diff --git a/src/nautilus-property-browser.c b/src/nautilus-property-browser.c index ccf9fc2ad..c708d4e39 100644 --- a/src/nautilus-property-browser.c +++ b/src/nautilus-property-browser.c @@ -32,7 +32,6 @@ #include "nautilus-property-browser.h" #include "nautilus-signaller.h" -#include <eel/eel-background.h> #include <eel/eel-gdk-extensions.h> #include <eel/eel-gdk-pixbuf-extensions.h> #include <eel/eel-glib-extensions.h> @@ -190,10 +189,6 @@ static void element_clicked_callback (GtkWidget gpointer callback_data); -#define BROWSER_BACKGROUND_COLOR "#FFFFFF" - -#define THEME_SELECT_COLOR "#FF9999" - #define BROWSER_CATEGORIES_FILE_NAME "browser.xml" #define PROPERTY_BROWSER_WIDTH 540 @@ -273,7 +268,6 @@ nautilus_property_browser_init (GtkObject *object) gtk_window_set_title (GTK_WINDOW (widget), _("Backgrounds and Emblems")); gtk_window_set_wmclass (GTK_WINDOW (widget), "property_browser", "Nautilus"); eel_gtk_window_set_up_close_accelerator (GTK_WINDOW (widget)); - /* create the main vbox. */ vbox = gtk_vbox_new (FALSE, 0); @@ -1961,7 +1955,6 @@ nautilus_property_browser_update_contents (NautilusPropertyBrowser *property_bro { xmlNodePtr cur_node; xmlDocPtr document; - EelBackground *background; GtkWidget *viewport; GtkRadioButton *group; gboolean got_categories; @@ -1985,8 +1978,6 @@ nautilus_property_browser_update_contents (NautilusPropertyBrowser *property_bro viewport = gtk_viewport_new (NULL, NULL); gtk_widget_show(viewport); gtk_viewport_set_shadow_type(GTK_VIEWPORT(viewport), GTK_SHADOW_IN); - background = eel_get_widget_background (viewport); - eel_background_set_color (background, BROWSER_BACKGROUND_COLOR); gtk_container_add (GTK_CONTAINER (property_browser->details->content_container), property_browser->details->content_frame); gtk_widget_show (property_browser->details->content_frame); gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (property_browser->details->content_frame), diff --git a/src/nautilus-sidebar.c b/src/nautilus-sidebar.c index dcb32fd38..275280aa9 100644 --- a/src/nautilus-sidebar.c +++ b/src/nautilus-sidebar.c @@ -38,6 +38,7 @@ #include <bonobo/bonobo-exception.h> #include <eel/eel-background.h> +#include <eel/eel-background-style.h> #include <eel/eel-glib-extensions.h> #include <eel/eel-gtk-extensions.h> #include <eel/eel-gtk-macros.h> @@ -122,6 +123,8 @@ static void nautilus_sidebar_drag_data_received (GtkWidget *widget static void nautilus_sidebar_read_theme (NautilusSidebar *sidebar); static void nautilus_sidebar_size_allocate (GtkWidget *widget, GtkAllocation *allocation); +static void nautilus_sidebar_style_set (GtkWidget *widget, + GtkStyle *previous_style); static void nautilus_sidebar_theme_changed (gpointer user_data); static void nautilus_sidebar_confirm_trash_changed (gpointer user_data); static void nautilus_sidebar_update_appearance (NautilusSidebar *sidebar); @@ -200,6 +203,7 @@ nautilus_sidebar_class_init (GtkObjectClass *object_klass) widget_class->button_press_event = nautilus_sidebar_press_event; widget_class->button_release_event = nautilus_sidebar_release_event; widget_class->size_allocate = nautilus_sidebar_size_allocate; + widget_class->style_set = nautilus_sidebar_style_set; /* add the "location changed" signal */ signals[LOCATION_CHANGED] = g_signal_new @@ -1706,6 +1710,22 @@ nautilus_sidebar_size_allocate (GtkWidget *widget, } } +/* ::style_set handler for the sidebar */ +static void +nautilus_sidebar_style_set (GtkWidget *widget, GtkStyle *previous_style) +{ + NautilusSidebar *sidebar; + GtkStyle *style; + + sidebar = NAUTILUS_SIDEBAR (widget); + + style = gtk_widget_get_style (widget); + + /* This is slightly hackish */ + if (!EEL_IS_BACKGROUND_STYLE (style)) + nautilus_sidebar_theme_changed (sidebar); +} + void nautilus_sidebar_setup_width (NautilusSidebar *sidebar) { |