YODAU
1.0
YEAR OF THE DEPEND ADULT UNDERGARMENT
Loading...
Searching...
No Matches
icon_loader.hpp
Go to the documentation of this file.
1
#
ifndef
YODAU_FRONTEND_HELPERS_ICON_LOADER_HPP
2
#
define
YODAU_FRONTEND_HELPERS_ICON_LOADER_HPP
3
4
#
include
<
QApplication
>
5
#
include
<
QIcon
>
6
#
include
<
QStyle
>
7
#
include
<
initializer_list
>
8
9
/**
10
* @brief Utility for loading icons with theme support and fallbacks.
11
*
12
* This helper tries to obtain icons from the current desktop theme using a list
13
* of possible icon names (in priority order). If none of the themed icons are
14
* available, it falls back to a Qt standard pixmap from the current application
15
* style.
16
*
17
* On Android builds, themed-icon lookup is skipped by design and the fallback
18
* icon is returned immediately.
19
*/
20
class
icon_loader
{
21
public
:
22
/**
23
* @brief Load a themed icon using multiple candidate names.
24
*
25
* The function iterates over @p names and returns the first non-null icon
26
* found via @c QIcon::fromTheme. If all candidates fail (or if themed icons
27
* are disabled on the platform), a standard style icon specified by
28
* @p fallback is returned.
29
*
30
* @param names Candidate icon names in theme lookup order.
31
* @param fallback Qt standard pixmap to use when no themed icon is found.
32
* @return A valid icon: either a themed icon or a style fallback.
33
*/
34
static
QIcon
themed
(
35
std::initializer_list<
const
char
*> names,
36
QStyle::StandardPixmap fallback
37
);
38
};
39
40
#
endif
// YODAU_FRONTEND_HELPERS_ICON_LOADER_HPP
icon_loader
Utility for loading icons with theme support and fallbacks.
Definition
icon_loader.hpp:20
icon_loader::themed
static QIcon themed(std::initializer_list< const char * > names, QStyle::StandardPixmap fallback)
Load a themed icon using multiple candidate names.
Definition
icon_loader.cpp:3
frontend
include
helpers
icon_loader.hpp
Generated on
for YODAU by
1.15.0