Pages
API Documentation
On this page

Kirigami::Platform::PlatformTheme Class

This class is the base for color management in Kirigami, different platforms can reimplement this class to integrate with system platform colors of a given platform. More...

  • Header: #include <Kirigami/Platform/PlatformTheme>
  • CMake: find_package(KF6 REQUIRED COMPONENTS KirigamiPlatform)
    target_link_libraries(mytarget PRIVATE KF6::KirigamiPlatform)
  • In QML: Theme
  • Inherits: QObject

List of all members, including inherited members

Public Types

Properties

Public Functions

Detailed Description

Member Type Documentation

enum PlatformTheme::ColorGroup

Constant
Kirigami::Platform::PlatformTheme::Disabled QPalette::Disabled
Kirigami::Platform::PlatformTheme::Active QPalette::Active
Kirigami::Platform::PlatformTheme::Inactive QPalette::Inactive
Kirigami::Platform::PlatformTheme::Normal QPalette::Normal

enum PlatformTheme::ColorSet

Constant Value Description
Kirigami::Platform::PlatformTheme::View 0 Color set for item views, usually the lightest of all
Kirigami::Platform::PlatformTheme::Window 1 Default Color set for windows and "chrome" areas
Kirigami::Platform::PlatformTheme::Button 2 Color set used by buttons
Kirigami::Platform::PlatformTheme::Selection 3 Color set used by selected areas
Kirigami::Platform::PlatformTheme::Tooltip 4 Color set used by tooltips
Kirigami::Platform::PlatformTheme::Complementary 5 Color set meant to be complementary to Window: usually is a dark theme for light themes
Kirigami::Platform::PlatformTheme::Header 6 Color set to be used by heading areas of applications, such as toolbars

Property Documentation

activeBackgroundColor : QColor

Background for areas that are active or requesting attention.

Access functions:

  • QColor activeBackgroundColor() const
  • void setCustomActiveBackgroundColor(const QColor &color = QColor())

Notifier signal:

activeTextColor : QColor

Foreground for areas that are active or requesting attention.

Access functions:

  • QColor activeTextColor() const
  • void setCustomActiveTextColor(const QColor &color = QColor())

Notifier signal:

alternateBackgroundColor : QColor

The generic background color.

Alternate background; for example, for use in lists.

This color may be the same as BackgroundNormal, especially in sets other than View and Window.

Access functions:

  • QColor alternateBackgroundColor() const
  • void setCustomAlternateBackgroundColor(const QColor &color = QColor())

Notifier signal:

backgroundColor : QColor

The generic background color.

Access functions:

  • QColor backgroundColor() const
  • void setCustomBackgroundColor(const QColor &color = QColor())

Notifier signal:

colorGroup : ColorGroup

This enumeration describes the color group used to generate the colors. The enum value is based upon QPalette::ColorGroup and has the same values. It's redefined here in order to make it work with QML.

Access functions:

  • Kirigami::Platform::PlatformTheme::ColorGroup colorGroup() const
  • void setColorGroup(Kirigami::Platform::PlatformTheme::ColorGroup)

Notifier signal:

  • void colorGroupChanged(Kirigami::Platform::PlatformTheme::ColorGroup colorGroup)

colorSet : ColorSet

This enumeration describes the color set for which a color is being selected.

Color sets define a color "environment", suitable for drawing all parts of a given region. Colors from different sets should not be combined.

Access functions:

  • Kirigami::Platform::PlatformTheme::ColorSet colorSet() const
  • void setColorSet(Kirigami::Platform::PlatformTheme::ColorSet)

Notifier signal:

  • void colorSetChanged(Kirigami::Platform::PlatformTheme::ColorSet colorSet)

[read-only] defaultFont : QFont

The default font.

Access functions:

  • QFont defaultFont() const

Notifier signal:

  • void defaultFontChanged(const QFont &font)

disabledTextColor : QColor

Foreground color for disabled areas, usually a mid-gray.

Note: Depending on the implementation, the color used for this property may not be based on the disabled palette. For example, for the Plasma implementation, "Inactive Text Color" of the active palette is used.

Access functions:

  • QColor disabledTextColor() const
  • void setCustomDisabledTextColor(const QColor &color = QColor())

Notifier signal:

[read-only] fixedWidthFont : QFont

Fixed width font.

Access functions:

  • QFont fixedWidthFont() const

Notifier signal:

  • void fixedWidthFontChanged(const QFont &font)

focusColor : QColor

A decoration color that indicates active focus.

Access functions:

  • QColor focusColor() const
  • void setCustomFocusColor(const QColor &color = QColor())

Notifier signal:

[read-only] frameContrast : const qreal

Frame contrast value, usually used for separators and outlines Value is between 0.0 and 1.0.

Access functions:

  • qreal frameContrast() const

highlightColor : QColor

