From: Arkadiy Illarionov Date: Sun, 7 Apr 2024 13:10:51 +0000 (+0300) Subject: Move some defines from main-defines to modules X-Git-Url: http://geeqie.org/cgi-bin/gitweb.cgi?p=geeqie.git;a=commitdiff_plain;h=efcb9615e69cd13ef3a30fe00dc9fed710d79421 Move some defines from main-defines to modules Convert to constants. --- diff --git a/src/bar.cc b/src/bar.cc index 6c396b3b..ead72719 100644 --- a/src/bar.cc +++ b/src/bar.cc @@ -44,12 +44,14 @@ namespace { +constexpr gint SIDEBAR_DEFAULT_WIDTH = 250; + void remove_child_from_parent(gpointer data) { gtk_container_remove(GTK_CONTAINER(gtk_widget_get_parent(GTK_WIDGET(data))), GTK_WIDGET(data)); } -} +} // namespace struct KnownPanes { diff --git a/src/layout-image.cc b/src/layout-image.cc index 1bf37468..3d0c44ce 100644 --- a/src/layout-image.cc +++ b/src/layout-image.cc @@ -60,6 +60,13 @@ #include "utilops.h" #include "view-file.h" +namespace +{ + +constexpr gint IMAGE_MIN_WIDTH = 100; + +} // namespace + static GtkWidget *layout_image_pop_menu(LayoutWindow *lw); static void layout_image_set_buttons(LayoutWindow *lw); static gboolean layout_image_animate_new_file(LayoutWindow *lw); diff --git a/src/main-defines.h b/src/main-defines.h index 9245aced..df1105b4 100644 --- a/src/main-defines.h +++ b/src/main-defines.h @@ -45,24 +45,20 @@ #define GQ_COLLECTION_EXT ".gqv" +// @todo Merge with PixbufRendererScrollResetType ? #define SCROLL_RESET_TOPLEFT 0 #define SCROLL_RESET_CENTER 1 #define SCROLL_RESET_NOCHANGE 2 +// @todo Deduplicate mousewheel_scrolls processing #define MOUSEWHEEL_SCROLL_SIZE 20 #define GQ_DEFAULT_SHELL_PATH "/bin/sh" #define GQ_DEFAULT_SHELL_OPTIONS "-c" -#define DEFAULT_THUMB_WIDTH 96 -#define DEFAULT_THUMB_HEIGHT 72 - #define DEFAULT_MINIMAL_WINDOW_SIZE 100 -#define IMAGE_MIN_WIDTH 100 -#define SIDEBAR_DEFAULT_WIDTH 250 - #define DEFAULT_OVERLAY_INFO "%collection:*\\n%" \ "(%number%/%total%) [%zoom%] %name%\n" \ diff --git a/src/options.cc b/src/options.cc index 23ab1444..063d9f65 100644 --- a/src/options.cc +++ b/src/options.cc @@ -35,6 +35,14 @@ #include "ui-bookmark.h" #include "ui-fileops.h" +namespace +{ + +constexpr gint DEFAULT_THUMB_WIDTH = 96; +constexpr gint DEFAULT_THUMB_HEIGHT = 72; + +} // namespace + ConfOptions *options; CommandLine *command_line; @@ -185,8 +193,8 @@ ConfOptions *init_options(ConfOptions *options) options->thumbnails.cache_into_dirs = FALSE; options->thumbnails.enable_caching = TRUE; - options->thumbnails.max_height = DEFAULT_THUMB_HEIGHT; options->thumbnails.max_width = DEFAULT_THUMB_WIDTH; + options->thumbnails.max_height = DEFAULT_THUMB_HEIGHT; options->thumbnails.quality = GDK_INTERP_TILES; options->thumbnails.spec_standard = TRUE; options->thumbnails.use_xvpics = TRUE;