forked from Shinonome/dots-hyprland
bar: fix tooltip shadow cutoff, use fewer Layouts
This commit is contained in:
@@ -14,11 +14,12 @@ StyledPopup {
|
||||
spacing: 4
|
||||
|
||||
// Header
|
||||
RowLayout {
|
||||
Row {
|
||||
id: header
|
||||
spacing: 5
|
||||
|
||||
MaterialSymbol {
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
fill: 0
|
||||
font.weight: Font.Medium
|
||||
text: "battery_android_full"
|
||||
@@ -27,6 +28,7 @@ StyledPopup {
|
||||
}
|
||||
|
||||
StyledText {
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
text: "Battery"
|
||||
font {
|
||||
weight: Font.Medium
|
||||
|
||||
@@ -39,10 +39,11 @@ StyledPopup {
|
||||
spacing: 4
|
||||
|
||||
// Date + Time row
|
||||
RowLayout {
|
||||
Row {
|
||||
spacing: 5
|
||||
|
||||
MaterialSymbol {
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
fill: 0
|
||||
font.weight: Font.Medium
|
||||
text: "calendar_month"
|
||||
@@ -50,6 +51,7 @@ StyledPopup {
|
||||
color: Appearance.colors.colOnSurfaceVariant
|
||||
}
|
||||
StyledText {
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
horizontalAlignment: Text.AlignLeft
|
||||
color: Appearance.colors.colOnSurfaceVariant
|
||||
text: `${root.formattedDate}`
|
||||
@@ -79,26 +81,26 @@ StyledPopup {
|
||||
}
|
||||
|
||||
// Tasks
|
||||
ColumnLayout {
|
||||
Column {
|
||||
spacing: 0
|
||||
Layout.fillWidth: true
|
||||
|
||||
RowLayout {
|
||||
Row {
|
||||
spacing: 4
|
||||
Layout.fillWidth: true
|
||||
MaterialSymbol {
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
text: "checklist"
|
||||
color: Appearance.colors.colOnSurfaceVariant
|
||||
font.pixelSize: Appearance.font.pixelSize.large
|
||||
}
|
||||
StyledText {
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
text: Translation.tr("To Do:")
|
||||
color: Appearance.colors.colOnSurfaceVariant
|
||||
}
|
||||
}
|
||||
|
||||
StyledText {
|
||||
Layout.fillWidth: true
|
||||
horizontalAlignment: Text.AlignLeft
|
||||
wrapMode: Text.Wrap
|
||||
color: Appearance.colors.colOnSurfaceVariant
|
||||
|
||||
@@ -20,7 +20,6 @@ StyledPopup {
|
||||
required property string label
|
||||
required property string value
|
||||
spacing: 4
|
||||
Layout.fillWidth: true
|
||||
|
||||
MaterialSymbol {
|
||||
text: resourceItem.icon
|
||||
@@ -40,13 +39,14 @@ StyledPopup {
|
||||
}
|
||||
}
|
||||
|
||||
component ResourceHeaderItem: RowLayout {
|
||||
component ResourceHeaderItem: Row {
|
||||
id: headerItem
|
||||
required property var icon
|
||||
required property var label
|
||||
spacing: 5
|
||||
|
||||
MaterialSymbol {
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
fill: 0
|
||||
font.weight: Font.Medium
|
||||
text: headerItem.icon
|
||||
@@ -55,6 +55,7 @@ StyledPopup {
|
||||
}
|
||||
|
||||
StyledText {
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
text: headerItem.label
|
||||
font {
|
||||
weight: Font.Medium
|
||||
@@ -64,19 +65,20 @@ StyledPopup {
|
||||
}
|
||||
}
|
||||
|
||||
RowLayout {
|
||||
Row {
|
||||
anchors.centerIn: parent
|
||||
spacing: 12
|
||||
|
||||
ColumnLayout {
|
||||
Layout.alignment: Qt.AlignTop
|
||||
Column {
|
||||
anchors.top: parent.top
|
||||
spacing: 8
|
||||
|
||||
ResourceHeaderItem {
|
||||
icon: "memory"
|
||||
label: "RAM"
|
||||
}
|
||||
ColumnLayout {
|
||||
Column {
|
||||
spacing: 4
|
||||
ResourceItem {
|
||||
icon: "clock_loader_60"
|
||||
label: Translation.tr("Used:")
|
||||
@@ -95,16 +97,17 @@ StyledPopup {
|
||||
}
|
||||
}
|
||||
|
||||
ColumnLayout {
|
||||
Column {
|
||||
visible: ResourceUsage.swapTotal > 0
|
||||
Layout.alignment: Qt.AlignTop
|
||||
anchors.top: parent.top
|
||||
spacing: 8
|
||||
|
||||
ResourceHeaderItem {
|
||||
icon: "swap_horiz"
|
||||
label: "Swap"
|
||||
}
|
||||
ColumnLayout {
|
||||
Column {
|
||||
spacing: 4
|
||||
ResourceItem {
|
||||
icon: "clock_loader_60"
|
||||
label: Translation.tr("Used:")
|
||||
@@ -123,15 +126,16 @@ StyledPopup {
|
||||
}
|
||||
}
|
||||
|
||||
ColumnLayout {
|
||||
Layout.alignment: Qt.AlignTop
|
||||
Column {
|
||||
anchors.top: parent.top
|
||||
spacing: 8
|
||||
|
||||
ResourceHeaderItem {
|
||||
icon: "planner_review"
|
||||
label: "CPU"
|
||||
}
|
||||
ColumnLayout {
|
||||
Column {
|
||||
spacing: 4
|
||||
ResourceItem {
|
||||
icon: "bolt"
|
||||
label: Translation.tr("Load:")
|
||||
|
||||
@@ -24,8 +24,8 @@ LazyLoader {
|
||||
anchors.top: Config.options.bar.vertical || (!Config.options.bar.vertical && !Config.options.bar.bottom)
|
||||
anchors.bottom: !Config.options.bar.vertical && Config.options.bar.bottom
|
||||
|
||||
implicitWidth: popupBackground.implicitWidth + Appearance.sizes.hyprlandGapsOut * 2 + root.popupBackgroundMargin
|
||||
implicitHeight: popupBackground.implicitHeight + Appearance.sizes.hyprlandGapsOut * 2 + root.popupBackgroundMargin
|
||||
implicitWidth: popupBackground.implicitWidth + Appearance.sizes.elevationMargin * 2 + root.popupBackgroundMargin
|
||||
implicitHeight: popupBackground.implicitHeight + Appearance.sizes.elevationMargin * 2 + root.popupBackgroundMargin
|
||||
|
||||
mask: Region {
|
||||
item: popupBackground
|
||||
@@ -63,10 +63,10 @@ LazyLoader {
|
||||
readonly property real margin: 10
|
||||
anchors {
|
||||
fill: parent
|
||||
leftMargin: Appearance.sizes.hyprlandGapsOut + root.popupBackgroundMargin * (!popupWindow.anchors.left)
|
||||
rightMargin: Appearance.sizes.hyprlandGapsOut + root.popupBackgroundMargin * (!popupWindow.anchors.right)
|
||||
topMargin: Appearance.sizes.hyprlandGapsOut + root.popupBackgroundMargin * (!popupWindow.anchors.top)
|
||||
bottomMargin: Appearance.sizes.hyprlandGapsOut + root.popupBackgroundMargin * (!popupWindow.anchors.bottom)
|
||||
leftMargin: Appearance.sizes.elevationMargin + root.popupBackgroundMargin * (!popupWindow.anchors.left)
|
||||
rightMargin: Appearance.sizes.elevationMargin + root.popupBackgroundMargin * (!popupWindow.anchors.right)
|
||||
topMargin: Appearance.sizes.elevationMargin + root.popupBackgroundMargin * (!popupWindow.anchors.top)
|
||||
bottomMargin: Appearance.sizes.elevationMargin + root.popupBackgroundMargin * (!popupWindow.anchors.bottom)
|
||||
}
|
||||
implicitWidth: root.contentItem.implicitWidth + margin * 2
|
||||
implicitHeight: root.contentItem.implicitHeight + margin * 2
|
||||
|
||||
@@ -70,12 +70,15 @@ MouseArea {
|
||||
hoverTarget: root
|
||||
active: GlobalStates.mediaControlsOpen ? false : root.containsMouse
|
||||
|
||||
ColumnLayout {
|
||||
Column {
|
||||
anchors.centerIn: parent
|
||||
RowLayout {
|
||||
spacing: 5
|
||||
spacing: 4
|
||||
|
||||
Row {
|
||||
spacing: 4
|
||||
|
||||
MaterialSymbol {
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
fill: 0
|
||||
font.weight: Font.Medium
|
||||
text: "music_note"
|
||||
@@ -84,6 +87,7 @@ MouseArea {
|
||||
}
|
||||
|
||||
StyledText {
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
text: "Media"
|
||||
font {
|
||||
weight: Font.Medium
|
||||
|
||||
Reference in New Issue
Block a user