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
|
|
@ -10,7 +10,6 @@ M.BarModule {
|
|||
active: S.Modules.backlight.enable && S.BacklightService.available
|
||||
tooltip: "Brightness: " + percent + "%"
|
||||
panelNamespace: "nova-backlight"
|
||||
panelTitle: "Brightness"
|
||||
panelContentWidth: 200
|
||||
panelComponent: Component {
|
||||
C.BacklightApplet {
|
||||
|
|
|
|||
|
|
@ -30,10 +30,8 @@ Row {
|
|||
|
||||
// Panel configuration - set by modules that have applets
|
||||
property Component panelComponent: null
|
||||
property string panelTitle: ""
|
||||
property string panelNamespace: "nova-panel"
|
||||
property real panelContentWidth: 220
|
||||
property Component titleActionsComponent: null
|
||||
|
||||
signal tapped
|
||||
|
||||
|
|
@ -108,9 +106,7 @@ Row {
|
|||
anchorItem: root
|
||||
accentColor: root.accentColor
|
||||
panelNamespace: root.panelNamespace
|
||||
panelTitle: root.panelTitle
|
||||
contentWidth: root.panelContentWidth
|
||||
titleActionsComponent: root.titleActionsComponent
|
||||
onDismissed: root.dismissPanel()
|
||||
|
||||
Loader {
|
||||
|
|
|
|||
|
|
@ -10,7 +10,6 @@ M.BarModule {
|
|||
active: S.Modules.battery.enable && S.BatteryService.available
|
||||
tooltip: "Battery: " + Math.round(S.BatteryService.percent) + "%" + (S.BatteryService.charging ? " (charging)" : "")
|
||||
panelNamespace: "nova-battery"
|
||||
panelTitle: "Battery"
|
||||
panelContentWidth: 240
|
||||
panelComponent: Component {
|
||||
C.BatteryApplet {
|
||||
|
|
|
|||
|
|
@ -16,36 +16,7 @@ M.BarModule {
|
|||
return "Bluetooth: on";
|
||||
}
|
||||
panelNamespace: "nova-bluetooth"
|
||||
panelTitle: "Bluetooth"
|
||||
panelContentWidth: 250
|
||||
titleActionsComponent: Component {
|
||||
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)
|
||||
}
|
||||
}
|
||||
}
|
||||
panelComponent: Component {
|
||||
C.BluetoothApplet {
|
||||
width: parent.width
|
||||
|
|
|
|||
|
|
@ -10,7 +10,6 @@ M.BarModule {
|
|||
spacing: S.Theme.moduleSpacing
|
||||
tooltip: Qt.formatDateTime(clock.date, "dddd, dd. MMMM yyyy")
|
||||
panelNamespace: "nova-clock"
|
||||
panelTitle: Qt.formatTime(clock.date, "HH:mm:ss")
|
||||
panelContentWidth: 220
|
||||
panelComponent: Component {
|
||||
C.ClockApplet {
|
||||
|
|
|
|||
|
|
@ -10,7 +10,6 @@ M.BarModule {
|
|||
spacing: Math.max(1, S.Theme.moduleSpacing - 2)
|
||||
tooltip: "CPU: " + S.SystemStats.cpuUsage + "% @ " + S.SystemStats.cpuFreqGhz.toFixed(2) + " GHz"
|
||||
panelNamespace: "nova-cpu"
|
||||
panelTitle: "CPU"
|
||||
panelContentWidth: 260
|
||||
panelComponent: Component {
|
||||
C.CpuApplet {
|
||||
|
|
|
|||
|
|
@ -10,7 +10,6 @@ M.BarModule {
|
|||
spacing: Math.max(1, S.Theme.moduleSpacing - 2)
|
||||
tooltip: "Disk: " + _rootPct + "% used"
|
||||
panelNamespace: "nova-disk"
|
||||
panelTitle: "Disk"
|
||||
panelContentWidth: 260
|
||||
panelComponent: Component {
|
||||
C.DiskApplet {
|
||||
|
|
|
|||
|
|
@ -10,7 +10,6 @@ M.BarModule {
|
|||
active: S.Modules.gpu.enable && S.SystemStats.gpuAvailable
|
||||
tooltip: "GPU: " + S.SystemStats.gpuUsage + "%"
|
||||
panelNamespace: "nova-gpu"
|
||||
panelTitle: "GPU"
|
||||
panelContentWidth: 240
|
||||
panelComponent: Component {
|
||||
C.GpuApplet {
|
||||
|
|
|
|||
|
|
@ -14,12 +14,9 @@ PanelWindow {
|
|||
|
||||
property bool showPanel: false
|
||||
property Item anchorItem: null
|
||||
property real anchorX: -1
|
||||
signal dismissed
|
||||
|
||||
required property color accentColor
|
||||
property string panelTitle: ""
|
||||
property Component titleActionsComponent: null
|
||||
property string panelNamespace: "nova-panel"
|
||||
property real contentWidth: 220
|
||||
|
||||
|
|
@ -50,8 +47,6 @@ PanelWindow {
|
|||
if (root.anchorItem) {
|
||||
const pt = root.anchorItem.mapToGlobal(root.anchorItem.width / 2, 0);
|
||||
cx = pt.x - (scr?.x ?? 0);
|
||||
} else if (root.anchorX >= 0) {
|
||||
cx = root.anchorX;
|
||||
} else {
|
||||
cx = sw / 2;
|
||||
}
|
||||
|
|
@ -206,42 +201,6 @@ PanelWindow {
|
|||
id: _panelColumn
|
||||
width: root.contentWidth
|
||||
|
||||
// Header row: title + action buttons
|
||||
Item {
|
||||
id: _headerItem
|
||||
visible: root.panelTitle !== "" || root.titleActionsComponent !== null
|
||||
width: parent.width
|
||||
height: 24
|
||||
|
||||
Text {
|
||||
visible: root.panelTitle !== ""
|
||||
anchors.left: parent.left
|
||||
anchors.leftMargin: 12
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
text: root.panelTitle
|
||||
color: root.accentColor
|
||||
font.pixelSize: S.Theme.fontSize - 1
|
||||
font.bold: true
|
||||
font.family: S.Theme.fontFamily
|
||||
}
|
||||
|
||||
Loader {
|
||||
id: _titleActionsLoader
|
||||
anchors.right: parent.right
|
||||
anchors.rightMargin: 4
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
sourceComponent: root.titleActionsComponent
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
anchors.bottom: parent.bottom
|
||||
height: 1
|
||||
color: S.Theme.base03
|
||||
}
|
||||
}
|
||||
|
||||
Flickable {
|
||||
id: _flickable
|
||||
width: parent.width
|
||||
|
|
@ -250,7 +209,7 @@ PanelWindow {
|
|||
clip: contentHeight > height
|
||||
boundsBehavior: Flickable.StopAtBounds
|
||||
|
||||
readonly property real _maxContentHeight: (root.screen?.height ?? 1080) * 0.6 - (_headerItem.visible ? _headerItem.height : 0)
|
||||
readonly property real _maxContentHeight: (root.screen?.height ?? 1080) * 0.6
|
||||
|
||||
Column {
|
||||
id: panelContent
|
||||
|
|
|
|||
|
|
@ -10,7 +10,6 @@ M.BarModule {
|
|||
spacing: Math.max(1, S.Theme.moduleSpacing - 2)
|
||||
tooltip: "Memory: " + usedGb.toFixed(1) + " / " + totalGb.toFixed(1) + " GB"
|
||||
panelNamespace: "nova-memory"
|
||||
panelTitle: "Memory"
|
||||
panelContentWidth: 240
|
||||
panelComponent: Component {
|
||||
C.MemoryApplet {
|
||||
|
|
|
|||
|
|
@ -12,7 +12,6 @@ M.BarModule {
|
|||
active: S.Modules.mpris.enable && S.MprisService.player !== null
|
||||
tooltip: S.MprisService.player ? (S.MprisService.player.trackTitle || S.MprisService.player.identity || "Media") + (S.MprisService.playing ? " (playing)" : " (paused)") : "Media"
|
||||
panelNamespace: "nova-mpris"
|
||||
panelTitle: "Now Playing"
|
||||
panelContentWidth: 280
|
||||
panelComponent: Component {
|
||||
C.MprisApplet {
|
||||
|
|
|
|||
|
|
@ -18,36 +18,7 @@ M.BarModule {
|
|||
return "Network: disconnected";
|
||||
}
|
||||
panelNamespace: "nova-network"
|
||||
panelTitle: "Wi-Fi"
|
||||
panelContentWidth: 250
|
||||
titleActionsComponent: Component {
|
||||
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)
|
||||
}
|
||||
}
|
||||
}
|
||||
panelComponent: Component {
|
||||
C.NetworkApplet {
|
||||
width: parent.width
|
||||
|
|
|
|||
|
|
@ -11,60 +11,15 @@ M.BarModule {
|
|||
spacing: S.Theme.moduleSpacing
|
||||
tooltip: S.NotifService.count > 0 ? "Notifications: " + S.NotifService.count + (S.NotifService.dnd ? " (DND)" : "") : (S.NotifService.dnd ? "Do not disturb" : "No notifications")
|
||||
panelNamespace: "nova-notifications"
|
||||
panelTitle: "Notifications"
|
||||
panelContentWidth: 350
|
||||
titleActionsComponent: Component {
|
||||
Row {
|
||||
spacing: 8
|
||||
|
||||
// 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
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
|
||||
HoverHandler {
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
}
|
||||
TapHandler {
|
||||
onTapped: S.NotifService.toggleDnd()
|
||||
}
|
||||
}
|
||||
|
||||
// Clear all
|
||||
Text {
|
||||
text: "\uF1F8"
|
||||
color: _clearHover.hovered ? S.Theme.base08 : S.Theme.base04
|
||||
font.pixelSize: S.Theme.fontSize
|
||||
font.family: S.Theme.iconFontFamily
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
visible: S.NotifService.count > 0
|
||||
|
||||
HoverHandler {
|
||||
id: _clearHover
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
}
|
||||
TapHandler {
|
||||
onTapped: if (root._notifApplet)
|
||||
root._notifApplet.cascadeDismiss()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
panelComponent: Component {
|
||||
C.NotifApplet {
|
||||
width: parent.width
|
||||
contentWidth: root.panelContentWidth
|
||||
accentColor: root.accentColor
|
||||
Component.onCompleted: root._notifApplet = this
|
||||
Component.onDestruction: root._notifApplet = null
|
||||
}
|
||||
}
|
||||
|
||||
property var _notifApplet: null
|
||||
|
||||
readonly property bool hasUrgent: S.NotifService.list.some(n => n.urgency === NotificationUrgency.Critical && n.state !== "dismissed")
|
||||
|
||||
M.BarIcon {
|
||||
|
|
|
|||
|
|
@ -10,7 +10,6 @@ M.BarModule {
|
|||
active: S.Modules.power.enable
|
||||
tooltip: "Power menu"
|
||||
panelNamespace: "nova-power"
|
||||
panelTitle: "Power"
|
||||
panelContentWidth: 180
|
||||
panelComponent: Component {
|
||||
C.PowerApplet {
|
||||
|
|
|
|||
|
|
@ -10,7 +10,6 @@ M.BarModule {
|
|||
spacing: Math.max(1, S.Theme.moduleSpacing - 2)
|
||||
tooltip: "Temperature: " + _temp + "\u00B0C"
|
||||
panelNamespace: "nova-temperature"
|
||||
panelTitle: "Temperature"
|
||||
panelContentWidth: 220
|
||||
panelComponent: Component {
|
||||
C.TemperatureApplet {
|
||||
|
|
|
|||
|
|
@ -100,7 +100,7 @@ M.BarModule {
|
|||
accentColor: root.accentColor
|
||||
handle: iconItem.modelData.menu
|
||||
screen: QsWindow.window?.screen ?? null
|
||||
anchorX: iconItem.mapToGlobal(iconItem.width / 2, 0).x - (QsWindow.window?.screen?.x ?? 0)
|
||||
anchorItem: iconItem
|
||||
onDismissed: {
|
||||
menuLoader.active = false;
|
||||
root._activeMenu = null;
|
||||
|
|
|
|||
|
|
@ -11,7 +11,6 @@ M.BarModule {
|
|||
spacing: S.Theme.moduleSpacing
|
||||
tooltip: "Volume: " + Math.round(volume * 100) + "%" + (muted ? " (muted)" : "")
|
||||
panelNamespace: "nova-volume"
|
||||
panelTitle: "Sound"
|
||||
panelContentWidth: 220
|
||||
panelComponent: Component {
|
||||
C.VolumeApplet {
|
||||
|
|
|
|||
|
|
@ -10,7 +10,6 @@ M.BarModule {
|
|||
active: S.Modules.weather.enable && S.WeatherService.available
|
||||
tooltip: "Weather"
|
||||
panelNamespace: "nova-weather"
|
||||
panelTitle: "Weather"
|
||||
panelContentWidth: 280
|
||||
panelComponent: Component {
|
||||
C.WeatherApplet {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue