Commit Graph

90 Commits

Author SHA1 Message Date
50346683a1 feat: GTK3-only theming overhaul—new theme service (discover/import/inherits), layered CSS+settings.ini apply w/ safe rollback + caching; widget/xtext palette mapping + all-colors editor; lots of win32/CI libarchive plumbing + installer assets; 2026-03-04 23:28:01 -07:00
d9be0a7b1c feat: centralize theming in theme-manager (palette/tokens, CSS, dark-mode, setup UI), add tests + win32/meson wiring 2026-03-02 19:42:48 -07:00
5983befd5b icons: add system_icon_name API, make gtkutil fall back via resolver registry 2026-03-01 10:14:41 -07:00
e63e68dfde icons: dedupe resolver tables, add unified menu-action API, route gtkutil/pixmaps through one registry + fallback chain 2026-03-01 09:58:04 -07:00
395ccb0706 gtk: centralize icon lookup (new icon-resolver), move mappings out of gtkutil/pixmaps, add sane fallback chain + meson hookup 2026-02-28 23:17:27 -07:00
50d99e1314 userlist highlight: focusable treeview + palette CSS gets real :selected theme colors 2026-02-27 09:28:44 -07:00
3e095c3c33 Removed two redundant inline comments in the file dialog response/done handlers, leaving the behavior unchanged and the control flow cleaner.
Removed an old commented-out helper function block (gtkutil_treeview_get_selected_iter) that was dead/commented code.
2026-02-25 18:07:26 -07:00
4b188192f8 Removed GTK2 compatibility shims from fe-gtk.h by deleting the local HAVE_GTK3 fallback derivation, deleting GTK2 no-op wrappers for expansion APIs, and making InputStyle GTK3-only.
Simplified the Windows theme block in fe-gtk.c from a GTK3-conditional compile guard to a direct Windows guard (#ifdef G_OS_WIN32), matching the GTK3-only codebase direction.

Simplified native file chooser guards in gtkutil.c from WIN32 && HAVE_GTK3 to #ifdef WIN32, removing remaining GTK3 compatibility-condition clutter in that file.
2026-02-22 15:27:28 -07:00
1c5bf9d6b1 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).
2026-02-22 15:11:35 -07:00
7568c73062 Updated the Network List Connect button icon on GTK3 to use the bundled zc-menu-connect asset, which avoids theme-dependent missing network-connect behavior.
Added a Help menu _Update entry with a dedicated zc-menu-update icon constant, so Windows builds can display an appropriate update icon in the Help menu.

    Extended icon mapping/fallback logic so emoji/update icons resolve correctly across stock/icon-name paths (zc-menu-emoji, zc-menu-update) including GTK2 stock fallback compatibility.

    Added zc-menu-emoji to the input entry fallback icon list so the emoji affordance has a deterministic built-in fallback when theme emoji icons are missing.

    Added new update and emoji icon assets in both SVG and PNG for light/dark variants, and registered the PNG resources in the gresource manifest for runtime loading.
2026-02-18 01:30:45 -07:00
6ce7de23a3 Switched menu resource loading to use bundled PNG assets (instead of SVG paths) for zc-menu-* icons, so menu icon resolution is consistent and no longer depends on SVG/icon-theme availability on different platforms (including Win32 builds).
Updated the GResource manifest so all menu icons now come from data/icons/menu/{light,dark} PNG files and are embedded with to-pixdata preprocessing, ensuring the app uses one unified internal icon set across platforms.

    Generated and added PNG assets for both light and dark menu icon variants under data/icons/menu/ to back the new resource paths used by the GTK menu code.

    Fixed menu icon resource detection to fall back from PNG to SVG when probing zc-menu-* entries, so menu item icon lookup no longer fails just because one format is unavailable at runtime.

    Updated GTK menu icon loading to use gdk_pixbuf_new_from_resource (instead of ..._at_scale) and added explicit fallback order across variant/light and PNG/SVG resources, which addresses the “red no-entry square” missing-icon behavior you reported.

    Kept compatibility with your previous menu resource setup while making loading more resilient on Win32 and other environments where resource/pixbuf behavior differs.
