add tooltips
This commit is contained in:
parent
7ca7e1e952
commit
6370732e4e
15 changed files with 123 additions and 1 deletions
|
|
@ -1,5 +1,6 @@
|
|||
import QtQuick
|
||||
import Quickshell.Io
|
||||
import QtQuick.Controls
|
||||
import "." as M
|
||||
|
||||
Row {
|
||||
|
|
@ -52,4 +53,9 @@ Row {
|
|||
WheelHandler {
|
||||
onWheel: event => root.adjust(event.angleDelta.y)
|
||||
}
|
||||
HoverHandler { id: hover }
|
||||
ToolTip {
|
||||
visible: hover.hovered
|
||||
text: "Brightness: " + root.percent + "%"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import Quickshell.Services.UPower
|
||||
import "." as M
|
||||
|
||||
|
|
@ -26,4 +27,16 @@ Row {
|
|||
color: root.pct < 15 ? M.Theme.base08 : M.Theme.base05
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
}
|
||||
|
||||
HoverHandler { id: hover }
|
||||
ToolTip {
|
||||
visible: hover.hovered
|
||||
text: {
|
||||
const state = root.charging ? "Charging" : "Discharging";
|
||||
const t = root.charging ? root.dev?.timeToFull : root.dev?.timeToEmpty;
|
||||
const mins = t ? Math.round(t / 60) : 0;
|
||||
const timeStr = mins > 0 ? "\n" + Math.floor(mins / 60) + "h " + (mins % 60) + "m " + (root.charging ? "until full" : "remaining") : "";
|
||||
return state + " — " + Math.round(root.pct) + "%" + timeStr;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
import QtQuick
|
||||
import Quickshell.Io
|
||||
import QtQuick.Controls
|
||||
import "." as M
|
||||
|
||||
Row {
|
||||
|
|
@ -41,4 +42,9 @@ Row {
|
|||
font.family: M.Theme.fontFamily
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
}
|
||||
HoverHandler { id: hover }
|
||||
ToolTip {
|
||||
visible: hover.hovered
|
||||
text: root.status === "connected" ? "Bluetooth: " + root.device : "Bluetooth: on"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,11 +1,12 @@
|
|||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import Quickshell
|
||||
import "." as M
|
||||
|
||||
Text {
|
||||
SystemClock {
|
||||
id: clock
|
||||
precision: SystemClock.Minutes
|
||||
precision: SystemClock.Seconds
|
||||
}
|
||||
|
||||
text: Qt.formatDateTime(clock.date, "ddd, dd. MMM HH:mm")
|
||||
|
|
@ -13,4 +14,10 @@ Text {
|
|||
font.pixelSize: M.Theme.fontSize + 1
|
||||
font.family: M.Theme.fontFamily
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
|
||||
HoverHandler { id: hover }
|
||||
ToolTip {
|
||||
visible: hover.hovered
|
||||
text: Qt.formatDateTime(clock.date, "dddd, dd. MMMM yyyy\nHH:mm:ss")
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
import QtQuick
|
||||
import Quickshell.Io
|
||||
import QtQuick.Controls
|
||||
import "." as M
|
||||
|
||||
Row {
|
||||
|
|
@ -63,4 +64,9 @@ Row {
|
|||
font.family: M.Theme.fontFamily
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
}
|
||||
HoverHandler { id: hover }
|
||||
ToolTip {
|
||||
visible: hover.hovered
|
||||
text: "CPU: " + root.usage + "%\n" + root.freqGhz.toFixed(2) + " GHz"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
import QtQuick
|
||||
import Quickshell.Io
|
||||
import QtQuick.Controls
|
||||
import "." as M
|
||||
|
||||
Row {
|
||||
|
|
@ -42,4 +43,9 @@ Row {
|
|||
font.family: M.Theme.fontFamily
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
}
|
||||
HoverHandler { id: hover }
|
||||
ToolTip {
|
||||
visible: hover.hovered
|
||||
text: root.freePct + "% free of " + root.totalTb.toFixed(1) + " TB"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
import QtQuick
|
||||
import Quickshell.Io
|
||||
import QtQuick.Controls
|
||||
import "." as M
|
||||
|
||||
M.BarIcon {
|
||||
|
|
@ -22,4 +23,9 @@ M.BarIcon {
|
|||
toggle.running = true;
|
||||
}
|
||||
}
|
||||
HoverHandler { id: hover }
|
||||
ToolTip {
|
||||
visible: hover.hovered
|
||||
text: "Idle inhibition: " + (root.active ? "active" : "inactive")
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
import QtQuick
|
||||
import Quickshell.Io
|
||||
import QtQuick.Controls
|
||||
import "." as M
|
||||
|
||||
Row {
|
||||
|
|
@ -42,4 +43,9 @@ Row {
|
|||
font.family: M.Theme.fontFamily
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
}
|
||||
HoverHandler { id: hover }
|
||||
ToolTip {
|
||||
visible: hover.hovered
|
||||
text: "Memory: " + root.percent + "% used"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import Quickshell.Services.Mpris
|
||||
import "." as M
|
||||
|
||||
|
|
@ -19,6 +20,20 @@ Row {
|
|||
anchors.verticalCenter: parent.verticalCenter
|
||||
}
|
||||
|
||||
HoverHandler { id: hover }
|
||||
ToolTip {
|
||||
visible: hover.hovered
|
||||
text: {
|
||||
const p = root.player;
|
||||
if (!p) return "";
|
||||
const parts = [];
|
||||
if (p.trackTitle) parts.push(p.trackTitle);
|
||||
if (p.trackArtists?.length) parts.push(p.trackArtists.join(", "));
|
||||
if (p.trackAlbum) parts.push(p.trackAlbum);
|
||||
return parts.join("\n") || p.identity;
|
||||
}
|
||||
}
|
||||
|
||||
TapHandler {
|
||||
onTapped: root.player?.togglePlaying()
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import Quickshell.Io
|
||||
import "." as M
|
||||
|
||||
|
|
@ -62,4 +63,15 @@ Row {
|
|||
font.family: M.Theme.fontFamily
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
}
|
||||
|
||||
HoverHandler { id: hover }
|
||||
ToolTip {
|
||||
visible: hover.hovered
|
||||
text: {
|
||||
if (root.state === "wifi") return "WiFi: " + root.essid + (root.ifname ? "\nInterface: " + root.ifname : "");
|
||||
if (root.state === "eth") return "Ethernet: " + root.ifname;
|
||||
if (root.state === "linked") return "Linked: " + root.ifname;
|
||||
return "Disconnected";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import Quickshell.Io
|
||||
import "." as M
|
||||
|
||||
|
|
@ -58,4 +59,15 @@ Row {
|
|||
Process {
|
||||
id: clicker
|
||||
}
|
||||
HoverHandler { id: hover }
|
||||
ToolTip {
|
||||
visible: hover.hovered
|
||||
text: {
|
||||
const parts = [];
|
||||
parts.push(root.count + " notification" + (root.count !== 1 ? "s" : ""));
|
||||
if (root.dnd) parts.push("Do not disturb");
|
||||
if (root.inhibited) parts.push("Inhibited");
|
||||
return parts.join("\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
import QtQuick
|
||||
import Quickshell.Io
|
||||
import QtQuick.Controls
|
||||
import "." as M
|
||||
|
||||
M.BarIcon {
|
||||
|
|
@ -44,4 +45,9 @@ M.BarIcon {
|
|||
setter.running = true;
|
||||
}
|
||||
}
|
||||
HoverHandler { id: hover }
|
||||
ToolTip {
|
||||
visible: hover.hovered
|
||||
text: "Power profile: " + (root.profile || "unknown")
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
import QtQuick
|
||||
import Quickshell.Io
|
||||
import QtQuick.Controls
|
||||
import "." as M
|
||||
|
||||
Row {
|
||||
|
|
@ -32,4 +33,9 @@ Row {
|
|||
font.family: M.Theme.fontFamily
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
}
|
||||
HoverHandler { id: hover }
|
||||
ToolTip {
|
||||
visible: hover.hovered
|
||||
text: "Temperature: " + root.celsius + "\u00B0C"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import Quickshell.Services.Pipewire
|
||||
import "." as M
|
||||
|
||||
|
|
@ -23,6 +24,14 @@ Row {
|
|||
anchors.verticalCenter: parent.verticalCenter
|
||||
}
|
||||
|
||||
HoverHandler { id: hover }
|
||||
ToolTip {
|
||||
visible: hover.hovered
|
||||
text: (root.sink?.description ?? root.sink?.name ?? "Unknown sink") +
|
||||
"\nVolume: " + Math.round(root.volume * 100) + "%" +
|
||||
(root.muted ? "\nMuted" : "")
|
||||
}
|
||||
|
||||
TapHandler {
|
||||
onTapped: if (root.sink?.audio) root.sink.audio.muted = !root.sink.audio.muted
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
import QtQuick
|
||||
import Quickshell.Io
|
||||
import QtQuick.Controls
|
||||
import "." as M
|
||||
|
||||
M.BarIcon {
|
||||
|
|
@ -15,4 +16,9 @@ M.BarIcon {
|
|||
cursorShape: Qt.PointingHandCursor
|
||||
onClicked: proc.running = true
|
||||
}
|
||||
HoverHandler { id: hover }
|
||||
ToolTip {
|
||||
visible: hover.hovered
|
||||
text: "Open logout menu"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue