Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qwindowstheme.cpp File Reference

(95d4e6bababfeb36fa8a355a8487b64eb3ffb587)

#include <QtCore/qt_windows.h>
#include "qwindowstheme.h"
#include "qwindowsmenu.h"
#include "qwindowsdialoghelpers.h"
#include "qwindowscontext.h"
#include "qwindowsiconengine.h"
#include "qwindowsintegration.h"
#include "qwindowsscreen.h"
#include "qwindowswindow.h"
#include <commctrl.h>
#include <objbase.h>
#include <commoncontrols.h>
#include <shellapi.h>
#include <QtCore/qapplicationstatic.h>
#include <QtCore/qvariant.h>
#include <QtCore/qcoreapplication.h>
#include <QtCore/qdebug.h>
#include <QtCore/qsysinfo.h>
#include <QtCore/qcache.h>
#include <QtCore/qthread.h>
#include <QtCore/qqueue.h>
#include <QtCore/qmutex.h>
#include <QtCore/qwaitcondition.h>
#include <QtCore/qoperatingsystemversion.h>
#include <QtGui/qcolor.h>
#include <QtGui/qpalette.h>
#include <QtGui/qguiapplication.h>
#include <QtGui/qpainter.h>
#include <QtGui/qpixmapcache.h>
#include <qpa/qwindowsysteminterface.h>
#include <QtGui/private/qabstractfileiconengine_p.h>
#include <QtGui/private/qwindowsfontdatabase_p.h>
#include <private/qhighdpiscaling_p.h>
#include <private/qsystemlibrary_p.h>
#include <private/qwinregistry_p.h>
#include <QtCore/private/qfunctions_win_p.h>
#include <algorithm>
+ Include dependency graph for qwindowstheme.cpp:

Go to the source code of this file.

Classes

class  QShGetFileInfoThread
 
struct  QShGetFileInfoThread::Task
 
class  FakePointer< T >
 
class  QWindowsFileIconEngine
 

Enumerations

enum  AccentColorLevel { AccentColorDarkest , AccentColorNormal , AccentColorLightest }
 
enum  FileIconSize {
  SmallFileIcon , LargeFileIcon , ExtraLargeFileIcon , JumboFileIcon ,
  FileIconSizeCount
}
 
enum  { sHIL_EXTRALARGE = 0x2 , sHIL_JUMBO = 0x4 }
 

Functions

static bool booleanSystemParametersInfo (UINT what, bool defaultValue)
 
static DWORD dWordSystemParametersInfo (UINT what, DWORD defaultValue)
 
static QColor mixColors (const QColor &c1, const QColor &c2)
 
static QColor qt_accentColor (AccentColorLevel level)
 
static QColor getSysColor (int index)
 
 Q_APPLICATION_STATIC (QShGetFileInfoThread, s_shGetFileInfoThread) static inline QPalette standardPalette()
 
static QColor placeHolderColor (QColor textColor)
 
static QPalette toolTipPalette (const QPalette &systemPalette, bool light)
 
static QPalette menuPalette (const QPalette &systemPalette, bool light)
 
static QPalettemenuBarPalette (const QPalette &menuPalette, bool light)
 
static QStringList iconThemeSearchPaths ()
 
static QStringList styleNames ()
 
static int uiEffects ()
 
QDebug operator<< (QDebug d, const NONCLIENTMETRICS &m)
 
Q_GUI_EXPORT QPixmap qt_pixmapFromWinHICON (HICON icon)
 
static QPixmap loadIconFromShell32 (int resourceId, QSizeF size)
 
static QString dirIconPixmapCacheKey (int iIcon, int iconSize, int imageListSize)
 
static QPixmap pixmapFromShellImageList (int iImageList, int iIcon)
 
static bool doUseNativeMenus ()
 

Variables

static int fileIconSizes [FileIconSizeCount]
 

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
sHIL_EXTRALARGE 
sHIL_JUMBO 

Definition at line 922 of file qwindowstheme.cpp.

◆ AccentColorLevel

