Switched palette type selection and color conversion helpers to use the HAVE_GTK3 guard consistently in palette definitions and helpers.

Updated GTK3-specific palette color storage handling in DCC, notify, and user list views to align with HAVE_GTK3 guards.
Standardized setup color application and dialog logic to use HAVE_GTK3 branches for GTK3/GTK2 separation.
This commit is contained in:
2026-01-31 13:38:05 -07:00
parent d314856f82
commit 1fb1865aca
6 changed files with 18 additions and 18 deletions

View File

@@ -38,7 +38,7 @@
#include "../common/cfgfiles.h"
#include "../common/typedef.h"
#if GTK_CHECK_VERSION(3,0,0)
#if HAVE_GTK3
#define PALETTE_COLOR_INIT(r, g, b) { (r) / 65535.0, (g) / 65535.0, (b) / 65535.0, 1.0 }
#else
#define PALETTE_COLOR_INIT(r, g, b) { 0, (r), (g), (b) }
@@ -47,7 +47,7 @@
static void
palette_color_set_rgb16 (PaletteColor *color, guint16 red, guint16 green, guint16 blue)
{
#if GTK_CHECK_VERSION(3,0,0)
#if HAVE_GTK3
char color_string[16];
GdkRGBA parsed = { 0 };
gboolean parsed_ok;
@@ -82,7 +82,7 @@ palette_color_from_gdk (const PaletteColor *color)
{
XTextColor result;
#if GTK_CHECK_VERSION(3,0,0)
#if HAVE_GTK3
result.red = color->red;
result.green = color->green;
result.blue = color->blue;
@@ -227,7 +227,7 @@ palette_user_set_color (int idx, const PaletteColor *col)
user_colors_valid = TRUE;
}
#if GTK_CHECK_VERSION(3,0,0)
#if HAVE_GTK3
user_colors[idx] = *col;
#else
user_colors[idx].red = col->red;
@@ -252,7 +252,7 @@ palette_dark_set_color (int idx, const PaletteColor *col)
dark_user_colors_valid = TRUE;
}
#if GTK_CHECK_VERSION(3,0,0)
#if HAVE_GTK3
dark_user_colors[idx] = *col;
#else
dark_user_colors[idx].red = col->red;