Mercurial > octave
diff libgui/src/gui-preferences-global.h @ 30777:439eb9bd4c04
icon fallback concept without QIcon::fallbackSearchPaths (bug #62106)
* FigureWindow.cc (FigureWindow): do not use fromTheme
* ToolBarButton.cc: include QString and gui-preferences-global.h;
(get_icon): do not use fromTheme
* gui-preferences-global.h: define QStringList with exisiting icon
fallback paths togehter with an enumeration for the list inidices
* octave-dock-widget.cc (label_dock_widget): use ressource_manager::icon
instead of fromTheme, use constants from gui-preferences for icon paths
instead of literal strings in style sheets
(make_window): dito
(make_widget): dito
* resource-manager.cc (resource_manager): initialize m_icon_fallbacks;
(config_icon_theme): collect fallback paths in a string list depending
on selected icon theme;
(icon): test existance of icon in current theme, if not, test the
fallback locations;
* resource-manager.h: new string list m_icon_fallbacks
author | Torsten Lilge <ttl-octave@mailbox.org> |
---|---|
date | Thu, 24 Feb 2022 22:16:35 +0100 |
parents | 796f54d4ddbf |
children | c11d34f72b3c |
line wrap: on
line diff
--- a/libgui/src/gui-preferences-global.h Thu Feb 24 17:33:44 2022 +0100 +++ b/libgui/src/gui-preferences-global.h Thu Feb 24 22:16:35 2022 +0100 @@ -84,6 +84,22 @@ const gui_pref global_icon_theme ("use_system_icon_theme", QVariant (true)); +enum +{ + ICON_THEME_SYSTEM, + ICON_THEME_OCTAVE, + ICON_THEME_TANGO, + ICON_THEME_CURSORS +}; + +const QStringList +global_icon_fallback_paths (QStringList () + << "" + << ":/icons/octave/128x128/" + << ":/icons/tango/128x128/" + << ":/cursors/" + ); + // Other const gui_pref