last 7 months of qs changes
This commit is contained in:
parent
2c64563ade
commit
4b90113a54
103 changed files with 3467 additions and 1415 deletions
|
|
@ -1,41 +1,67 @@
|
|||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import QtQuick.Controls
|
||||
import Quickshell
|
||||
import ".."
|
||||
|
||||
OverlayWidget {
|
||||
expandedWidth: 600
|
||||
expandedHeight: 600
|
||||
BarWidgetInner {
|
||||
id: root
|
||||
required property var bar;
|
||||
|
||||
BarWidgetInner {
|
||||
implicitHeight: layout.implicitHeight
|
||||
implicitHeight: layout.implicitHeight
|
||||
|
||||
ColumnLayout {
|
||||
id: layout
|
||||
spacing: 0
|
||||
SystemClock {
|
||||
id: clock
|
||||
precision: tooltip.visible ? SystemClock.Seconds : SystemClock.Minutes;
|
||||
}
|
||||
|
||||
anchors {
|
||||
right: parent.right
|
||||
left: parent.left
|
||||
BarButton {
|
||||
id: button
|
||||
anchors.fill: parent
|
||||
fillWindowWidth: true
|
||||
acceptedButtons: Qt.NoButton
|
||||
|
||||
ColumnLayout {
|
||||
id: layout
|
||||
spacing: 0
|
||||
|
||||
anchors {
|
||||
right: parent.right
|
||||
left: parent.left
|
||||
}
|
||||
|
||||
Text {
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
text: {
|
||||
const hours = clock.hours.toString().padStart(2, '0')
|
||||
const minutes = clock.minutes.toString().padStart(2, '0')
|
||||
return `${hours}\n${minutes}`
|
||||
}
|
||||
font.pointSize: 18
|
||||
color: "white"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
property TooltipItem tooltip: TooltipItem {
|
||||
id: tooltip
|
||||
tooltip: bar.tooltip
|
||||
owner: root
|
||||
show: button.containsMouse
|
||||
|
||||
Loader {
|
||||
active: tooltip.visible
|
||||
sourceComponent: Label {
|
||||
text: {
|
||||
// SystemClock can send an update slightly (<50ms) before the
|
||||
// time changes. We use its readout so the widget and tooltip match.
|
||||
const hours = clock.hours.toString().padStart(2, '0');
|
||||
const minutes = clock.minutes.toString().padStart(2, '0');
|
||||
const seconds = clock.seconds.toString().padStart(2, '0');
|
||||
|
||||
return `${hours}:${minutes}:${seconds}\n` + new Date().toLocaleString(Qt.locale("en_US"), "dddd, MMMM d, yyyy");
|
||||
}
|
||||
}
|
||||
|
||||
Text {
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
text: ShellGlobals.time.getHours().toString().padStart(2, '0')
|
||||
font.pointSize: 18
|
||||
color: "#a0ffffff"
|
||||
}
|
||||
|
||||
Text {
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
text: ShellGlobals.time.getMinutes().toString().padStart(2, '0')
|
||||
font.pointSize: 18
|
||||
color: "#a0ffffff"
|
||||
}
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
onClicked: expanded = !expanded
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue