changeset 339:de1c2cd06fce

Rename user_specified_window_background and window_background_color to image.use_custom_border_color and image.border_color. Rename pref_background_color_set_cb() to pref_color_button_set_cb(). Rename pref_colorbutton_new() to pref_color_button_new().
author zas_
date Sat, 12 Apr 2008 21:38:55 +0000
parents 41c3cb73120f
children 77103f3f2cb1
files src/fullscreen.c src/globals.c src/img-view.c src/layout.c src/layout_image.c src/preferences.c src/rcfile.c src/typedefs.h src/ui_misc.c src/ui_misc.h
diffstat 10 files changed, 34 insertions(+), 37 deletions(-) [+]
line wrap: on
line diff
--- a/src/fullscreen.c	Sat Apr 12 19:33:59 2008 +0000
+++ b/src/fullscreen.c	Sat Apr 12 21:38:55 2008 +0000
@@ -289,9 +289,9 @@
 
 	gtk_container_add(GTK_CONTAINER(fs->window), fs->imd->widget);
 
-	if (options->user_specified_window_background)
+	if (options->image.use_custom_border_color)
 		{
-		image_background_set_color(fs->imd, &options->window_background_color);
+		image_background_set_color(fs->imd, &options->image.border_color);
 		}
 
 	image_set_delay_flip(fs->imd, options->fullscreen.clean_flip);
--- a/src/globals.c	Sat Apr 12 19:33:59 2008 +0000
+++ b/src/globals.c	Sat Apr 12 21:38:55 2008 +0000
@@ -97,8 +97,8 @@
 	
 	options->place_dialogs_under_mouse = FALSE;
 	
-	options->user_specified_window_background = FALSE;
-	memset(&options->window_background_color, 0, sizeof(options->window_background_color));
+	options->image.use_custom_border_color = FALSE;
+	memset(&options->image.border_color, 0, sizeof(options->image.border_color));
 	
 	options->fullscreen.screen = -1;
 	options->fullscreen.clean_flip = FALSE;
--- a/src/img-view.c	Sat Apr 12 19:33:59 2008 +0000
+++ b/src/img-view.c	Sat Apr 12 21:38:55 2008 +0000
@@ -855,7 +855,7 @@
 
 	vw->imd = image_new(FALSE);
 
-	image_background_set_color(vw->imd, options->user_specified_window_background ? &options->window_background_color : NULL);
+	image_background_set_color(vw->imd, options->image.use_custom_border_color ? &options->image.border_color : NULL);
 
 	image_attach_window(vw->imd, vw->window, NULL, GQ_APPNAME, TRUE);
 
@@ -1011,7 +1011,7 @@
 		ViewWindow *vw = work->data;
 		work = work->next;
 
-		image_background_set_color(vw->imd, options->user_specified_window_background ? &options->window_background_color : NULL);
+		image_background_set_color(vw->imd, options->image.use_custom_border_color ? &options->image.border_color : NULL);
 		}
 }
 
--- a/src/layout.c	Sat Apr 12 19:33:59 2008 +0000
+++ b/src/layout.c	Sat Apr 12 21:38:55 2008 +0000
@@ -1719,7 +1719,7 @@
 		work = work->next;
 		
 		if (!lw->image) continue;
-		image_background_set_color(lw->image, options->user_specified_window_background ? &options->window_background_color : NULL);
+		image_background_set_color(lw->image, options->image.use_custom_border_color ? &options->image.border_color : NULL);
 		}
 }
 
--- a/src/layout_image.c	Sat Apr 12 19:33:59 2008 +0000
+++ b/src/layout_image.c	Sat Apr 12 21:38:55 2008 +0000
@@ -1698,7 +1698,7 @@
 
 		gtk_widget_ref(lw->split_images[i]->widget);
 
-		image_background_set_color(lw->split_images[i], options->user_specified_window_background ? &options->window_background_color : NULL);
+		image_background_set_color(lw->split_images[i], options->image.use_custom_border_color ? &options->image.border_color : NULL);
 
 		image_auto_refresh(lw->split_images[i], 0);
 
--- a/src/preferences.c	Sat Apr 12 19:33:59 2008 +0000
+++ b/src/preferences.c	Sat Apr 12 21:38:55 2008 +0000
@@ -233,11 +233,11 @@
 
 	options->image.enable_read_ahead = c_options->image.enable_read_ahead;
 
-	if (options->user_specified_window_background != c_options->user_specified_window_background
-	    || !gdk_color_equal(&options->window_background_color, &c_options->window_background_color))
+	if (options->image.use_custom_border_color != c_options->image.use_custom_border_color
+	    || !gdk_color_equal(&options->image.border_color, &c_options->image.border_color))
 		{
-		options->user_specified_window_background = c_options->user_specified_window_background;
-		options->window_background_color = c_options->window_background_color;
+		options->image.use_custom_border_color = c_options->image.use_custom_border_color;
+		options->image.border_color = c_options->image.border_color;
 		layout_colors_update();
 		view_window_colors_update();
 		}
@@ -919,11 +919,11 @@
 
 	group = pref_group_new(vbox, FALSE, _("Appearance"), GTK_ORIENTATION_VERTICAL);
 
-	pref_checkbox_new_int(group, _("User specified background color"),
-			      options->user_specified_window_background, &c_options->user_specified_window_background);
+	pref_checkbox_new_int(group, _("Custom border color"),
+			      options->image.use_custom_border_color, &c_options->image.use_custom_border_color);
 
-	pref_colorbutton_new(group, _("Background color"), &options->window_background_color,
-			     G_CALLBACK(pref_background_color_set_cb), &c_options->window_background_color);
+	pref_color_button_new(group, _("Border color"), &options->image.border_color,
+			      G_CALLBACK(pref_color_button_set_cb), &c_options->image.border_color);
 
 	group = pref_group_new(vbox, FALSE, _("Convenience"), GTK_ORIENTATION_VERTICAL);
 
--- a/src/rcfile.c	Sat Apr 12 19:33:59 2008 +0000
+++ b/src/rcfile.c	Sat Apr 12 21:38:55 2008 +0000
@@ -303,11 +303,7 @@
 	write_bool_option(ssi, "in_place_rename", options->enable_in_place_rename);
 	write_int_option(ssi, "open_recent_max", options->recent_list_max);
 	write_bool_option(ssi, "display_dialogs_under_mouse", options->place_dialogs_under_mouse);
-	secure_fputc(ssi, '\n');
-
-	write_bool_option(ssi, "user_specified_window_background", options->user_specified_window_background);
-	write_color_option(ssi, "window_background_color", &options->window_background_color);
-
+	
 
 	secure_fprintf(ssi, "\n##### Layout Options #####\n\n");
 
@@ -364,6 +360,8 @@
 	write_int_option(ssi, "image.dither_quality", options->image.dither_quality);
 	write_bool_option(ssi, "image.enable_read_ahead", options->image.enable_read_ahead);
 	write_bool_option(ssi, "image.exif_rotate_enable", options->image.exif_rotate_enable);
+	write_bool_option(ssi, "image.use_custom_border_color", options->image.use_custom_border_color);
+	write_color_option(ssi, "image.border_color", &options->image.border_color);
 
 
 	secure_fprintf(ssi, "\n##### Thumbnails Options #####\n\n");
@@ -642,6 +640,10 @@
 			"image.enable_read_ahead", value, options->image.enable_read_ahead);
 		options->image.exif_rotate_enable = read_bool_option(f, option,
 			"image.exif_rotate_enable", value, options->image.exif_rotate_enable);
+		options->image.use_custom_border_color = read_bool_option(f, option,
+			"image.use_custom_border_color", value, options->image.use_custom_border_color);
+		read_color_option(f, option,
+			"image.border_color", value, &options->image.border_color);
 
 		options->progressive_key_scrolling = read_bool_option(f, option,
 			"progressive_keyboard_scrolling", value, options->progressive_key_scrolling);
@@ -702,11 +704,6 @@
 		options->place_dialogs_under_mouse = read_bool_option(f, option,
 			"display_dialogs_under_mouse", value, options->place_dialogs_under_mouse);
 
-		options->user_specified_window_background = read_bool_option(f, option,
-			"user_specified_window_background", value, options->user_specified_window_background);
-		read_color_option(f, option,
-			"window_background_color", value, &options->window_background_color);
-
 		options->fullscreen.screen = read_int_option(f, option,
 			"fullscreen.screen", value, options->fullscreen.screen);
 		options->fullscreen.clean_flip = read_bool_option(f, option,
--- a/src/typedefs.h	Sat Apr 12 19:33:59 2008 +0000
+++ b/src/typedefs.h	Sat Apr 12 21:38:55 2008 +0000
@@ -778,11 +778,11 @@
 		gint zoom_to_fit_allow_expand;
 		gint zoom_quality;
 		gint zoom_increment;	/* 10 is 1.0, 5 is 0.05, 20 is 2.0, etc. */
+
+		gint use_custom_border_color;
+		GdkColor border_color;
 	} image;
 
-	gint user_specified_window_background;
-	GdkColor window_background_color;
-
 	/* thumbnails */
 	struct {
 		gint max_width;
--- a/src/ui_misc.c	Sat Apr 12 19:33:59 2008 +0000
+++ b/src/ui_misc.c	Sat Apr 12 21:38:55 2008 +0000
@@ -1614,16 +1614,16 @@
 }
 
 
-void pref_background_color_set_cb(GtkWidget *widget, gpointer data)
+void pref_color_button_set_cb(GtkWidget *widget, gpointer data)
 {
 	GdkColor *color = data;
 
 	gtk_color_button_get_color(GTK_COLOR_BUTTON(widget), color);
 }
 
-GtkWidget *pref_colorbutton_new(GtkWidget *parent_box,
-				const gchar *title, const GdkColor *color,
-				GCallback func, gpointer data)
+GtkWidget *pref_color_button_new(GtkWidget *parent_box,
+				 const gchar *title, const GdkColor *color,
+				 GCallback func, gpointer data)
 {
 	GtkWidget *button;
 	
--- a/src/ui_misc.h	Sat Apr 12 19:33:59 2008 +0000
+++ b/src/ui_misc.h	Sat Apr 12 21:38:55 2008 +0000
@@ -179,10 +179,10 @@
 gint pref_list_string_get(const gchar *group, const gchar *key, const gchar **result);
 
 
-void pref_background_color_set_cb(GtkWidget *widget, gpointer data);
-GtkWidget *pref_colorbutton_new(GtkWidget *parent_box,
-				const gchar *title, const GdkColor *color,
-				GCallback func, gpointer data);
+void pref_color_button_set_cb(GtkWidget *widget, gpointer data);
+GtkWidget *pref_color_button_new(GtkWidget *parent_box,
+			 	 const gchar *title, const GdkColor *color,
+			 	 GCallback func, gpointer data);
 
 
 #endif