Move some defines from main-defines to modules
authorArkadiy Illarionov <qarkai@gmail.com>
Sun, 7 Apr 2024 13:10:51 +0000 (16:10 +0300)
committerColin Clark <colin.clark@cclark.uk>
Sun, 7 Apr 2024 15:43:22 +0000 (16:43 +0100)
Convert to constants.

src/bar.cc
src/layout-image.cc
src/main-defines.h
src/options.cc

index 6c396b3..ead7271 100644 (file)
 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
 {
index 1bf3746..3d0c44c 100644 (file)
 #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);
index 9245ace..df1105b 100644 (file)
 
 #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:<i>*</i>\\n%" \
                                "(%number%/%total%) [%zoom%] <b>%name%</b>\n" \
index 23ab144..063d9f6 100644 (file)
 #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;