remove hoverpanel title, move actions into applets, add qmllint baseline regen script
This commit is contained in:
parent
c24e18d5da
commit
adb6c21135
26 changed files with 192 additions and 202 deletions
31
shell/applets/AppletActionBar.qml
Normal file
31
shell/applets/AppletActionBar.qml
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
import QtQuick
|
||||
import "../services" as S
|
||||
|
||||
// Action bar for applet-level controls (power toggles, DND, clear-all, etc.)
|
||||
// Place at the top of an applet Column. Children are right-aligned action buttons.
|
||||
Item {
|
||||
id: root
|
||||
|
||||
default property alias actions: _row.children
|
||||
required property color accentColor
|
||||
|
||||
width: parent?.width ?? 0
|
||||
height: 24
|
||||
|
||||
Row {
|
||||
id: _row
|
||||
anchors.right: parent.right
|
||||
anchors.rightMargin: 4
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
spacing: 8
|
||||
layoutDirection: Qt.RightToLeft
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
anchors.bottom: parent.bottom
|
||||
height: 1
|
||||
color: S.Theme.base03
|
||||
}
|
||||
}
|
||||
|
|
@ -9,6 +9,37 @@ Column {
|
|||
onActiveChanged: if (active)
|
||||
S.BluetoothService.refresh()
|
||||
|
||||
AppletActionBar {
|
||||
accentColor: root.accentColor
|
||||
|
||||
Item {
|
||||
width: 20
|
||||
height: 20
|
||||
|
||||
Text {
|
||||
anchors.centerIn: parent
|
||||
text: "\uF011"
|
||||
color: S.BluetoothService.enabled ? root.accentColor : S.Theme.base04
|
||||
font.pixelSize: S.Theme.fontSize
|
||||
font.family: S.Theme.iconFontFamily
|
||||
|
||||
Behavior on color {
|
||||
ColorAnimation {
|
||||
duration: 100
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
HoverHandler {
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
}
|
||||
|
||||
TapHandler {
|
||||
onTapped: S.BluetoothService.setPower(!S.BluetoothService.enabled)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Repeater {
|
||||
model: S.BluetoothService.devices
|
||||
|
||||
|
|
|
|||
|
|
@ -9,6 +9,37 @@ Column {
|
|||
onActiveChanged: if (active)
|
||||
S.NetworkService.refresh()
|
||||
|
||||
AppletActionBar {
|
||||
accentColor: root.accentColor
|
||||
|
||||
Item {
|
||||
width: 20
|
||||
height: 20
|
||||
|
||||
Text {
|
||||
anchors.centerIn: parent
|
||||
text: "\uF011"
|
||||
color: S.NetworkService.wifiEnabled ? root.accentColor : S.Theme.base04
|
||||
font.pixelSize: S.Theme.fontSize
|
||||
font.family: S.Theme.iconFontFamily
|
||||
|
||||
Behavior on color {
|
||||
ColorAnimation {
|
||||
duration: 100
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
HoverHandler {
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
}
|
||||
|
||||
TapHandler {
|
||||
onTapped: S.NetworkService.setWifi(!S.NetworkService.wifiEnabled)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Repeater {
|
||||
model: S.NetworkService.networks
|
||||
|
||||
|
|
|
|||
|
|
@ -13,6 +13,42 @@ Column {
|
|||
_cascadeDismiss();
|
||||
}
|
||||
|
||||
AppletActionBar {
|
||||
accentColor: root.accentColor
|
||||
|
||||
// Clear all
|
||||
Text {
|
||||
text: "\uF1F8"
|
||||
color: _clearHover.hovered ? S.Theme.base08 : S.Theme.base04
|
||||
font.pixelSize: S.Theme.fontSize
|
||||
font.family: S.Theme.iconFontFamily
|
||||
visible: S.NotifService.count > 0
|
||||
|
||||
HoverHandler {
|
||||
id: _clearHover
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
}
|
||||
TapHandler {
|
||||
onTapped: root.cascadeDismiss()
|
||||
}
|
||||
}
|
||||
|
||||
// DND toggle
|
||||
Text {
|
||||
text: S.NotifService.dnd ? "\uDB82\uDE93" : "\uDB80\uDC9C"
|
||||
color: S.NotifService.dnd ? S.Theme.base09 : S.Theme.base04
|
||||
font.pixelSize: S.Theme.fontSize
|
||||
font.family: S.Theme.iconFontFamily
|
||||
|
||||
HoverHandler {
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
}
|
||||
TapHandler {
|
||||
onTapped: S.NotifService.toggleDnd()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// ── Cascade dismiss logic ───────────────────────────────────────────
|
||||
property var _pendingDismissIds: []
|
||||
property var _collapsedGroups: ({})
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
module applets
|
||||
# keep-sorted start
|
||||
AppletActionBar 1.0 AppletActionBar.qml
|
||||
BacklightApplet 1.0 BacklightApplet.qml
|
||||
BatteryApplet 1.0 BatteryApplet.qml
|
||||
ClockApplet 1.0 ClockApplet.qml
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue