resource popout is better now
This commit is contained in:
@@ -1,3 +1,4 @@
|
|||||||
|
import Quickshell
|
||||||
import QtQuick
|
import QtQuick
|
||||||
import QtQuick.Controls
|
import QtQuick.Controls
|
||||||
import QtQuick.Layouts
|
import QtQuick.Layouts
|
||||||
@@ -11,19 +12,26 @@ Item {
|
|||||||
id: root
|
id: root
|
||||||
|
|
||||||
readonly property int minWidth: 400 + 400 + Appearance.spacing.normal + 120 + Appearance.padding.large * 2
|
readonly property int minWidth: 400 + 400 + Appearance.spacing.normal + 120 + Appearance.padding.large * 2
|
||||||
|
readonly property real nonAnimHeight: content.implicitHeight + Appearance.padding.normal * 2
|
||||||
|
readonly property real nonAnimWidth: Math.max(minWidth, content.implicitWidth) + Appearance.padding.normal * 2
|
||||||
|
required property real padding
|
||||||
|
required property PersistentProperties visibilities
|
||||||
|
|
||||||
function displayTemp(temp: real): string {
|
function displayTemp(temp: real): string {
|
||||||
return `${Math.ceil(temp)}°C`;
|
return `${Math.ceil(temp)}°C`;
|
||||||
}
|
}
|
||||||
|
|
||||||
implicitHeight: content.implicitHeight
|
implicitHeight: nonAnimHeight
|
||||||
implicitWidth: Math.max(minWidth, content.implicitWidth)
|
implicitWidth: nonAnimWidth
|
||||||
|
|
||||||
RowLayout {
|
RowLayout {
|
||||||
id: content
|
id: content
|
||||||
|
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
|
anchors.leftMargin: root.padding
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
|
anchors.rightMargin: root.padding
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
spacing: Appearance.spacing.normal
|
spacing: Appearance.spacing.normal
|
||||||
|
|
||||||
Ref {
|
Ref {
|
||||||
@@ -127,7 +135,7 @@ Item {
|
|||||||
property real percentage: UPower.displayDevice.percentage
|
property real percentage: UPower.displayDevice.percentage
|
||||||
|
|
||||||
color: DynamicColors.tPalette.m3surfaceContainer
|
color: DynamicColors.tPalette.m3surfaceContainer
|
||||||
radius: Appearance.rounding.large
|
radius: Appearance.rounding.large - Appearance.padding.normal
|
||||||
|
|
||||||
Behavior on animatedPercentage {
|
Behavior on animatedPercentage {
|
||||||
Anim {
|
Anim {
|
||||||
@@ -273,7 +281,7 @@ Item {
|
|||||||
|
|
||||||
clip: true
|
clip: true
|
||||||
color: DynamicColors.tPalette.m3surfaceContainer
|
color: DynamicColors.tPalette.m3surfaceContainer
|
||||||
radius: Appearance.rounding.large
|
radius: Appearance.rounding.large - Appearance.padding.normal
|
||||||
|
|
||||||
Behavior on animatedPercentage {
|
Behavior on animatedPercentage {
|
||||||
Anim {
|
Anim {
|
||||||
@@ -345,7 +353,7 @@ Item {
|
|||||||
property real usage: 0
|
property real usage: 0
|
||||||
|
|
||||||
color: DynamicColors.tPalette.m3surfaceContainer
|
color: DynamicColors.tPalette.m3surfaceContainer
|
||||||
radius: Appearance.rounding.large
|
radius: Appearance.rounding.large - Appearance.padding.normal
|
||||||
|
|
||||||
Behavior on animatedTemp {
|
Behavior on animatedTemp {
|
||||||
Anim {
|
Anim {
|
||||||
@@ -452,7 +460,7 @@ Item {
|
|||||||
|
|
||||||
clip: true
|
clip: true
|
||||||
color: DynamicColors.tPalette.m3surfaceContainer
|
color: DynamicColors.tPalette.m3surfaceContainer
|
||||||
radius: Appearance.rounding.large
|
radius: Appearance.rounding.large - Appearance.padding.normal
|
||||||
|
|
||||||
Ref {
|
Ref {
|
||||||
service: NetworkUsage
|
service: NetworkUsage
|
||||||
@@ -666,7 +674,7 @@ Item {
|
|||||||
|
|
||||||
clip: true
|
clip: true
|
||||||
color: DynamicColors.tPalette.m3surfaceContainer
|
color: DynamicColors.tPalette.m3surfaceContainer
|
||||||
radius: Appearance.rounding.large
|
radius: Appearance.rounding.large - Appearance.padding.normal
|
||||||
|
|
||||||
Behavior on animatedPercentage {
|
Behavior on animatedPercentage {
|
||||||
Anim {
|
Anim {
|
||||||
|
|||||||
Reference in New Issue
Block a user