2026-02-18 01:16:03 -07:00
e214c76bdf Unified GTK3 menu icon resolution so menu-sized icons now consistently map to the bundled zc-menu-* icon set (from data/icons/menu) even when callers pass freedesktop icon names (like edit-copy, go-next) instead of legacy stock IDs. This removes the mixed behavior where some items came from system themes while others came from bundled resources.
Added a new icon-name→zc-menu-* mapping helper and wired it into gtkutil_image_new_from_stock() as a fallback path for GTK_ICON_SIZE_MENU, after the existing stock-name mapping.
2026-02-18 00:52:49 -07:00
5df6f68cd9 Unified menu icon loading so zc-menu-* icons can be loaded directly from the bundled data/icons/menu/light/*.svg resource set via a new helper (gtkutil_menu_icon_pixbuf_new), instead of depending only on platform stock themes. This makes menu icon resolution consistent across platforms for the custom menu icon namespace.
Updated the GTK2 (!HAVE_GTK3) code path in gtkutil_image_new_from_stock to first try the bundled zc-menu-* SVG resource icons and only fall back to GTK stock icons if a bundled icon cannot be loaded.
2026-02-18 00:41:55 -07:00
f6b78bd167 Standardized GTK menu-icon fallback mapping so stock names for Save As, Previous, and Next now resolve through the bundled zc-menu-* icon family (and map back correctly on GTK2), ensuring these menu actions use the same icon set path as the rest of your menu icons.
Updated search controls in the main UI to use zc-menu-previous / zc-menu-next and to load through gtkutil_image_new_from_stock(...), so those menu-sized icons are rendered from the same data/icons/menu resources instead of theme-dependent icon names.

    Updated URL Grabber and Raw Log “Save As” icon constants to use zc-menu-save-as for consistency with the menu icon set.

    Added new menu SVGs (save-as, previous, next) in both light and dark variants, and registered all of them in the GResource manifest so they’re available cross-platform from the bundled resource system.
2026-02-18 00:32:42 -07:00
fcf00ebd8f Updated menu-item icon resolution in menu_quick_item() to always go through gtkutil_image_new_from_stock(..., GTK_ICON_SIZE_MENU) when not loading from a file path, so icon-bearing menu items consistently use the same icon pipeline.
Standardized the main menu icon identifiers to the zc-menu-* set (the icon set backed by data/icons/menu) across builds, instead of splitting between custom IDs and GTK stock IDs.

    Updated create_icon_menu() to use the same stock-to-image helper for stock-backed menu entries, so all menu icons follow the same resolution logic.

    Added a non-GTK3 compatibility mapper that converts zc-menu-* icon IDs to GTK stock names before calling gtk_image_new_from_stock, keeping behavior consistent on older GTK platforms while still using the unified zc-menu-* identifiers in menu definitions.
2026-02-18 00:16:04 -07:00
b419804ddb Updated GTK3 icon resolution so gtkutil_image_new_from_stock() now preserves zc-menu-* icon IDs (when no stock-to-theme mapping exists), allowing those items to load directly from the data/icons/menu resource set instead of falling back inconsistently to theme icon names.
Updated channel list popup menu icon creation to pass the original icon ID directly into the shared loader, so those menu items use the same icon pipeline and set as other menus (data/icons/menu).
2026-02-18 00:05:44 -07:00
bdfabcf800 Standardized GTK3 menu icon resolution so stock-style menu icons are first mapped to the bundled zc-menu-* names (which are backed by data/icons/menu/...), but only for menu-sized icon requests. This keeps non-menu button icons unaffected while making menu icons consistent.
Updated menu construction paths to resolve both zc-menu-* and legacy gtk-* stock names through one custom mapping before loading icons from the bundled menu icon assets, with fallback to light theme assets and then theme icon names. This affects both quick/user menus and standard icon menu items.
2026-02-18 00:00:59 -07:00
bc2b1bd509 Standardized GTK3 menu-related icon constants to use the bundled zc-menu-* icon set (from data/icons/menu) in the places that had direct equivalents, including raw log, URL grabber, channel list actions, tray menu, and plugin load action.
Updated menu_quick_item() so zc-menu-* icons now fall back to the light variant if the current theme variant is unavailable, which helps avoid missing icons.

    Added centralized zc-menu-* resource loading to gtkutil_image_new_from_stock() (theme-variant detection + light fallback), so menu/button icon rendering uses the same bundled source path consistently.
2026-02-17 23:49:59 -07:00
ef87b569d7 Updated the Windows copy project to explicitly include GLib GSettings schema files from $(DepsRoot)\share\glib-2.0\schemas\* and copy them into the release tree at share\glib-2.0\schemas\..., ensuring gschemas.compiled is bundled with portable/release artifacts.
Updated the Inno Setup installer file list to install share\glib-2.0\schemas\* into {app}\share\glib-2.0\schemas under the libs component, so installed builds also ship required schema data.
Updated gtkutil_file_req_response() so only GTK_RESPONSE_ACCEPT runs the file-selection path; all non-accept responses now immediately destroy the dialog via the callback’s dialog pointer, avoiding chooser access on cancel paths.
Kept native chooser handling aligned with that behavior: chooser reads are still gated behind GTK_RESPONSE_ACCEPT, while cleanup remains a single unref path deferred to idle to avoid teardown-in-signal-stack issues on Windows.
2026-02-16 18:57:48 -07:00
3872c4fcdf Updated the GTK3 Help menu icon constant so _Contents now uses help-contents instead of help-browser, which fixes the oversized icon appearance on Linux and keeps it consistent with other menu icons.
Updated menu_setting_foreach() to safely handle sessions where menu_item[id] is still NULL by storing it in a local pointer and only toggling check state when it exists. This avoids GTK/GLib criticals during layout/menu synchronization paths while preserving normal behavior for initialized menu items.
Fixed the a few dialog box layout so the scrolled keybindings list expands to fill available vertical space in the window. It now packs the scroller into the parent GtkBox with expand/fill enabled (gtk_box_pack_start(..., TRUE, TRUE, 0)) instead of adding it as a generic container child. This allows the window height to be fully utilized.
2026-02-16 18:40:15 -07:00
6df8a98fa0 Updated the Windows GTK3 native file-dialog flow to use asynchronous handling (gtk_native_dialog_show + "response" signal) instead of synchronous gtk_native_dialog_run, reducing risky dispose/unrealize timing during dialog close.
Added gtkutil_native_file_req_response() to keep completion semantics consistent: process selected files on accept, send the trailing callback(..., NULL) completion notification, free request state, and defer dialog unref to idle.
2026-02-16 17:29:25 -07:00
a6af143ba7 Fixed the Windows GTK3 native file chooser lifetime handling by adding an idle callback (gtkutil_native_dialog_unref_idle) that performs g_object_unref(native) outside the button-release signal stack. This avoids the crash path when cancelling the Load file dialog.
Updated the native chooser code path to replace immediate unref with deferred unref via g_idle_add(...) after gtk_native_dialog_run, while preserving the existing accept-only file handling behavior.
2026-02-16 15:37:59 -07:00
287afb4b1d Refactored file-selection completion logic so it can operate on any GtkFileChooser object, not only GtkFileChooserDialog, by introducing gtkutil_file_req_done_chooser() and reusing it from the existing dialog path. This keeps validation/callback behavior identical between chooser implementations.
Updated gtkutil_file_req() to resolve an effective_parent (fallback to global parent_window when no parent is passed), which ensures consistent transient parenting and modal assertions in this code path.
Added a Windows GTK3-specific path that uses GtkFileChooserNative (instead of the GTK file chooser dialog widget path implicated by your stack trace), while preserving existing behavior for initial folder/name, filters, multi-select, and overwrite confirmation before invoking the same file-check callback flow.
Left the existing non-Windows / non-GTK3 dialog flow in place unchanged in behavior, so platforms outside the crash scenario continue using the prior implementation.
2026-02-16 15:06:59 -07:00
7f4ffdb1e5 Added defensive path validation in gtkutil_file_req() so the file chooser only receives existing directories for initial/current folder setup, with fallback to get_xdir() when the requested folder is invalid. This is aimed at preventing the Windows crash that occurs immediately on pressing the Plugin GUI Load button (before file selection).
Wrapped shortcut-folder setup with existence checks and explicit GError handling so invalid config paths don’t propagate into GTK chooser failures/crashes on Windows.
Removed an unused get_xdir_fs extern declaration from this function while introducing a single xdir value reused across chooser setup logic.
2026-02-15 16:15:25 -07:00
95538794e3 Fixed the GTK file chooser handling to avoid dereferencing/processing invalid filenames by adding an early guard in gtkutil_check_file() for NULL/empty selections, which prevents the load flow from continuing with bad input.
Fixed the single-file open path in gtkutil_file_req_done() to fetch the filename once and only call gtkutil_check_file() when a non-NULL filename is returned, preventing the crash path when GTK returns no file on accept/load.
2026-02-15 15:02:26 -07:00
eb46631a7d Added GTK utility helpers for box/grid creation and attachment that map GTK3 layout settings while preserving GTK2 fallbacks.
Updated multiple GTK UI layout paths (setup, server list, notify, ban list, join dialog, and menu) to use the new helpers for GTK3-safe box/grid creation and attachment behavior.
Added GTK3-safe attach option definitions and updated helper signatures to avoid GTK2-only types/macros in public headers.
Updated gtkutil grid-attachment helpers to use the new attach option type in alignment/expansion logic.
Switched banlist grid attachments to the new helper option flags for GTK3 builds.
2026-02-05 01:59:15 -07:00
45300a233b Fixed GTK2 build guard in gtkutil_tray_icon_supported by using #if HAVE_GTK3 so GTK2 builds skip the GTK3-only GDK_IS_X11_DISPLAY check. 2026-02-04 21:07:49 -07:00
7dd47dbd2e Adjust for GTK3 github actions compile testing.
fixed gtk2 compiling.
2026-02-01 15:23:36 -07:00
e5673e9a7b fix compile errors with GTK3 and Wayland. Now compiles/Runs using GTK3+Wayland. 2026-02-01 14:04:56 -07:00
8abc95205a Replaced GTK3 palette font styling with CSS-compliant properties derived from PangoFontDescription, avoiding the deprecated Pango font: syntax in generated CSS.
Added a GTK3-only helper to translate Pango font fields into font-family, font-size, font-style, font-weight, font-variant, and font-stretch CSS declarations while preserving GTK2 behavior under #if !HAVE_GTK3.
Reused the GTK3 font CSS helper in the main UI font styling path to eliminate remaining Pango font: shorthand usage that triggers GTK3 theme parsing warnings.
Exposed the GTK3 font CSS helper in gtkutil so callers can emit CSS-compliant font properties consistently.
2026-01-31 16:37:15 -07:00
b121fa7287 Ensured GTK3 buttons created via gtkutil_button always display their images by enabling gtk_button_set_always_show_image when an icon is set. 2026-01-31 15:35:43 -07:00
7d83394e35 Updated GTK3 dialog/button creation in gtkutil.c to use label strings with GTK2 stock fallbacks for file and input dialogs.
Added GTK3 icon-name macros and applied them to tab menu/search button icon usage in maingui.c, keeping GTK2 stock fallbacks intact.
Introduced GTK3 icon-name helpers and macro splits for server list buttons/connect controls in servlistgui.c.
Tightened GTK2/GTK3 icon macro separation in sexy-spell-entry.c.
2026-01-30 15:27:01 -07:00
a2b35c289c Updated the join dialog to use gtkutil stock helpers for the network image and OK button with an explicit label.
Clarified GTK2-specific stock widget handling with explicit #elif !HAVE_GTK3 guards in the helper implementations.
2026-01-30 08:21:55 -07:00
537167cd61 Added gtkutil helpers to create stock-based images and buttons while keeping GTK3 icon-name mapping centralized in gtkutil.c.
Exposed the new gtkutil stock helper APIs in the header for reuse.
Swapped setup dialog stock button creation to the new gtkutil_button_new_from_stock helper (including the sound play button fallback).
2026-01-30 07:53:50 -07:00
6f31e33094 Refactored gtkutil_icon_name_from_stock() to use a lookup table with explicit GTK stock icon aliases (including GTK3 mappings) while keeping the stock-name fallback intact.
Spot-checked GTK stock icon usage in chanlist.c, menu.c, and sexy-spell-entry.c to confirm expected GTK3 icon mapping coverage at the call sites you flagged.
2026-01-25 12:53:15 -07:00
bad5eab21c Expanded the GTK3 stock-to-themed icon mapping to cover additional stock IDs (add, yes/no, navigation, dialog error, media play, network, spell check) while keeping the stock fallback unchanged.
Spot-checked GTK3 callers in chanlist, menu, and spell-entry code paths that rely on stock icon mappings for menu items and spelling UI icons.
2026-01-25 12:29:00 -07:00
c9ec0527dd Avoided re-adding the same GTK3 palette CSS provider by tracking when the provider is first created before attaching it to the style context. 2026-01-25 12:19:44 -07:00
ac3ce1ceac Updated gtkutil_apply_palette declarations to use GTK-specific Gdk color types for GTK3 vs GTK2 builds.
Adjusted the gtkutil_apply_palette definition to match GTK3/GTK2 Gdk color signatures while preserving existing behavior.
2026-01-25 11:37:04 -07:00
94789a9100 Added gtkutil_apply_palette declaration and implementation to apply palette colors/fonts via GTK3 CSS providers with GTK2 fallbacks preserved.
Switched channel tree and theme application logic to use the new palette helper.
Updated entry and user list styling to route palette/font application through the helper.
2026-01-25 11:30:21 -07:00
ab3bdf219f Added #if HAVE_GTK3 / #elif !HAVE_GTK3 branches around gtk_hbox_new / gtk_vbox_new call sites in the GTK front-end, using gtk_box_new(GTK_ORIENTATION_*, spacing) for GTK3 while keeping the GTK2 constructors explicitly gated under !HAVE_GTK3.
Applied gtk_box_set_homogeneous() in GTK3 branches where the GTK2 code requested homogeneous layout (e.g., dialog hboxes).
Updated remaining helpers and setup/preferences UI box constructors (including the shared mg_box_new helper) to follow the same GTK3/GTK2 branching approach consistently across src/fe-gtk/
2026-01-23 21:28:32 -07:00
8d76d94131 Added a GTK3-only helper to build button images from stock IDs via icon-name mapping, and refactored gtkutil_button to use it while keeping GTK2 stock handling intact.
Verified gtkutil_button(...) callers with rg -n "gtkutil_button\\s*\\(" src/fe-gtk.
2026-01-23 11:17:28 -07:00
246bcd06a2 Updated gtkutil_button() to build button images via GTK3 icon names (with stock mapping) and to skip image creation when no stock name is provided, while keeping GTK2 stock usage intact. 2026-01-23 10:52:17 -07:00
e4f1b20211 Added a helper to create button images from stock names using GTK3 icon mapping, and used it in gtkutil_button for consistent GTK2/GTK3 handling. 2026-01-23 10:48:01 -07:00
ef5d8c482a Extended the GTK3 stock-to-icon mapping to cover apply/remove so GTK stock buttons continue to map to themed icon names in GTK3 builds. 2026-01-23 10:41:18 -07:00
c346055b42 Added a shared GTK3 stock-to-icon-name helper in gtkutil and exposed it for reuse.
Updated gtkutil_button() to use icon-name images on GTK3 while preserving stock image usage on GTK2.
Switched menu icon creation to the shared GTK3 mapping helper.
2026-01-23 10:32:17 -07:00
d65cef176e Guarded the tray icon X11 code path with GDK_WINDOWING_X11 while preserving the non-X11 fallback behavior in gtkutil_tray_icon_supported.
Switched Win32 window handle retrieval to gdk_win32_window_get_handle and wrapped the usage in GDK_WINDOWING_WIN32 in fe_gui_info_ptr.
2026-01-23 00:43:30 -07:00
5986e6a78b -Added the standard type attribute to the GTK file info query so file type checks no longer trigger GLib-GIO warnings.
-Replaced GtkStyle application in the channel tree view with explicit base/text/font modifications to avoid style attach/detach issues on teardown.

-Updated user list styling to apply the font directly instead of setting a shared GtkStyle instance.

-Switched color button updates to use background modifications instead of creating per-button styles, reducing detach warnings on shutdown.
2026-01-17 18:31:04 -07:00
4683ef705b new name after fork 2026-01-05 23:12:38 -07:00
Patrick Griffis
13b6a40b9c Change preferences sub-dialogs to be modal
This solves the issue where the parent dialog is closed and then
the child dialog is used.

This is however only a partial fix:

- Many other dialogs throughout the codebase do not currently have
  parent windows and need to be refactored.

- Not all window managers respect modal so users can still trigger
  bugs. We can be more defensive against this but it requires more
  refactoring.

Closes #2686
2022-04-16 18:41:34 -05:00
Patrick Griffis
d99cd18fb9 Improve detection of system tray support
Closes #2045
2017-08-31 10:16:03 -04:00