KWin
Loading...
Searching...
No Matches
Public Types | Signals | Public Member Functions | Properties | List of all members
KWin::DecorationOptions Class Reference

Common Window Decoration Options. More...

#include <decorationoptions.h>

Inheritance diagram for KWin::DecorationOptions:

Public Types

enum  BorderSize {
  BorderNone , BorderNoSides , BorderTiny , BorderNormal ,
  BorderLarge , BorderVeryLarge , BorderHuge , BorderVeryHuge ,
  BorderOversized
}
 
enum  DecorationButton {
  DecorationButtonNone , DecorationButtonMenu , DecorationButtonApplicationMenu , DecorationButtonOnAllDesktops ,
  DecorationButtonQuickHelp , DecorationButtonMinimize , DecorationButtonMaximizeRestore , DecorationButtonClose ,
  DecorationButtonKeepAbove , DecorationButtonKeepBelow , DecorationButtonShade , DecorationButtonResize ,
  DecorationButtonExplicitSpacer
}
 

Signals

void colorsChanged ()
 
void fontChanged ()
 
void decorationChanged ()
 
void titleButtonsChanged ()
 

Public Member Functions

 DecorationOptions (QObject *parent=nullptr)
 
 ~DecorationOptions () override
 
QColor titleBarColor () const
 
QColor titleBarBlendColor () const
 
QColor fontColor () const
 
QColor buttonColor () const
 
QColor borderColor () const
 
QColor resizeHandleColor () const
 
QFont titleFont () const
 
QList< int > titleButtonsLeft () const
 
QList< int > titleButtonsRight () const
 
KDecoration2::Decoration * decoration () const
 
void setDecoration (KDecoration2::Decoration *decoration)
 
int mousePressAndHoldInterval () const
 

Properties

KDecoration2::Decoration * deco
 
QColor titleBarColor
 
QColor titleBarBlendColor
 
QColor fontColor
 
QColor buttonColor
 
QColor borderColor
 
QColor resizeHandleColor
 
QFont titleFont
 
QList< int > titleButtonsLeft
 
QList< int > titleButtonsRight
 
int mousePressAndHoldInterval
 

Detailed Description

Common Window Decoration Options.

This Class provides common window decoration options which can be used, but do not have to be used by a window decoration. The class provides properties for global settings such as color, font and decoration button position.

If a window decoration wants to follow the global color scheme it should honor the values provided by the properties.

In any case it makes sense to respect the font settings for the decoration as this is also an accessibility feature.

In order to use the options in a QML based window decoration an instance of this object needs to be created and the as a context property available "decoration" needs to be passed to the DecorationOptions instance:

id: options
}
Common Window Decoration Options.
KDecoration2::Decoration * decoration() const
KDecoration2::Decoration * deco
Options * options
Definition main.cpp:73

Definition at line 132 of file decorationoptions.h.

Member Enumeration Documentation

◆ BorderSize

Enumerator
BorderNone 

No borders except title.

BorderNoSides 

No borders on sides.

BorderTiny 

Minimal borders.

BorderNormal 

Standard size borders, the default setting.

BorderLarge 

Larger borders.

BorderVeryLarge 

Very large borders.

BorderHuge 

Huge borders.

BorderVeryHuge 

Very huge borders.

BorderOversized 

Oversized borders.

Definition at line 181 of file decorationoptions.h.

◆ DecorationButton

Enum values to identify the decorations buttons which should be used by the decoration.

Enumerator
DecorationButtonNone 

Invalid button value. A decoration should not create a button for this type.

DecorationButtonMenu 
DecorationButtonApplicationMenu 
DecorationButtonOnAllDesktops 
DecorationButtonQuickHelp 
DecorationButtonMinimize 
DecorationButtonMaximizeRestore 
DecorationButtonClose 
DecorationButtonKeepAbove 
DecorationButtonKeepBelow 
DecorationButtonShade 
DecorationButtonResize 
DecorationButtonExplicitSpacer 

The decoration should create an empty spacer instead of a button for this type.

Definition at line 198 of file decorationoptions.h.

Constructor & Destructor Documentation

◆ DecorationOptions()

KWin::DecorationOptions::DecorationOptions ( QObject * parent = nullptr)
explicit

Definition at line 45 of file decorationoptions.cpp.

◆ ~DecorationOptions()

KWin::DecorationOptions::~DecorationOptions ( )
override

Definition at line 57 of file decorationoptions.cpp.

Member Function Documentation

◆ borderColor()

QColor KWin::DecorationOptions::borderColor ( ) const

