updates
This commit is contained in:
@@ -6,7 +6,7 @@ import Quickshell.Io
|
|||||||
QtObject {
|
QtObject {
|
||||||
id: root
|
id: root
|
||||||
|
|
||||||
property string shortDate: Qt.formatDate(new Date(), "ddd, dd.MM.yyyy - ")
|
property string shortDate: Qt.formatDate(new Date(), "dd.MM.yyyy - ")
|
||||||
property string fullDate: Qt.formatDate(new Date(), "dddd, MMMM d, yyyy")
|
property string fullDate: Qt.formatDate(new Date(), "dddd, MMMM d, yyyy")
|
||||||
property string currentTime: Qt.formatTime(new Date(), "hh:mm:ss")
|
property string currentTime: Qt.formatTime(new Date(), "hh:mm:ss")
|
||||||
property string uptime: "Uptime: ..."
|
property string uptime: "Uptime: ..."
|
||||||
@@ -26,7 +26,7 @@ QtObject {
|
|||||||
repeat: true
|
repeat: true
|
||||||
triggeredOnStart: true
|
triggeredOnStart: true
|
||||||
onTriggered: {
|
onTriggered: {
|
||||||
root.shortDate = Qt.formatDate(new Date(), "ddd, dd.MM.yyyy - ")
|
root.shortDate = Qt.formatDate(new Date(), "dd.MM.yyyy - ")
|
||||||
root.fullDate = Qt.formatDate(new Date(), "dddd, MMMM d, yyyy")
|
root.fullDate = Qt.formatDate(new Date(), "dddd, MMMM d, yyyy")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,15 +7,18 @@ PopupWindow {
|
|||||||
|
|
||||||
property Item anchorItem
|
property Item anchorItem
|
||||||
property bool anchorHovered: false
|
property bool anchorHovered: false
|
||||||
property int popupWidth: 300
|
property int minpopupWidth: 300
|
||||||
|
property int minpopupHeight: 50
|
||||||
property int popupVerticalOffset: 0
|
property int popupVerticalOffset: 0
|
||||||
|
property int spacingValue: 12
|
||||||
|
property int radiusValue: 12
|
||||||
|
|
||||||
default property alias content: contentColumn.data
|
default property alias content: contentColumn.data
|
||||||
|
|
||||||
visible: false
|
visible: false
|
||||||
color: "transparent"
|
color: "transparent"
|
||||||
width: Math.max(300, contentColumn.implicitWidth + 2 * 12)
|
width: Math.max(popup.minpopupWidth, contentColumn.implicitWidth + 2 * popup.spacingValue)
|
||||||
height: Math.max(50, contentColumn.implicitHeight + 2 * 12)
|
height: Math.max(popup.minpopupHeight, contentColumn.implicitHeight + 2 * popup.spacingValue)
|
||||||
|
|
||||||
onAnchorHoveredChanged: popup.updateVisibility()
|
onAnchorHoveredChanged: popup.updateVisibility()
|
||||||
|
|
||||||
@@ -59,7 +62,7 @@ PopupWindow {
|
|||||||
id: background
|
id: background
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
color: Qt.alpha(Colors.primaryContainer, 0.9)
|
color: Qt.alpha(Colors.primaryContainer, 0.9)
|
||||||
radius: 12
|
radius: popup.radiusValue
|
||||||
border {
|
border {
|
||||||
color: Colors.primaryContainer_fg
|
color: Colors.primaryContainer_fg
|
||||||
width: Config.border_width
|
width: Config.border_width
|
||||||
@@ -73,9 +76,9 @@ PopupWindow {
|
|||||||
top: parent.top
|
top: parent.top
|
||||||
left: parent.left
|
left: parent.left
|
||||||
right: parent.right
|
right: parent.right
|
||||||
margins: 12
|
margins: popup.spacingValue
|
||||||
}
|
}
|
||||||
spacing: Config.small_spacing_fun(24)
|
spacing: popup.spacingValue
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -61,12 +61,21 @@ Rectangle { //workspace
|
|||||||
id: clockPopup
|
id: clockPopup
|
||||||
anchorItem: clockRect
|
anchorItem: clockRect
|
||||||
anchorHovered: clockArea.containsMouse
|
anchorHovered: clockArea.containsMouse
|
||||||
implicitWidth: Math.max(text1.width, text2.width) + (Config.spacing_fun(clockRect.height) * 3)
|
spacingValue: Config.spacing_fun(clockRect.height)
|
||||||
implicitHeight: text1.height*3+(Config.spacing_fun(clockRect.height) * 5)
|
radiusValue: Config.radius_fun(clockRect.height)
|
||||||
|
|
||||||
Column {
|
Column {
|
||||||
width: parent.width
|
spacing: parent.spacing
|
||||||
spacing: Config.spacing_fun(clockRect.height)
|
Text {
|
||||||
|
id: text0
|
||||||
|
text: ClockState.shortDate + ClockState.currentTime
|
||||||
|
wrapMode: Text.WordWrap
|
||||||
|
color: Colors.primary
|
||||||
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
|
font.pixelSize: Config.font_size_tiny(bar.height)
|
||||||
|
font.family: Config.font
|
||||||
|
}
|
||||||
|
|
||||||
Text {
|
Text {
|
||||||
id: text1
|
id: text1
|
||||||
text: ClockState.fullDate
|
text: ClockState.fullDate
|
||||||
@@ -77,6 +86,7 @@ Rectangle { //workspace
|
|||||||
font.family: Config.font
|
font.family: Config.font
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Text {
|
Text {
|
||||||
id: text2
|
id: text2
|
||||||
text: ClockState.uptime
|
text: ClockState.uptime
|
||||||
|
|||||||
@@ -38,15 +38,11 @@ MouseArea {
|
|||||||
id: clockPopup
|
id: clockPopup
|
||||||
anchorItem: networkButton
|
anchorItem: networkButton
|
||||||
anchorHovered: networkButton.containsMouse
|
anchorHovered: networkButton.containsMouse
|
||||||
popupWidth: 500
|
spacingValue: Config.spacing_fun(networkButton.height)
|
||||||
// property int count: 17
|
radiusValue: Config.radius_fun(networkButton.height)
|
||||||
// property var texts: [text1, text2, text3, text4, text5, text6, text7, text8, text9, text10, text11, text12, text13, text14, text15, text16, text17]
|
|
||||||
// implicitWidth: Config.maxTextWidth(count, texts) + (Config.spacing_fun(networkButton.height) * 3)
|
|
||||||
// implicitHeight: text1.height*count+(Config.spacing_fun(networkButton.height) * (count + 2))
|
|
||||||
|
|
||||||
Column {
|
Column {
|
||||||
// width: parent.width
|
spacing: parent.spacing
|
||||||
spacing: Config.spacing_fun(networkButton.height)
|
|
||||||
Text {
|
Text {
|
||||||
id: text1
|
id: text1
|
||||||
text: "interfaceName: " + NetworkState.interfaceName
|
text: "interfaceName: " + NetworkState.interfaceName
|
||||||
|
|||||||
Reference in New Issue
Block a user