Add app menu svg support for aurorae

This adds support for a proper app menu icon for aurorae svg
decorations. The appmenu.svg(z) file will be used for the icon if it
exists. If not, it will fallback to the window's icon, the same as
before.

BUG: 404322
wilder/Plasma/6.3
tusooa the west wind 1 year ago committed by Vlad Zahorodnii
parent 4795daf39b
commit ca686f651a
  1. 2
      src/plugins/kdecorations/aurorae/src/lib/auroraetheme.cpp
  2. 2
      src/plugins/kdecorations/aurorae/src/lib/auroraetheme.h
  3. 19
      src/plugins/kdecorations/aurorae/src/qml/AppMenuButton.qml
  4. 3
      src/plugins/kdecorations/aurorae/src/qml/AuroraeButton.qml

@ -120,6 +120,7 @@ void AuroraeTheme::loadTheme(const QString &name, const KConfig &config)
d->initButtonFrame(KeepBelowButton);
d->initButtonFrame(ShadeButton);
d->initButtonFrame(HelpButton);
d->initButtonFrame(AppMenuButton);
d->themeConfig.load(config);
Q_EMIT themeChanged();
@ -411,6 +412,7 @@ BUTTON_PATH(keepAboveButtonPath, KeepAboveButton)
BUTTON_PATH(keepBelowButtonPath, KeepBelowButton)
BUTTON_PATH(shadeButtonPath, ShadeButton)
BUTTON_PATH(helpButtonPath, HelpButton)
BUTTON_PATH(appMenuButtonPath, AppMenuButton)
#undef BUTTON_PATH

@ -98,6 +98,7 @@ class /*LIBAURORAE_EXPORT*/ AuroraeTheme : public QObject
Q_PROPERTY(QString keepBelowButtonPath READ keepBelowButtonPath NOTIFY themeChanged)
Q_PROPERTY(QString shadeButtonPath READ shadeButtonPath NOTIFY themeChanged)
Q_PROPERTY(QString helpButtonPath READ helpButtonPath NOTIFY themeChanged)
Q_PROPERTY(QString appMenuButtonPath READ appMenuButtonPath NOTIFY themeChanged)
Q_PROPERTY(QColor activeTextColor READ activeTextColor NOTIFY themeChanged)
Q_PROPERTY(QColor inactiveTextColor READ inactiveTextColor NOTIFY themeChanged)
Q_PROPERTY(Qt::Alignment horizontalAlignment READ alignment NOTIFY themeChanged)
@ -156,6 +157,7 @@ public:
QString keepBelowButtonPath() const;
QString shadeButtonPath() const;
QString helpButtonPath() const;
QString appMenuButtonPath() const;
QColor activeTextColor() const;
QColor inactiveTextColor() const;
Qt::Alignment alignment() const;

@ -7,12 +7,23 @@ import QtQuick
import org.kde.kirigami 2.20 as Kirigami
import org.kde.kwin.decoration
DecorationButton {
Item {
id: appMenuButton
buttonType: DecorationOptions.DecorationButtonApplicationMenu
visible: decoration.client.hasApplicationMenu
Kirigami.Icon {
AuroraeButton {
id: primary
anchors.fill: parent
source: decoration.client.icon
buttonType: DecorationOptions.DecorationButtonApplicationMenu
visible: auroraeTheme.appMenuButtonPath
}
DecorationButton {
id: fallback
anchors.fill: parent
buttonType: DecorationOptions.DecorationButtonApplicationMenu
visible: !auroraeTheme.appMenuButtonPath
Kirigami.Icon {
anchors.fill: parent
source: decoration.client.icon
}
}
}

@ -52,6 +52,9 @@ DecorationButton {
case DecorationOptions.DecorationButtonQuickHelp:
// help
return auroraeTheme.helpButtonPath;
case DecorationOptions.DecorationButtonApplicationMenu:
// app menu
return auroraeTheme.appMenuButtonPath;
case DecorationOptions.DecorationButtonMinimize:
// minimize
return auroraeTheme.minimizeButtonPath;

Loading…
Cancel
Save