Hide if launchpad is encountered

pull/7/head
reionwong 4 years ago
parent 8a74121853
commit 40426b72bc

@ -71,14 +71,14 @@ Item {
color: {
if (control.checked) {
return (FishUI.Theme.darkMode) ? Qt.rgba(255, 255, 255, 0.2) : Qt.rgba(0, 0, 0, 0.1)
return (rootItem.darkMode) ? Qt.rgba(255, 255, 255, 0.2) : Qt.rgba(0, 0, 0, 0.1)
}
if (_mouseArea.containsMouse) {
if (_mouseArea.containsPress)
return (FishUI.Theme.darkMode) ? Qt.rgba(255, 255, 255, 0.3) : Qt.rgba(0, 0, 0, 0.2)
return (rootItem.darkMode) ? Qt.rgba(255, 255, 255, 0.3) : Qt.rgba(0, 0, 0, 0.2)
else
return (FishUI.Theme.darkMode) ? Qt.rgba(255, 255, 255, 0.2) : Qt.rgba(0, 0, 0, 0.1)
return (rootItem.darkMode) ? Qt.rgba(255, 255, 255, 0.2) : Qt.rgba(0, 0, 0, 0.1)
}
return "transparent"

@ -34,6 +34,12 @@ Item {
LayoutMirroring.enabled: Qt.application.layoutDirection === Qt.RightToLeft
LayoutMirroring.childrenInherit: true
property bool darkMode: FishUI.Theme.darkMode
property color textColor: rootItem.darkMode ? "#FFFFFF" : "#000000";
// Hide if launchpad is encountered
opacity: acticity.launchPad && windowHelper.compositing ? 0 : 1
Rectangle {
id: background
anchors.fill: parent
@ -104,7 +110,7 @@ Item {
text: acticity.title
Layout.fillWidth: true
elide: Qt.ElideRight
color: FishUI.Theme.darkMode ? 'white' : 'black'
color: rootItem.textColor
visible: text
Layout.alignment: Qt.AlignVCenter
font.pointSize: rootItem.height ? rootItem.height / 3 : 1
@ -152,7 +158,7 @@ Item {
Text {
id: _actionText
anchors.centerIn: parent
color: FishUI.Theme.darkMode ? 'white' : 'black'
color: rootItem.textColor
text: {
var text = activeMenu
text = text.replace(/([^&]*)&(.)([^&]*)/g, function (match, p1, p2, p3) {
@ -229,7 +235,7 @@ Item {
width: trayView.itemWidth
height: ListView.view.height
property bool darkMode: FishUI.Theme.darkMode
property bool darkMode: rootItem.darkMode
onDarkModeChanged: updateTimer.restart()
Timer {
@ -283,7 +289,7 @@ Item {
Image {
id: volumeIcon
visible: volume.isValid && status === Image.Ready
source: "qrc:/images/" + (FishUI.Theme.darkMode ? "dark/" : "light/") + volume.iconName + ".svg"
source: "qrc:/images/" + (rootItem.darkMode ? "dark/" : "light/") + volume.iconName + ".svg"
width: rootItem.iconSize
height: width
sourceSize: Qt.size(width, height)
@ -296,7 +302,7 @@ Item {
width: rootItem.iconSize
height: width
sourceSize: Qt.size(width, height)
source: activeConnection.wirelessIcon ? "qrc:/images/" + (FishUI.Theme.darkMode ? "dark/" : "light/") + activeConnection.wirelessIcon + ".svg" : ""
source: activeConnection.wirelessIcon ? "qrc:/images/" + (rootItem.darkMode ? "dark/" : "light/") + activeConnection.wirelessIcon + ".svg" : ""
asynchronous: true
Layout.alignment: Qt.AlignCenter
visible: enabledConnections.wirelessHwEnabled &&
@ -314,14 +320,14 @@ Item {
height: rootItem.iconSize
width: height + 6
sourceSize: Qt.size(width, height)
source: "qrc:/images/" + (FishUI.Theme.darkMode ? "dark/" : "light/") + battery.iconSource
source: "qrc:/images/" + (rootItem.darkMode ? "dark/" : "light/") + battery.iconSource
Layout.alignment: Qt.AlignCenter
}
Label {
text: battery.chargePercent + "%"
font.pointSize: rootItem.height ? rootItem.height / 3 : 1
color: FishUI.Theme.darkMode ? 'white' : 'black'
color: rootItem.textColor
visible: battery.showPercentage
}
}
@ -330,7 +336,7 @@ Item {
id: timeLabel
Layout.alignment: Qt.AlignCenter
font.pointSize: rootItem.height ? rootItem.height / 3 : 1
color: FishUI.Theme.darkMode ? 'white' : 'black'
color: rootItem.textColor
Timer {
interval: 1000

@ -53,10 +53,6 @@ StatusBar::StatusBar(QQuickView *parent)
updateGeometry();
setVisible(true);
connect(m_acticity, &Activity::launchPadChanged, this, [=] {
setVisible(!m_acticity->launchPad());
});
connect(qApp->primaryScreen(), &QScreen::virtualGeometryChanged, this, &StatusBar::updateGeometry);
connect(qApp->primaryScreen(), &QScreen::geometryChanged, this, &StatusBar::updateGeometry);
}

@ -33,6 +33,9 @@ public:
void updateGeometry();
void updateViewStruts();
signals:
void launchPadChanged();
private:
Activity *m_acticity;
};

Loading…
Cancel
Save