aurora8fda16f
aurora: drop notif bell, merge net+bt bar blocks
+22 −18
2 files changed
- M .config/quickshell/aurora/Bar.qml +4 −17
- M .config/quickshell/aurora/BarPill.qml +18 −1
| @@ -157,18 +157,15 @@ PanelWindow { | |||
| 157 | 157 | } | |
| 158 | 158 | } | |
| 159 | 159 | ||
| 160 | + | // net + bt share one block: click the left icon for the net tab, the right one for bt | |
| 160 | 161 | BarPill { | |
| 161 | 162 | icon: Net.wired && !(Net.wifiEnabled && Net.connected !== "") ? Net.wiredIcon | |
| 162 | 163 | : (Net.wifiEnabled ? Theme.wifiIcon(Net.connected !== "" ? Net.activeSignal : 0) : Theme.iWifiOff) | |
| 163 | 164 | tint: Net.portal ? Theme.err : ((Net.wired || (Net.wifiEnabled && Net.connected !== "")) ? Theme.fg : Theme.dim) | |
| 165 | + | icon2: bar.adapter === null ? "" : (!bar.btOn ? Theme.iBtOff : (bar.btLink ? Theme.iBtConn : Theme.iBt)) | |
| 166 | + | tint2: bar.btLink ? Theme.fg : Theme.dim | |
| 164 | 167 | onActivated: bar.togglePanel("net", bar.modelData) | |
| 165 | − | } | |
| 166 | − | ||
| 167 | − | BarPill { | |
| 168 | − | visible: bar.adapter !== null | |
| 169 | − | icon: !bar.btOn ? Theme.iBtOff : (bar.btLink ? Theme.iBtConn : Theme.iBt) | |
| 170 | − | tint: bar.btLink ? Theme.fg : Theme.dim | |
| 171 | − | onActivated: bar.togglePanel("bt", bar.modelData) | |
| 168 | + | onActivated2: bar.togglePanel("bt", bar.modelData) | |
| 172 | 169 | } | |
| 173 | 170 | ||
| 174 | 171 | BarPill { | |
| @@ -180,16 +177,6 @@ PanelWindow { | |||
| 180 | 177 | onActivated: bar.togglePanel("sys", bar.modelData) | |
| 181 | 178 | } | |
| 182 | 179 | ||
| 183 | − | BarPill { | |
| 184 | − | icon: Notifs.dnd ? Theme.iBellOff : Theme.iBell | |
| 185 | − | text: Notifs.count > 0 ? String(Notifs.count) : "" | |
| 186 | − | tint: Notifs.dnd ? Theme.dim : Theme.fg | |
| 187 | − | onActivated: button => { | |
| 188 | − | if (button === Qt.RightButton) Notifs.dnd = !Notifs.dnd | |
| 189 | − | else bar.togglePanel("notif", bar.modelData) | |
| 190 | − | } | |
| 191 | − | } | |
| 192 | − | ||
| 193 | 180 | BarPill { | |
| 194 | 181 | icon: Theme.iCal | |
| 195 | 182 | text: Qt.formatDateTime(clock.date, "dd MMM yyyy") | |
| @@ -7,7 +7,11 @@ Item { | |||
| 7 | 7 | property string text: "" | |
| 8 | 8 | property color tint: Theme.fg | |
| 9 | 9 | property color underline: Theme.accent | |
| 10 | + | // optional second icon in the same block, with its own click (activated2) | |
| 11 | + | property string icon2: "" | |
| 12 | + | property color tint2: Theme.fg | |
| 10 | 13 | signal activated(int button) | |
| 14 | + | signal activated2(int button) | |
| 11 | 15 | signal scrolled(int dir) | |
| 12 | 16 | ||
| 13 | 17 | implicitWidth: row.implicitWidth + 24 | |
| @@ -45,13 +49,26 @@ Item { | |||
| 45 | 49 | font.bold: true | |
| 46 | 50 | anchors.verticalCenter: parent.verticalCenter | |
| 47 | 51 | } | |
| 52 | + | Text { | |
| 53 | + | id: second | |
| 54 | + | visible: p.icon2 !== "" | |
| 55 | + | text: p.icon2 | |
| 56 | + | color: p.tint2 | |
| 57 | + | font.family: Theme.font | |
| 58 | + | font.pixelSize: Theme.fontSize + 1 | |
| 59 | + | anchors.verticalCenter: parent.verticalCenter | |
| 60 | + | } | |
| 48 | 61 | } | |
| 49 | 62 | MouseArea { | |
| 50 | 63 | id: m | |
| 51 | 64 | anchors.fill: parent | |
| 52 | 65 | hoverEnabled: true | |
| 53 | 66 | acceptedButtons: Qt.LeftButton | Qt.RightButton | Qt.MiddleButton | |
| 54 | − | onClicked: mouse => p.activated(mouse.button) | |
| 67 | + | onClicked: mouse => { | |
| 68 | + | // split at the middle of the gap before the second icon | |
| 69 | + | if (second.visible && mouse.x >= row.x + second.x - row.spacing / 2) p.activated2(mouse.button) | |
| 70 | + | else p.activated(mouse.button) | |
| 71 | + | } | |
| 55 | 72 | onWheel: w => p.scrolled(w.angleDelta.y > 0 ? 1 : -1) | |
| 56 | 73 | } | |
| 57 | 74 | } | |