Enumerator
AccentColorDarkest 
AccentColorNormal 
AccentColorLightest 

Definition at line 81 of file qwindowstheme.cpp.

◆ FileIconSize

Enumerator
SmallFileIcon 
LargeFileIcon 
ExtraLargeFileIcon 
JumboFileIcon 
FileIconSizeCount 

Definition at line 728 of file qwindowstheme.cpp.

Function Documentation

◆ booleanSystemParametersInfo()

static bool booleanSystemParametersInfo ( UINT what,
bool defaultValue )
inlinestatic

Definition at line 58 of file qwindowstheme.cpp.

Referenced by menuBarPalette(), menuPalette(), QWindowsTheme::themeHint(), and uiEffects().

+ Here is the caller graph for this function:

◆ dirIconPixmapCacheKey()

static QString dirIconPixmapCacheKey ( int iIcon,
int iconSize,
int imageListSize )
static

Definition at line 927 of file qwindowstheme.cpp.

References iconSize, QString::number(), sHIL_EXTRALARGE, and sHIL_JUMBO.

Referenced by QWindowsFileIconEngine::filePixmap().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ doUseNativeMenus()

static bool doUseNativeMenus ( )
inlinestatic

Definition at line 1114 of file qwindowstheme.cpp.

References QWindowsIntegration::AlwaysUseNativeMenus, inherits(), QWindowsIntegration::instance(), QCoreApplication::instance(), QWindowsIntegration::NoNativeMenus, and QGuiApplication::topLevelWindows().

Referenced by QWindowsTheme::useNativeMenus().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ dWordSystemParametersInfo()

static DWORD dWordSystemParametersInfo ( UINT what,
DWORD defaultValue )
inlinestatic

Definition at line 66 of file qwindowstheme.cpp.

Referenced by QWindowsTheme::themeHint().

+ Here is the caller graph for this function:

◆ getSysColor()

static QColor getSysColor ( int index)
inlinestatic

Definition at line 125 of file qwindowstheme.cpp.

Referenced by menuBarPalette(), menuPalette(), qt_accentColor(), and toolTipPalette().

+ Here is the caller graph for this function:

◆ iconThemeSearchPaths()

static QStringList iconThemeSearchPaths ( )
inlinestatic

Definition at line 477 of file qwindowstheme.cpp.

References QCoreApplication::applicationDirPath().

Referenced by QWindowsTheme::themeHint().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ loadIconFromShell32()

static QPixmap loadIconFromShell32 ( int resourceId,
QSizeF size )
static

Definition at line 779 of file qwindowstheme.cpp.

References qt_pixmapFromWinHICON().

Referenced by QWindowsTheme::standardPixmap().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ menuBarPalette()

static QPalette * menuBarPalette ( const QPalette & menuPalette,
bool light )
inlinestatic

Definition at line 443 of file qwindowstheme.cpp.

References QPalette::Active, booleanSystemParametersInfo(), QPalette::Button, QPalette::Disabled, getSysColor(), QPalette::Inactive, menuPalette(), and SPI_GETFLATMENU.

+ Here is the call graph for this function:

◆ menuPalette()

static QPalette menuPalette ( const QPalette & systemPalette,
bool light )
inlinestatic

Definition at line 404 of file qwindowstheme.cpp.

References QPalette::Active, booleanSystemParametersInfo(), QPalette::Button, QPalette::ButtonText, QPalette::color(), QPalette::Dark, QPalette::Disabled, disabled, getSysColor(), QPalette::Highlight, QPalette::HighlightedText, QPalette::Inactive, SPI_GETFLATMENU, QPalette::Text, and QPalette::WindowText.

Referenced by menuBarPalette().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ mixColors()

static QColor mixColors ( const QColor & c1,
const QColor & c2 )
inlinestatic

Definition at line 74 of file qwindowstheme.cpp.

References QColor::blue(), c2, QColor::green(), and QColor::red().

Referenced by QWindowsTheme::systemPalette(), and toolTipPalette().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ operator<<()

QDebug operator<< ( QDebug d,
const NONCLIENTMETRICS & m )

Definition at line 673 of file qwindowstheme.cpp.

References d, and QWindowsFontDatabase::debugFormat().

+ Here is the call graph for this function:

◆ pixmapFromShellImageList()

static QPixmap pixmapFromShellImageList ( int iImageList,
int iIcon )
static

Definition at line 965 of file qwindowstheme.cpp.

References IID, and qt_pixmapFromWinHICON().

Referenced by QWindowsFileIconEngine::filePixmap().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ placeHolderColor()

static QColor placeHolderColor ( QColor textColor)
static

Definition at line 252 of file qwindowstheme.cpp.

References QColor::setAlpha().

+ Here is the call graph for this function:

◆ Q_APPLICATION_STATIC()

Q_APPLICATION_STATIC ( QShGetFileInfoThread ,
s_shGetFileInfoThread  )

Definition at line 233 of file qwindowstheme.cpp.

References QPalette::Base, Qt::black, QPalette::ButtonText, QColor::darker(), QPalette::Disabled, Qt::gray, QColor::lighter(), palette, QPalette::Text, Qt::white, and QPalette::WindowText.

+ Here is the call graph for this function:

◆ qt_accentColor()

static QColor qt_accentColor ( AccentColorLevel level)
inlinestatic

Definition at line 94 of file qwindowstheme.cpp.

References AccentColorDarkest, AccentColorLightest, QColor::darker(), QColor::fromRgb(), QColor::fromRgba(), getSysColor(), QWinRegistryKey::isValid(), QColor::lighter(), settings, and QWinRegistryKey::value().

+ Here is the call graph for this function:

◆ qt_pixmapFromWinHICON()

Q_GUI_EXPORT QPixmap qt_pixmapFromWinHICON ( HICON icon)

Definition at line 646 of file qpixmap_win.cpp.

References QPixmap::fromImage(), and icon.

Referenced by QWindowsFileIconEngine::filePixmap(), loadIconFromShell32(), pixmapFromShellImageList(), and QWindowsTheme::standardPixmap().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ styleNames()

static QStringList styleNames ( )
inlinestatic

Definition at line 483 of file qwindowstheme.cpp.

References QOperatingSystemVersionBase::current(), QStringLiteral, and QOperatingSystemVersion::Windows11.

Referenced by QMacStyle::standardPalette(), QGenericUnixTheme::themeHint(), QGnomeTheme::themeHint(), and QWindowsTheme::themeHint().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ toolTipPalette()

static QPalette toolTipPalette ( const QPalette & systemPalette,
bool light )
inlinestatic

Definition at line 374 of file qwindowstheme.cpp.

References QPalette::All, QPalette::Base, QPalette::BrightText, QPalette::Button, QPalette::button(), QPalette::ButtonText, QPalette::buttonText(), QBrush::color(), QColor::darker(), QPalette::Disabled, disabled, getSysColor(), mixColors(), QPalette::Text, QPalette::ToolTipBase, QPalette::ToolTipText, Qt::white, QPalette::Window, and QPalette::WindowText.

Referenced by qt_init_tooltip_palette().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ uiEffects()

static int uiEffects ( )
inlinestatic

Definition at line 491 of file qwindowstheme.cpp.

References QPlatformTheme::AnimateComboUiEffect, QPlatformTheme::AnimateMenuUiEffect, QPlatformTheme::AnimateTooltipUiEffect, booleanSystemParametersInfo(), QPlatformTheme::FadeMenuUiEffect, QPlatformTheme::GeneralUiEffect, QPlatformTheme::HoverEffect, SPI_GETCOMBOBOXANIMATION, SPI_GETMENUANIMATION, SPI_GETMENUFADE, SPI_GETTOOLTIPANIMATION, and SPI_GETUIEFFECTS.

Referenced by QWindowsTheme::themeHint().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Variable Documentation

◆ fileIconSizes

int fileIconSizes[FileIconSizeCount]
static

Definition at line 760 of file qwindowstheme.cpp.

Referenced by QWindowsFileIconEngine::filePixmap().