Skip to content

Commit 3d84ab3

Browse files
qarkaicaclark
authored andcommitted
Use GqSize for thumb_size_list
1 parent af186dd commit 3d84ab3

File tree

1 file changed

+23
-31
lines changed

1 file changed

+23
-31
lines changed

src/preferences.cc

Lines changed: 23 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@
5454
#include "filedata.h"
5555
#include "filefilter.h"
5656
#include "fullscreen.h"
57+
#include "gq-size.h"
5758
#include "image.h"
5859
#include "img-view.h"
5960
#include "intl.h"
@@ -88,6 +89,24 @@ namespace
8889
constexpr gint PRE_FORMATTED_COLUMNS = 5;
8990
constexpr gint KEYWORD_DIALOG_WIDTH = 400;
9091

92+
constexpr GqSize thumb_size_list[] =
93+
{
94+
{ 24, 24 },
95+
{ 32, 32 },
96+
{ 48, 48 },
97+
{ 64, 64 },
98+
{ 96, 72 },
99+
{ 96, 96 },
100+
{ 128, 96 },
101+
{ 128, 128 },
102+
{ 160, 120 },
103+
{ 160, 160 },
104+
{ 192, 144 },
105+
{ 192, 192 },
106+
{ 256, 192 },
107+
{ 256, 256 },
108+
};
109+
91110
struct TZData
92111
{
93112
GenericDialog *gd;
@@ -121,30 +140,6 @@ static void image_overlay_set_text_colors(gint i);
121140
static GtkWidget *keyword_text;
122141
static void config_tab_keywords_save();
123142

124-
struct ThumbSize
125-
{
126-
gint w;
127-
gint h;
128-
};
129-
130-
static ThumbSize thumb_size_list[] =
131-
{
132-
{ 24, 24 },
133-
{ 32, 32 },
134-
{ 48, 48 },
135-
{ 64, 64 },
136-
{ 96, 72 },
137-
{ 96, 96 },
138-
{ 128, 96 },
139-
{ 128, 128 },
140-
{ 160, 120 },
141-
{ 160, 160 },
142-
{ 192, 144 },
143-
{ 192, 192 },
144-
{ 256, 192 },
145-
{ 256, 256 }
146-
};
147-
148143
enum {
149144
FE_ENABLE,
150145
FE_EXTENSION,
@@ -856,8 +851,8 @@ static void thumb_size_menu_cb(GtkWidget *combo, gpointer)
856851

857852
if (static_cast<guint>(n) < G_N_ELEMENTS(thumb_size_list))
858853
{
859-
c_options->thumbnails.max_width = thumb_size_list[n].w;
860-
c_options->thumbnails.max_height = thumb_size_list[n].h;
854+
c_options->thumbnails.max_width = thumb_size_list[n].width;
855+
c_options->thumbnails.max_height = thumb_size_list[n].height;
861856
}
862857
else
863858
{
@@ -882,11 +877,8 @@ static void add_thumb_size_menu(GtkWidget *table, gint column, gint row, gchar *
882877
current = -1;
883878
for (i = 0; static_cast<guint>(i) < G_N_ELEMENTS(thumb_size_list); i++)
884879
{
885-
gint w;
886-
gint h;
887-
888-
w = thumb_size_list[i].w;
889-
h = thumb_size_list[i].h;
880+
const int w = thumb_size_list[i].width;
881+
const int h = thumb_size_list[i].height;
890882

891883
g_autofree gchar *buf = g_strdup_printf("%d x %d", w, h);
892884
gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(combo), buf);

0 commit comments

Comments
 (0)