The background color for selected areas.

Access functions:

  • QColor highlightColor() const
  • void setCustomHighlightColor(const QColor &color = QColor())

Notifier signal:

highlightedTextColor : QColor

Color for text that has been highlighted, often is a light color while normal text is dark.

Access functions:

  • QColor highlightedTextColor() const
  • void setCustomHighlightedTextColor(const QColor &color = QColor())

Notifier signal:

hoverColor : QColor

A decoration color that indicates mouse hovering.

Access functions:

  • QColor hoverColor() const
  • void setCustomHoverColor(const QColor &color = QColor())

Notifier signal:

inherit : bool

If true, the colorSet will be inherited from the colorset of a theme of one of the ancestor items.

default: true

Access functions:

  • bool inherit() const
  • void setInherit(bool inherit)

Notifier signal:

  • void inheritChanged(bool inherit)

[read-only] lightFrameContrast : const qreal

Returns half of the frameContrast value; used by Separator.Weight.Light Value is between 0.0 and 1.0.

Access functions:

  • qreal lightFrameContrast() const

linkBackgroundColor : QColor

Background color for links.

Access functions:

  • QColor linkBackgroundColor() const
  • void setCustomLinkBackgroundColor(const QColor &color = QColor())

Notifier signal:

linkColor : QColor

Color for links.

Access functions:

  • QColor linkColor() const
  • void setCustomLinkColor(const QColor &color = QColor())

Notifier signal:

negativeBackgroundColor : QColor

Background color for negative areas, such as critical errors and destructive actions.

Access functions:

  • QColor negativeBackgroundColor() const
  • void setCustomNegativeBackgroundColor(const QColor &color = QColor())

Notifier signal:

negativeTextColor : QColor

Foreground color for negative areas, such as critical error text.

Access functions:

  • QColor negativeTextColor() const
  • void setCustomNegativeTextColor(const QColor &color = QColor())

Notifier signal:

neutralBackgroundColor : QColor

Background color for neutral areas, such as warnings (but not critical).

Access functions:

  • QColor neutralBackgroundColor() const
  • void setCustomNeutralBackgroundColor(const QColor &color = QColor())

Notifier signal:

neutralTextColor : QColor

Foreground color for neutral areas, such as warning texts (but not critical).

Access functions:

  • QColor neutralTextColor() const
  • void setCustomNeutralTextColor(const QColor &color = QColor())

Notifier signal:

[read-only] palette : QPalette

Palette.

Access functions:

  • QPalette palette() const

Notifier signal:

  • void paletteChanged(const QPalette &pal)

positiveBackgroundColor : QColor

Background color for positive areas, such as success messages and trusted content.

Access functions:

  • QColor positiveBackgroundColor() const
  • void setCustomPositiveBackgroundColor(const QColor &color = QColor())

Notifier signal:

positiveTextColor : QColor

Success messages, trusted content.

Access functions:

  • QColor positiveTextColor() const
  • void setCustomPositiveTextColor(const QColor &color = QColor())

Notifier signal:

[read-only] smallFont : QFont

Small font.

Access functions:

  • QFont smallFont() const

Notifier signal:

  • void smallFontChanged(const QFont &font)

textColor : QColor

Color for normal foregrounds, usually text, but not limited to it, anything that should be painted with a clear contrast should use this color.

Access functions:

  • QColor textColor() const
  • void setCustomTextColor(const QColor &color = QColor())

Notifier signal:

  • void colorsChanged()

[read-only] toolsArea : Kirigami::Platform::ToolsArea* const

How the window's tools area is drawn; filled by the platform plugin.

Access functions:

  • Kirigami::Platform::ToolsArea *toolsArea() const

useAlternateBackgroundColor : bool

Hint for item views to actually make use of the alternate background color feature.

Access functions:

  • bool useAlternateBackgroundColor() const
  • void setUseAlternateBackgroundColor(bool alternate)

Notifier signal:

  • void useAlternateBackgroundColorChanged(bool alternate)

visitedLinkBackgroundColor : QColor

Background color for visited links, usually a bit darker than linkBackgroundColor.

Access functions:

  • QColor visitedLinkBackgroundColor() const
  • void setCustomVisitedLinkBackgroundColor(const QColor &color = QColor())

Notifier signal:

visitedLinkColor : QColor

Color for visited links, usually a bit darker than linkColor.

Access functions:

  • QColor visitedLinkColor() const
  • void setCustomVisitedLinkColor(const QColor &color = QColor())

Notifier signal:

Member Function Documentation

[virtual invokable] QIcon PlatformTheme::iconFromTheme(const QString &name, const QColor &customColor = Qt::transparent)

This will be used by desktopicon to fetch icons with KIconLoader.

Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.

We use cookies to personalize content and to analyze our traffic. Please decide if you are willing to accept cookies from our website.