CSDControls
#include <csdcontrols.h>
Properties | |
var | buttonsModel |
bool | canMaximize |
bool | canMinimize |
bool | enabled |
bool | isActiveWindow |
bool | maximized |
QStringList | rightWindowControls |
QUrl | source |
QString | styleName |
Properties inherited from QObject | |
objectName | |
Signals | |
void | buttonClicked (var type) |
void | enableCSDChanged () |
void | sourceChanged () |
void | styleNameChanged () |
Public Member Functions | |
CSDControls (QObject *parent=nullptr) | |
bool | enableCSD () const |
QObject * | qmlInstance (QQmlEngine *engine, QJSEngine *scriptEngine) |
void | resetEnableCSD () |
void | setEnableCSD (const bool &value) |
QUrl | source () const |
QString | styleName () const |
Public Member Functions inherited from QObject | |
QObject (QObject *parent) | |
QBindable< QString > | bindableObjectName () |
bool | blockSignals (bool block) |
const QObjectList & | children () const const |
QMetaObject::Connection | connect (const QObject *sender, const char *signal, const char *method, Qt::ConnectionType type) const const |
void | deleteLater () |
void | destroyed (QObject *obj) |
bool | disconnect (const char *signal, const QObject *receiver, const char *method) const const |
bool | disconnect (const QObject *receiver, const char *method) const const |
void | dumpObjectInfo () const const |
void | dumpObjectTree () const const |
QList< QByteArray > | dynamicPropertyNames () const const |
virtual bool | event (QEvent *e) |
virtual bool | eventFilter (QObject *watched, QEvent *event) |
T | findChild (const QString &name, Qt::FindChildOptions options) const const |
QList< T > | findChildren (const QRegularExpression &re, Qt::FindChildOptions options) const const |
QList< T > | findChildren (const QString &name, Qt::FindChildOptions options) const const |
QList< T > | findChildren (Qt::FindChildOptions options) const const |
bool | inherits (const char *className) const const |
void | installEventFilter (QObject *filterObj) |
bool | isQuickItemType () const const |
bool | isWidgetType () const const |
bool | isWindowType () const const |
void | killTimer (int id) |
virtual const QMetaObject * | metaObject () const const |
void | moveToThread (QThread *targetThread) |
QString | objectName () const const |
void | objectNameChanged (const QString &objectName) |
QObject * | parent () const const |
QVariant | property (const char *name) const const |
Q_CLASSINFO (Name, Value) | |
Q_EMIT Q_EMIT | |
Q_ENUM (...) | |
Q_ENUM_NS (...) | |
Q_ENUMS (...) | |
Q_FLAG (...) | |
Q_FLAG_NS (...) | |
Q_FLAGS (...) | |
Q_GADGET Q_GADGET | |
Q_GADGET_EXPORT (EXPORT_MACRO) | |
Q_INTERFACES (...) | |
Q_INVOKABLE Q_INVOKABLE | |
Q_MOC_INCLUDE Q_MOC_INCLUDE | |
Q_NAMESPACE Q_NAMESPACE | |
Q_NAMESPACE_EXPORT (EXPORT_MACRO) | |
Q_OBJECT Q_OBJECT | |
Q_PROPERTY (...) | |
Q_REVISION Q_REVISION | |
Q_SET_OBJECT_NAME (Object) | |
Q_SIGNAL Q_SIGNAL | |
Q_SIGNALS Q_SIGNALS | |
Q_SLOT Q_SLOT | |
Q_SLOTS Q_SLOTS | |
T | qobject_cast (const QObject *object) |
T | qobject_cast (QObject *object) |
QT_NO_NARROWING_CONVERSIONS_IN_CONNECT QT_NO_NARROWING_CONVERSIONS_IN_CONNECT | |
void | removeEventFilter (QObject *obj) |
void | setObjectName (const QString &name) |
void | setObjectName (QAnyStringView name) |
void | setParent (QObject *parent) |
bool | setProperty (const char *name, const QVariant &value) |
bool | setProperty (const char *name, QVariant &&value) |
bool | signalsBlocked () const const |
int | startTimer (int interval, Qt::TimerType timerType) |
int | startTimer (std::chrono::milliseconds interval, Qt::TimerType timerType) |
QThread * | thread () const const |
Static Public Member Functions | |
static CSDControls * | instance () |
Static Public Member Functions inherited from QObject | |
QMetaObject::Connection | connect (const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type) |
QMetaObject::Connection | connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type) |
QMetaObject::Connection | connect (const QObject *sender, PointerToMemberFunction signal, const QObject *context, Functor functor, Qt::ConnectionType type) |
QMetaObject::Connection | connect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method, Qt::ConnectionType type) |
QMetaObject::Connection | connect (const QObject *sender, PointerToMemberFunction signal, Functor functor) |
bool | disconnect (const QMetaObject::Connection &connection) |
bool | disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *method) |
bool | disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method) |
bool | disconnect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method) |
QString | tr (const char *sourceText, const char *disambiguation, int n) |
Additional Inherited Members | |
Public Types inherited from QObject | |
typedef | QObjectList |
Protected Member Functions inherited from QObject | |
virtual void | childEvent (QChildEvent *event) |
virtual void | connectNotify (const QMetaMethod &signal) |
virtual void | customEvent (QEvent *event) |
virtual void | disconnectNotify (const QMetaMethod &signal) |
bool | isSignalConnected (const QMetaMethod &signal) const const |
int | receivers (const char *signal) const const |
QObject * | sender () const const |
int | senderSignalIndex () const const |
virtual void | timerEvent (QTimerEvent *event) |
Detailed Description
The client-side-decorations manager for the MauiKit application.
CSD Window control buttons.
- Since
- org.mauikit.controls
- Warning
- This is an implementation template for the CSD window control buttons, for a complete and final implementation please use the WindowControls component.
- See also
- WindowControlsLinux
Notes
Customize
The window control buttons can be customized, by creating a new theme of button assets, or by picking one from the existing ones.
Creating a new theme is simple. There is three important aspects:
- The config file where the relative paths to the image assets is described.
The following snippet is an example of a config file for the Nitrux CSD theme. The file name must be named 'config.conf'
- The second part is the QML source file, named CSD.qml by convection. If the theme you imagine is not that different from the regular layout, the following snippet of code will do it.
The code consists of a horizontal row layout, where we feed the buttons model and set the component delegate to draw the button.
- See also
- CSDButton Control{id: controlimplicitHeight: _layout.implicitHeight + topPadding + bottomPaddingimplicitWidth: _layout.implicitWidth + leftPadding + rightPaddingspacing: Maui.Style.space.smallpadding: Maui.Style.defaultPaddingbackground: nullcontentItem: Row{id: _layoutspacing: control.spacingToolSeparator{height: 8anchors.verticalCenter: parent.verticalCenter}Repeater{model: buttonsModeldelegate: pluginButton}}Component{id: pluginButtonAbstractButton{id: _buttonhoverEnabled: trueimplicitWidth: 22implicitHeight: 22focusPolicy: Qt.NoFocusMaui.CSDButton{id: buttonstyle: "Nitrux"type: mapType(modelData)isHovered: _button.hoveredisPressed: _button.pressedisFocused: isActiveWindowisMaximized: maximized}contentItem: Maui.Icon{smooth: truesource: button.sourcecolor: Maui.Theme.textColorBehavior on color{Maui.ColorTransition{}}}onClicked:{console.log("NITRUX CSD BUTTON CLICKED", button.type)buttonClicked(button.type)}}}}VehicleSection::Type type(QStringView coachNumber, QStringView coachClassification)QObject * parent() const const
- And the last part are the actual image assets for the buttons.
Definition at line 211 of file csdcontrols.h.
Property Documentation
◆ buttonsModel
|
read |
- Remarks
- This property is read-only
Definition at line 161 of file CSDControls.qml.
◆ canMaximize
|
read |
- Remarks
- This property is read-only
Definition at line 155 of file CSDControls.qml.
◆ canMinimize
|
read |
- Remarks
- This property is read-only
Definition at line 158 of file CSDControls.qml.
◆ enabled
|
readwrite |
Whether the application shall use CSD (client side decorations).
- Note
- This property by default uses the MauiMan global preference, but can it be overridden. To reset it back to the original system preference value set it to
undefined
.
Definition at line 225 of file csdcontrols.h.
◆ isActiveWindow
|
read |
Definition at line 152 of file CSDControls.qml.
◆ maximized
|
read |
Definition at line 150 of file CSDControls.qml.
◆ rightWindowControls
QStringList CSDControls::rightWindowControls |
The model of the window control buttons to be shown, and the order in which they should appear in the right side.
Although the WindowControlsLinux type can be placed arbitrary, it is strongly suggested to always placed them in a right-side area
Definition at line 243 of file csdcontrols.h.
◆ source
|
read |
The source file path of the style being used.
Definition at line 230 of file csdcontrols.h.
◆ styleName
|
read |
The name of the style/theme being used.
This is picked up from the global MauiMan preferences and can not be overridden by the application. This preference is exposed to the end user in the Maui Settings.
Definition at line 237 of file csdcontrols.h.
Constructor & Destructor Documentation
◆ CSDControls()
|
explicit |
Definition at line 13 of file csdcontrols.cpp.
Member Function Documentation
◆ buttonClicked
|
signal |
A window control button has been clicked.
This signal is public and can be mapped to any arbitrary value. Be carefull.
◆ enableCSD()
bool CSDControls::enableCSD | ( | ) | const |
Definition at line 96 of file csdcontrols.cpp.
◆ instance()
|
static |
Retrieves the single instance of MauiApp.
Definition at line 351 of file csdcontrols.cpp.
◆ qmlInstance()
|
inline |
Definition at line 266 of file csdcontrols.h.
◆ resetEnableCSD()
void CSDControls::resetEnableCSD | ( | ) |
Definition at line 111 of file csdcontrols.cpp.
◆ setEnableCSD()
void CSDControls::setEnableCSD | ( | const bool & | value | ) |
Definition at line 101 of file csdcontrols.cpp.
◆ styleName()
QString CSDControls::styleName | ( | ) | const |
Definition at line 122 of file csdcontrols.cpp.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Dec 20 2024 11:55:43 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.