From 4ba4b7614fb645ebaf3570c20cb6ea2e1c68cbcf Mon Sep 17 00:00:00 2001 From: reionwong Date: Tue, 28 Sep 2021 19:39:30 +0800 Subject: [PATCH] Update icons --- qml/ControlCenter.qml | 18 +++++++++++------ qml/main.qml | 38 +++-------------------------------- src/appmenu/appmenu.cpp | 16 +++++++-------- src/appmenu/appmenuapplet.cpp | 10 ++++----- 4 files changed, 28 insertions(+), 54 deletions(-) diff --git a/qml/ControlCenter.qml b/qml/ControlCenter.qml index 77c5d71..8a61f15 100644 --- a/qml/ControlCenter.qml +++ b/qml/ControlCenter.qml @@ -267,12 +267,15 @@ ControlCenterDialog { RowLayout { anchors.fill: brightnessItemBg - anchors.margins: FishUI.Units.largeSpacing + anchors.leftMargin: FishUI.Units.largeSpacing + anchors.rightMargin: FishUI.Units.largeSpacing + anchors.topMargin: FishUI.Units.smallSpacing + anchors.bottomMargin: FishUI.Units.smallSpacing spacing: FishUI.Units.largeSpacing Image { - width: parent.height * 0.8 - height: parent.height * 0.8 + height: 16 + width: height sourceSize: Qt.size(width, height) source: "qrc:/images/" + (FishUI.Theme.darkMode ? "dark" : "light") + "/brightness.svg" smooth: false @@ -316,12 +319,15 @@ ControlCenterDialog { RowLayout { anchors.fill: volumeItemBg - anchors.margins: FishUI.Units.largeSpacing + anchors.leftMargin: FishUI.Units.largeSpacing + anchors.rightMargin: FishUI.Units.largeSpacing + anchors.topMargin: FishUI.Units.smallSpacing + anchors.bottomMargin: FishUI.Units.smallSpacing spacing: FishUI.Units.largeSpacing Image { - width: parent.height * 0.8 - height: parent.height * 0.8 + height: 16 + width: height sourceSize: Qt.size(width, height) source: "qrc:/images/" + (FishUI.Theme.darkMode ? "dark" : "light") + "/" + volume.iconName + ".svg" smooth: false diff --git a/qml/main.qml b/qml/main.qml index fed9b3b..9c08db8 100644 --- a/qml/main.qml +++ b/qml/main.qml @@ -345,47 +345,15 @@ Item { } } -// Image { -// id: shutdownIcon -// width: rootItem.iconSize -// height: width -// sourceSize: Qt.size(width, height) -// source: "qrc:/images/" + (rootItem.darkMode ? "dark/" : "light/") + "system-shutdown-symbolic.svg" -// asynchronous: true -// Layout.alignment: Qt.AlignCenter -// visible: !volumeIcon.visible && !batteryIcon.visible && !wirelessIcon.visible -// antialiasing: true -// smooth: false -// } - } - } - - StandardItem { - id: shutdownItem - - visible: !batteryIcon.visible - animationEnabled: true - Layout.fillHeight: true - Layout.preferredWidth: shutdownLayout.implicitWidth + FishUI.Units.largeSpacing - - onClicked: process.startDetached("cutefish-shutdown") - - RowLayout { - id: shutdownLayout - anchors.fill: parent - anchors.leftMargin: FishUI.Units.smallSpacing - anchors.rightMargin: FishUI.Units.smallSpacing - - spacing: 0 - Image { - id: _shutdownIcon - source: "qrc:/images/" + (rootItem.darkMode ? "dark/" : "light/") + "system-shutdown-symbolic.svg" + id: shutdownIcon width: rootItem.iconSize height: width sourceSize: Qt.size(width, height) + source: "qrc:/images/" + (rootItem.darkMode ? "dark/" : "light/") + "system-shutdown-symbolic.svg" asynchronous: true Layout.alignment: Qt.AlignCenter + visible: !batteryIcon.visible antialiasing: true smooth: false } diff --git a/src/appmenu/appmenu.cpp b/src/appmenu/appmenu.cpp index 4749402..d726b93 100644 --- a/src/appmenu/appmenu.cpp +++ b/src/appmenu/appmenu.cpp @@ -43,19 +43,19 @@ static const QByteArray s_x11AppMenuObjectPathPropertyName = QByteArrayLiteral(" AppMenu::AppMenu(QObject *parent) : QObject(parent) - , m_appmenuDBus(new AppmenuDBus(this)) +// , m_appmenuDBus(new AppmenuDBus(this)) { reconfigure(); - m_appmenuDBus->connectToBus(); +// m_appmenuDBus->connectToBus(); - connect(m_appmenuDBus, &AppmenuDBus::appShowMenu, this, &AppMenu::slotShowMenu); - connect(m_appmenuDBus, &AppmenuDBus::reconfigured, this, &AppMenu::reconfigure); +// connect(m_appmenuDBus, &AppmenuDBus::appShowMenu, this, &AppMenu::slotShowMenu); +// connect(m_appmenuDBus, &AppmenuDBus::reconfigured, this, &AppMenu::reconfigure); - // transfer our signals to dbus - connect(this, &AppMenu::showRequest, m_appmenuDBus, &AppmenuDBus::showRequest); - connect(this, &AppMenu::menuHidden, m_appmenuDBus, &AppmenuDBus::menuHidden); - connect(this, &AppMenu::menuShown, m_appmenuDBus, &AppmenuDBus::menuShown); +// // transfer our signals to dbus +// connect(this, &AppMenu::showRequest, m_appmenuDBus, &AppmenuDBus::showRequest); +// connect(this, &AppMenu::menuHidden, m_appmenuDBus, &AppmenuDBus::menuHidden); +// connect(this, &AppMenu::menuShown, m_appmenuDBus, &AppmenuDBus::menuShown); m_menuViewWatcher = new QDBusServiceWatcher(QStringLiteral("com.cutefish.cappmenuview"), QDBusConnection::sessionBus(), diff --git a/src/appmenu/appmenuapplet.cpp b/src/appmenu/appmenuapplet.cpp index c555862..bf58588 100644 --- a/src/appmenu/appmenuapplet.cpp +++ b/src/appmenu/appmenuapplet.cpp @@ -44,11 +44,11 @@ AppMenuApplet::AppMenuApplet(QObject *parent) { ++s_refs; // if we're the first, register the service - if (s_refs == 1) { - QDBusConnection::sessionBus().interface()->registerService(viewService(), - QDBusConnectionInterface::QueueService, - QDBusConnectionInterface::DontAllowReplacement); - } +// if (s_refs == 1) { +// QDBusConnection::sessionBus().interface()->registerService(viewService(), +// QDBusConnectionInterface::QueueService, +// QDBusConnectionInterface::DontAllowReplacement); +// } /*it registers or unregisters the service when the destroyed value of the applet change, and not in the dtor, because: when we "delete" an applet, it just hides it for about a minute setting its status