Definition at line 61 of file decorationoptions.cpp.

◆ buttonColor()

QColor KWin::DecorationOptions::buttonColor ( ) const

Definition at line 66 of file decorationoptions.cpp.

◆ colorsChanged

void KWin::DecorationOptions::colorsChanged ( )
signal

◆ decoration()

KDecoration2::Decoration * KWin::DecorationOptions::decoration ( ) const

Definition at line 146 of file decorationoptions.cpp.

◆ decorationChanged

void KWin::DecorationOptions::decorationChanged ( )
signal

◆ fontChanged

void KWin::DecorationOptions::fontChanged ( )
signal

◆ fontColor()

QColor KWin::DecorationOptions::fontColor ( ) const

Definition at line 71 of file decorationoptions.cpp.

◆ mousePressAndHoldInterval()

int KWin::DecorationOptions::mousePressAndHoldInterval ( ) const

Definition at line 191 of file decorationoptions.cpp.

◆ resizeHandleColor()

QColor KWin::DecorationOptions::resizeHandleColor ( ) const

Definition at line 76 of file decorationoptions.cpp.

◆ setDecoration()

void KWin::DecorationOptions::setDecoration ( KDecoration2::Decoration * decoration)

Definition at line 151 of file decorationoptions.cpp.

◆ titleBarBlendColor()

QColor KWin::DecorationOptions::titleBarBlendColor ( ) const

Definition at line 81 of file decorationoptions.cpp.

◆ titleBarColor()

QColor KWin::DecorationOptions::titleBarColor ( ) const

Definition at line 86 of file decorationoptions.cpp.

◆ titleButtonsChanged

void KWin::DecorationOptions::titleButtonsChanged ( )
signal

◆ titleButtonsLeft()

QList< int > KWin::DecorationOptions::titleButtonsLeft ( ) const

Definition at line 124 of file decorationoptions.cpp.

◆ titleButtonsRight()

QList< int > KWin::DecorationOptions::titleButtonsRight ( ) const

Definition at line 135 of file decorationoptions.cpp.

◆ titleFont()

QFont KWin::DecorationOptions::titleFont ( ) const

Definition at line 91 of file decorationoptions.cpp.

Property Documentation

◆ borderColor

QColor KWin::DecorationOptions::borderColor
read

The color for the window frame (border) depending on the decoration's active state.

Definition at line 162 of file decorationoptions.h.

◆ buttonColor

QColor KWin::DecorationOptions::buttonColor
read

The color to use for titlebar buttons depending on the decoration's active state.

Definition at line 158 of file decorationoptions.h.

◆ deco

KDecoration2::Decoration * KWin::DecorationOptions::deco
readwrite

The decoration Object for which this set of options should be used. The decoration is required to get the correct colors and fonts depending on whether the decoration represents an active or inactive window.

Best pass the decoration object available as a context property to this property.

Definition at line 142 of file decorationoptions.h.

◆ fontColor

QColor KWin::DecorationOptions::fontColor
read

The titlebar text color depending on the decoration's active state.

Definition at line 154 of file decorationoptions.h.

◆ mousePressAndHoldInterval

int KWin::DecorationOptions::mousePressAndHoldInterval
read

Definition at line 179 of file decorationoptions.h.

◆ resizeHandleColor

QColor KWin::DecorationOptions::resizeHandleColor
read

The color for the resize handle depending on the decoration's active state.

Definition at line 166 of file decorationoptions.h.

◆ titleBarBlendColor

QColor KWin::DecorationOptions::titleBarBlendColor
read

The blend color for the titlebar depending on the decoration's active state.

Definition at line 150 of file decorationoptions.h.

◆ titleBarColor

QColor KWin::DecorationOptions::titleBarColor
read

The color for the titlebar depending on the decoration's active state.

Definition at line 146 of file decorationoptions.h.

◆ titleButtonsLeft

QList<int> KWin::DecorationOptions::titleButtonsLeft
read

The buttons to be positioned on the left side of the titlebar from left to right.

Definition at line 174 of file decorationoptions.h.

◆ titleButtonsRight

QList<int> KWin::DecorationOptions::titleButtonsRight
read

The buttons to be positioned on the right side of the titlebar from left to right.

Definition at line 178 of file decorationoptions.h.

◆ titleFont

QFont KWin::DecorationOptions::titleFont
read

The font to be used for the decoration caption depending on the decoration's active state.

Definition at line 170 of file decorationoptions.h.


The documentation for this class was generated from the following files: