talons

Fork of Claws Mail https://www.claws-mail
Log | Files | Refs | README | LICENSE

commit 46d02cbde10d89eb792d4d6890435dfa48937fa4
parent a7ba50f94fe64fa156b8f63c74b9d151eb9413f5
Author: Oliver Lowe <o@olowe.co>
Date:   Sun, 24 Aug 2025 13:50:07 +1000

Delete unused image viewer prefs

No image viewer anymore

Diffstat:
Msrc/gtk/gtkutils.c | 107-------------------------------------------------------------------------------
Msrc/gtk/gtkutils.h | 4----
Msrc/prefs_common.c | 10----------
Msrc/prefs_common.h | 6------
4 files changed, 0 insertions(+), 127 deletions(-)

diff --git a/src/gtk/gtkutils.c b/src/gtk/gtkutils.c @@ -1450,113 +1450,6 @@ claws_input_add (gint source, return result; } -/** - * Load a pixbuf fitting inside the specified size. EXIF orientation is - * respected if available. - * - * @param[in] filename the file to load - * @param[in] box_width the max width (-1 for no resize) - * @param[in] box_height the max height (-1 for no resize) - * @param[out] error the possible load error - * - * @return a GdkPixbuf - */ -GdkPixbuf *claws_load_pixbuf_fitting(GdkPixbuf *src_pixbuf, gboolean inline_img, - gboolean fit_img_height, int box_width, int box_height) -{ - gint w, h, orientation, angle; - gint avail_width, avail_height; - gboolean flip_horiz, flip_vert; - const gchar *orient_str; - GdkPixbuf *pixbuf, *t_pixbuf; - - pixbuf = src_pixbuf; - - if (pixbuf == NULL) - return NULL; - - angle = 0; - flip_horiz = flip_vert = FALSE; - - /* EXIF orientation */ - orient_str = gdk_pixbuf_get_option(pixbuf, "orientation"); - if (orient_str != NULL && *orient_str != '\0') { - orientation = atoi(orient_str); - switch(orientation) { - /* See EXIF standard for different values */ - case 1: break; - case 2: flip_horiz = 1; - break; - case 3: angle = 180; - break; - case 4: flip_vert = 1; - break; - case 5: angle = 90; - flip_horiz = 1; - break; - case 6: angle = 270; - break; - case 7: angle = 90; - flip_vert = 1; - break; - case 8: angle = 90; - break; - } - } - - - /* Rotate if needed */ - if (angle != 0) { - t_pixbuf = gdk_pixbuf_rotate_simple(pixbuf, angle); - g_object_unref(pixbuf); - pixbuf = t_pixbuf; - } - - /* Flip horizontally if needed */ - if (flip_horiz) { - t_pixbuf = gdk_pixbuf_flip(pixbuf, TRUE); - g_object_unref(pixbuf); - pixbuf = t_pixbuf; - } - - /* Flip vertically if needed */ - if (flip_vert) { - t_pixbuf = gdk_pixbuf_flip(pixbuf, FALSE); - g_object_unref(pixbuf); - pixbuf = t_pixbuf; - } - - w = gdk_pixbuf_get_width(pixbuf); - h = gdk_pixbuf_get_height(pixbuf); - - avail_width = box_width-32; - avail_height = box_height; - - if (box_width != -1 && box_height != -1 && avail_width - 100 > 0) { - if (inline_img || fit_img_height) { - if (w > avail_width) { - h = (avail_width * h) / w; - w = avail_width; - } - if (h > avail_height) { - w = (avail_height * w) / h; - h = avail_height; - } - } else { - if (w > avail_width || h > avail_height) { - h = (avail_width * h) / w; - w = avail_width; - } - } - t_pixbuf = gdk_pixbuf_scale_simple(pixbuf, - w, h, GDK_INTERP_BILINEAR); - g_object_unref(pixbuf); - pixbuf = t_pixbuf; - } - - return pixbuf; -} - #if defined USE_GNUTLS static void auto_configure_done(const gchar *hostname, gint port, gboolean ssl, AutoConfigureData *data) { diff --git a/src/gtk/gtkutils.h b/src/gtk/gtkutils.h @@ -202,10 +202,6 @@ gboolean gtkut_list_view_select_row(GtkWidget *list, gint row); GtkUIManager *gtkut_create_ui_manager(void); GtkUIManager *gtkut_ui_manager(void); -GdkPixbuf *claws_load_pixbuf_fitting(GdkPixbuf *pixbuf, gboolean inline_img, - gboolean fit_img_height, - int box_width, int box_height); - GtkWidget *gtkut_time_select_combo_new(); void gtkut_time_select_select_by_time(GtkComboBox *combo, int hour, int minute); gboolean gtkut_time_select_get_time(GtkComboBox *combo, int *hour, int *minute); diff --git a/src/prefs_common.c b/src/prefs_common.c @@ -218,16 +218,6 @@ static PrefParam param[] = { {"quote_chars", ">", &prefs_common.quote_chars, P_STRING, NULL, NULL, NULL}, - /* image viewer */ - {"display_image", "TRUE", &prefs_common.display_img, P_BOOL, - NULL, NULL, NULL}, - {"resize_image", "TRUE", &prefs_common.resize_img, P_BOOL, - NULL, NULL, NULL}, - {"inline_image", "TRUE", &prefs_common.inline_img, P_BOOL, - NULL, NULL, NULL}, - {"fit_image_height", "TRUE", &prefs_common.fit_img_height, P_BOOL, - NULL, NULL, NULL}, - {"display_folder_unread_num", "0", &prefs_common.display_folder_unread, P_INT, NULL, NULL, NULL}, diff --git a/src/prefs_common.h b/src/prefs_common.h @@ -215,12 +215,6 @@ struct _PrefsCommon /* program colors */ GdkRGBA color[COL_LAST_COLOR_INDEX]; - /* image viewer */ - gboolean display_img; - gboolean resize_img; - gboolean inline_img; - gboolean fit_img_height; - gboolean trans_hdr; gint display_folder_unread;