From 50a77ed0dd239e327ef7d50a4baa1305d0dbafaf Mon Sep 17 00:00:00 2001 From: Thomas Leonard Date: Thu, 11 Apr 2002 13:30:41 +0000 Subject: [PATCH] r1385: Moved default style into program. --- ROX-Filer/Styles | 19 ---------------- ROX-Filer/src/collection.c | 53 ++++----------------------------------------- ROX-Filer/src/gui_support.c | 21 ++++++++---------- ROX-Filer/src/main.c | 2 +- 4 files changed, 14 insertions(+), 81 deletions(-) delete mode 100644 ROX-Filer/Styles diff --git a/ROX-Filer/Styles b/ROX-Filer/Styles deleted file mode 100644 index 555ac35e..00000000 --- a/ROX-Filer/Styles +++ /dev/null @@ -1,19 +0,0 @@ -style "filer" -{ - bg[NORMAL] = { 0.95, 0.95, 0.95} - fg[NORMAL] = { 0.0, 0.0, 0.0 } - /* - * Used for selected items when the filer does NOT own - * the primary selection. - */ - bg[INSENSITIVE] = { 0.75, 0.75, 0.75 } - fg[INSENSITIVE] = { 0.0, 0.0, 0.0 } -} - -style "fixed" -{ - fontset = "fixed" -} - -class "Collection" style "filer" -widget "*.fixed-style" style "fixed" diff --git a/ROX-Filer/src/collection.c b/ROX-Filer/src/collection.c index 7db3da8c..3b47eccd 100644 --- a/ROX-Filer/src/collection.c +++ b/ROX-Filer/src/collection.c @@ -217,10 +217,6 @@ static void collection_class_init(GObjectClass *gclass, gpointer data) widget_class->map = collection_map; widget_class->scroll_event = collection_scroll_event; -#if 0 - widget_class->style_set = collection_set_style; /* XXX: Test for 2.0 */ -#endif - gclass->set_property = collection_set_property; gclass->get_property = collection_get_property; @@ -404,17 +400,6 @@ static void collection_map(GtkWidget *widget) } } -static GdkGC *create_bg_gc(GtkWidget *widget) -{ - GdkGCValues values; - - values.tile = widget->style->bg_pixmap[GTK_STATE_NORMAL]; - values.fill = GDK_TILED; - - return gdk_gc_new_with_values(widget->window, &values, - GDK_GC_FILL | GDK_GC_TILE); -} - static void collection_realize(GtkWidget *widget) { Collection *collection; @@ -453,11 +438,6 @@ static void collection_realize(GtkWidget *widget) gdk_window_set_user_data(widget->window, widget); - gdk_window_set_background(widget->window, - &widget->style->bg[GTK_STATE_NORMAL]); - if (widget->style->bg_pixmap[GTK_STATE_NORMAL]) - collection->bg_gc = create_bg_gc(widget); - bg = &widget->style->bg[GTK_STATE_NORMAL]; fg = &widget->style->fg[GTK_STATE_NORMAL]; xor_values.function = GDK_XOR; @@ -547,35 +527,6 @@ static void collection_size_allocate(GtkWidget *widget, } } -#if 0 -static void collection_set_style(GtkWidget *widget, - GtkStyle *previous_style) -{ - Collection *collection; - - g_return_if_fail(IS_COLLECTION(widget)); - - collection = COLLECTION(widget); - - collection->paint_level = PAINT_CLEAR; - - if (GTK_WIDGET_REALIZED(widget)) - { - gdk_window_set_background(widget->window, - &widget->style->bg[GTK_STATE_NORMAL]); - - if (collection->bg_gc) - { - gdk_gc_destroy(collection->bg_gc); - collection->bg_gc = NULL; - } - - if (widget->style->bg_pixmap[GTK_STATE_NORMAL]) - collection->bg_gc = create_bg_gc(widget); - } -} -#endif - /* Return the area occupied by the item at (row, col) by filling * in 'area'. */ @@ -607,6 +558,10 @@ static gint collection_expose(GtkWidget *widget, GdkEventExpose *event) g_return_val_if_fail(IS_COLLECTION(widget), FALSE); g_return_val_if_fail(event != NULL, FALSE); + gtk_paint_flat_box(widget->style, widget->window, GTK_STATE_NORMAL, + GTK_SHADOW_NONE, &event->area, + widget, "base", 0, 0, -1, -1); + collection = COLLECTION(widget); /* Calculate the ranges to plot */ diff --git a/ROX-Filer/src/gui_support.c b/ROX-Filer/src/gui_support.c index 73fbe35c..b4bd8729 100644 --- a/ROX-Filer/src/gui_support.c +++ b/ROX-Filer/src/gui_support.c @@ -698,18 +698,15 @@ gboolean rox_spawn(const gchar *dir, const gchar **argv) */ void add_default_styles(void) { - gchar *rc_file; - - rc_file = g_strconcat(app_dir, "/Styles", NULL); - gtk_rc_add_default_file(rc_file); - g_free(rc_file); - - rc_file = choices_find_path_load("Styles", PROJECT); - if (rc_file) - { - gtk_rc_add_default_file(rc_file); - g_free(rc_file); - } + gtk_rc_parse_string("style \"rox-default-collection-style\" {\n" + " bg[NORMAL] = \"#f3f3f3\"\n" + " fg[NORMAL] = \"#000000\"\n" + " bg[INSENSITIVE] = \"#bfbfbf\"\n" + " fg[INSENSITIVE] = \"#000000\"\n" + "}\n" + "\n" + "class \"Collection\" style : " + "gtk \"rox-default-collection-style\"\n"); } GtkWidget *button_new_mixed(const char *stock, const char *message) diff --git a/ROX-Filer/src/main.c b/ROX-Filer/src/main.c index e4ff4157..df5db71c 100644 --- a/ROX-Filer/src/main.c +++ b/ROX-Filer/src/main.c @@ -268,8 +268,8 @@ int main(int argc, char **argv) /* Note: must do this before checking our options, * otherwise we report an error for Gtk's options. */ - add_default_styles(); gtk_init(&argc, &argv); + add_default_styles(); /* Process each option in turn */ while (1) -- 2.11.4.GIT