mirror of
https://github.com/JakubMelka/PDF4QT.git
synced 2025-06-05 21:59:17 +02:00
Issue #99: Icons for dark mode
This commit is contained in:
@ -20,6 +20,7 @@
|
||||
|
||||
#include "pdfglobal.h"
|
||||
|
||||
#include <QIcon>
|
||||
#include <QWidget>
|
||||
|
||||
namespace pdf
|
||||
@ -57,6 +58,35 @@ public:
|
||||
|
||||
/// Apply style to the widget
|
||||
static void style(QWidget* widget);
|
||||
|
||||
/// Vrátí true, pokud je aktuálně nastavená dark theme
|
||||
/// pro aplikaci.
|
||||
static bool isDarkTheme();
|
||||
|
||||
/// Converts an action's icon for use in a dark theme.
|
||||
/// \param action Pointer to the QAction to be converted.
|
||||
/// \param iconSize The size of the action's icon.
|
||||
/// \param devicePixelRatioF The device pixel ratio factor.
|
||||
static void convertActionForDarkTheme(QAction* action, QSize iconSize, qreal devicePixelRatioF);
|
||||
|
||||
/// Converts an icon for use in a dark theme.
|
||||
/// \param icon The icon to be converted.
|
||||
/// \param iconSize The size of the icon.
|
||||
/// \param devicePixelRatioF The device pixel ratio factor.
|
||||
static QIcon convertIconForDarkTheme(QIcon icon, QSize iconSize, qreal devicePixelRatioF);
|
||||
|
||||
/// Converts an action's icon for use in a dark theme.
|
||||
/// \param action Pointer to the QAction to be converted.
|
||||
/// \param iconSize The size of the action's icon.
|
||||
/// \param devicePixelRatioF The device pixel ratio factor.
|
||||
template<typename Container>
|
||||
static void convertActionsForDarkTheme(const Container& actions, QSize iconSize, qreal devicePixelRatioF)
|
||||
{
|
||||
for (QAction* action : actions)
|
||||
{
|
||||
convertActionForDarkTheme(action, iconSize, devicePixelRatioF);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace pdf
|
||||
|
Reference in New Issue
Block a user