# HG changeset patch # User zas_ # Date 1244145080 0 # Node ID 1d7941c147be5b4e397b4b156cf6bf0baeb39966 # Parent d00761ba18bd46758672a3808719aa73ba5dbc69 Add an option to Image preferences to restrict custom border to fullscreen mode only. Bug 2798062. diff -r d00761ba18bd -r 1d7941c147be src/fullscreen.c --- a/src/fullscreen.c Thu Jun 04 16:07:41 2009 +0000 +++ b/src/fullscreen.c Thu Jun 04 19:51:20 2009 +0000 @@ -291,11 +291,7 @@ gtk_container_add(GTK_CONTAINER(fs->window), fs->imd->widget); - if (options->image.use_custom_border_color) - { - image_background_set_color(fs->imd, &options->image.border_color); - } - + image_background_set_color_from_options(fs->imd, TRUE); image_set_delay_flip(fs->imd, options->fullscreen.clean_flip); image_auto_refresh_enable(fs->imd, fs->normal_imd->auto_refresh); diff -r d00761ba18bd -r 1d7941c147be src/image.c --- a/src/image.c Thu Jun 04 16:07:41 2009 +0000 +++ b/src/image.c Thu Jun 04 19:51:20 2009 +0000 @@ -1463,6 +1463,19 @@ pixbuf_renderer_set_color((PixbufRenderer *)imd->pr, color); } +void image_background_set_color_from_options(ImageWindow *imd, gboolean fullscreen) +{ + GdkColor *color = NULL; + + if (options->image.use_custom_border_color + && (!options->image.custom_border_fullscreen_only || fullscreen)) + { + color = &options->image.border_color; + } + + image_background_set_color(imd, color); +} + void image_color_profile_set(ImageWindow *imd, gint input_type, gboolean use_image) diff -r d00761ba18bd -r 1d7941c147be src/image.h --- a/src/image.h Thu Jun 04 16:07:41 2009 +0000 +++ b/src/image.h Thu Jun 04 19:51:20 2009 +0000 @@ -102,6 +102,7 @@ /* background of image */ void image_background_set_color(ImageWindow *imd, GdkColor *color); +void image_background_set_color_from_options(ImageWindow *imd, gboolean fullscreen); /* color profiles */ void image_color_profile_set(ImageWindow *imd, diff -r d00761ba18bd -r 1d7941c147be src/img-view.c --- a/src/img-view.c Thu Jun 04 16:07:41 2009 +0000 +++ b/src/img-view.c Thu Jun 04 19:51:20 2009 +0000 @@ -848,7 +848,7 @@ vw->imd = image_new(FALSE); - image_background_set_color(vw->imd, options->image.use_custom_border_color ? &options->image.border_color : NULL); + image_background_set_color_from_options(vw->imd, FALSE); image_attach_window(vw->imd, vw->window, NULL, GQ_APPNAME, TRUE); @@ -1002,8 +1002,8 @@ { ViewWindow *vw = work->data; work = work->next; - - image_background_set_color(vw->imd, options->image.use_custom_border_color ? &options->image.border_color : NULL); + + image_background_set_color_from_options(vw->imd, !!vw->fs); } } diff -r d00761ba18bd -r 1d7941c147be src/layout.c --- a/src/layout.c Thu Jun 04 16:07:41 2009 +0000 +++ b/src/layout.c Thu Jun 04 19:51:20 2009 +0000 @@ -1611,11 +1611,19 @@ work = layout_window_list; while (work) { + gint i; LayoutWindow *lw = work->data; work = work->next; - + if (!lw->image) continue; - image_background_set_color(lw->image, options->image.use_custom_border_color ? &options->image.border_color : NULL); + + for (i = 0; i < MAX_SPLIT_IMAGES; i++) + { + if (!lw->split_images[i]) continue; + image_background_set_color_from_options(lw->split_images[i], !!lw->full_screen); + } + + image_background_set_color_from_options(lw->image, !!lw->full_screen); } } diff -r d00761ba18bd -r 1d7941c147be src/layout_image.c --- a/src/layout_image.c Thu Jun 04 16:07:41 2009 +0000 +++ b/src/layout_image.c Thu Jun 04 19:51:20 2009 +0000 @@ -1610,7 +1610,7 @@ g_signal_connect(G_OBJECT(lw->split_images[i]->pr), "update-pixel", G_CALLBACK(layout_status_update_pixel_cb), lw); - image_background_set_color(lw->split_images[i], options->image.use_custom_border_color ? &options->image.border_color : NULL); + image_background_set_color_from_options(lw->split_images[i], FALSE); image_auto_refresh_enable(lw->split_images[i], TRUE); diff -r d00761ba18bd -r 1d7941c147be src/options.c --- a/src/options.c Thu Jun 04 16:07:41 2009 +0000 +++ b/src/options.c Thu Jun 04 19:51:20 2009 +0000 @@ -75,6 +75,7 @@ options->image.tile_cache_max = 10; options->image.image_cache_max = 128; /* 4 x 10MPix */ options->image.use_custom_border_color = FALSE; + options->image.custom_border_fullscreen_only = FALSE; options->image.zoom_2pass = TRUE; options->image.zoom_increment = 5; options->image.zoom_mode = ZOOM_RESET_NONE; diff -r d00761ba18bd -r 1d7941c147be src/options.h --- a/src/options.h Thu Jun 04 16:07:41 2009 +0000 +++ b/src/options.h Thu Jun 04 19:51:20 2009 +0000 @@ -68,7 +68,8 @@ guint zoom_quality; gint zoom_increment; /* 10 is 1.0, 5 is 0.05, 20 is 2.0, etc. */ - gint use_custom_border_color; + gboolean custom_border_fullscreen_only; + gboolean use_custom_border_color; GdkColor border_color; } image; diff -r d00761ba18bd -r 1d7941c147be src/preferences.c --- a/src/preferences.c Thu Jun 04 16:07:41 2009 +0000 +++ b/src/preferences.c Thu Jun 04 19:51:20 2009 +0000 @@ -314,9 +314,12 @@ options->image.enable_read_ahead = c_options->image.enable_read_ahead; + if (options->image.use_custom_border_color != c_options->image.use_custom_border_color + || options->image.custom_border_fullscreen_only != c_options->image.custom_border_fullscreen_only || !gdk_color_equal(&options->image.border_color, &c_options->image.border_color)) { + options->image.custom_border_fullscreen_only = c_options->image.custom_border_fullscreen_only; 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(); @@ -1333,6 +1336,9 @@ pref_checkbox_new_int(group, _("Custom border color"), options->image.use_custom_border_color, &c_options->image.use_custom_border_color); + + pref_checkbox_new_int(group, _("Apply custom border to fullscreen mode only"), + options->image.custom_border_fullscreen_only, &c_options->image.custom_border_fullscreen_only); pref_color_button_new(group, _("Border color"), &options->image.border_color, G_CALLBACK(pref_color_button_set_cb), &c_options->image.border_color); diff -r d00761ba18bd -r 1d7941c147be src/rcfile.c --- a/src/rcfile.c Thu Jun 04 16:07:41 2009 +0000 +++ b/src/rcfile.c Thu Jun 04 19:51:20 2009 +0000 @@ -330,6 +330,7 @@ WRITE_NL(); WRITE_BOOL(*options, image.enable_read_ahead); WRITE_NL(); WRITE_BOOL(*options, image.exif_rotate_enable); WRITE_NL(); WRITE_BOOL(*options, image.use_custom_border_color); + WRITE_NL(); WRITE_BOOL(*options, image.custom_border_fullscreen_only); WRITE_NL(); WRITE_COLOR(*options, image.border_color); // WRITE_SUBTITLE("Thumbnails Options"); @@ -613,6 +614,7 @@ if (READ_BOOL(*options, image.enable_read_ahead)) continue; if (READ_BOOL(*options, image.exif_rotate_enable)) continue; if (READ_BOOL(*options, image.use_custom_border_color)) continue; + if (READ_BOOL(*options, image.custom_border_fullscreen_only)) continue; if (READ_COLOR(*options, image.border_color)) continue; /* thumbnails options */