mirror of
https://github.com/ZoiteChat/zoitechat.git
synced 2026-03-16 18:50:19 +00:00
Removed GTK2/GTK3 dual-path preprocessor branches across src/fe-gtk by keeping GTK3-native paths only, including the high-density targets you prioritized (xtext.c, setup.c, maingui.c, gtkutil.c, servlistgui.c).
Removed GTK2 compatibility shims from headers (fe-gtk.h, gtkutil.h), leaving direct GTK3-facing declarations/includes only (and platform-specific guards unrelated to GTK2 kept as-is). Cleaned GTK2-specific comments/wording now that behavior is GTK3-native (menu accelerator note and emoji/userlist comment blocks).
This commit is contained in:
@@ -38,16 +38,11 @@
|
||||
#include "../common/cfgfiles.h"
|
||||
#include "../common/typedef.h"
|
||||
|
||||
#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) }
|
||||
#endif
|
||||
|
||||
static void
|
||||
palette_color_set_rgb16 (PaletteColor *color, guint16 red, guint16 green, guint16 blue)
|
||||
{
|
||||
#if HAVE_GTK3
|
||||
char color_string[16];
|
||||
GdkRGBA parsed = { 0 };
|
||||
gboolean parsed_ok;
|
||||
@@ -63,18 +58,6 @@ palette_color_set_rgb16 (PaletteColor *color, guint16 red, guint16 green, guint1
|
||||
parsed.alpha = 1.0;
|
||||
}
|
||||
*color = parsed;
|
||||
#else
|
||||
char color_string[16];
|
||||
|
||||
g_snprintf (color_string, sizeof (color_string), "#%04x%04x%04x", red, green, blue);
|
||||
if (!gdk_color_parse (color_string, color))
|
||||
{
|
||||
color->red = red;
|
||||
color->green = green;
|
||||
color->blue = blue;
|
||||
color->pixel = 0;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
static XTextColor
|
||||
@@ -82,17 +65,10 @@ palette_color_from_gdk (const PaletteColor *color)
|
||||
{
|
||||
XTextColor result;
|
||||
|
||||
#if HAVE_GTK3
|
||||
result.red = color->red;
|
||||
result.green = color->green;
|
||||
result.blue = color->blue;
|
||||
result.alpha = color->alpha;
|
||||
#else
|
||||
result.red = color->red / 65535.0;
|
||||
result.green = color->green / 65535.0;
|
||||
result.blue = color->blue / 65535.0;
|
||||
result.alpha = 1.0;
|
||||
#endif
|
||||
|
||||
return result;
|
||||
}
|
||||
@@ -227,14 +203,7 @@ palette_user_set_color (int idx, const PaletteColor *col)
|
||||
user_colors_valid = TRUE;
|
||||
}
|
||||
|
||||
#if HAVE_GTK3
|
||||
user_colors[idx] = *col;
|
||||
#else
|
||||
user_colors[idx].red = col->red;
|
||||
user_colors[idx].green = col->green;
|
||||
user_colors[idx].blue = col->blue;
|
||||
user_colors[idx].pixel = 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
@@ -252,14 +221,7 @@ palette_dark_set_color (int idx, const PaletteColor *col)
|
||||
dark_user_colors_valid = TRUE;
|
||||
}
|
||||
|
||||
#if HAVE_GTK3
|
||||
dark_user_colors[idx] = *col;
|
||||
#else
|
||||
dark_user_colors[idx].red = col->red;
|
||||
dark_user_colors[idx].green = col->green;
|
||||
dark_user_colors[idx].blue = col->blue;
|
||||
dark_user_colors[idx].pixel = 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
Reference in New Issue
Block a user