mirror of
https://github.com/zoriya/noctalia-shell.git
synced 2026-06-03 10:56:16 +00:00
Improve PowerProfile card when you dont have power profile available
This commit is contained in:
@@ -14,6 +14,7 @@ NBox {
|
|||||||
|
|
||||||
// PowerProfiles service
|
// PowerProfiles service
|
||||||
property var powerProfiles: PowerProfiles
|
property var powerProfiles: PowerProfiles
|
||||||
|
readonly property bool hasPP: powerProfiles.hasPerformanceProfile
|
||||||
|
|
||||||
RowLayout {
|
RowLayout {
|
||||||
id: powerRow
|
id: powerRow
|
||||||
@@ -26,12 +27,12 @@ NBox {
|
|||||||
// Performance
|
// Performance
|
||||||
NIconButton {
|
NIconButton {
|
||||||
icon: "speed"
|
icon: "speed"
|
||||||
enabled: powerProfiles.hasPerformanceProfile
|
enabled: hasPP
|
||||||
opacity: enabled ? 1.0 : 0.3
|
opacity: enabled ? Style.opacityFull : Style.opacityMedium
|
||||||
showFilled: powerProfiles.profile === PowerProfile.Performance
|
showFilled: enabled && powerProfiles.profile === PowerProfile.Performance
|
||||||
showBorder: powerProfiles.profile !== PowerProfile.Performance
|
showBorder: !enabled || powerProfiles.profile !== PowerProfile.Performance
|
||||||
onClicked: {
|
onClicked: {
|
||||||
if (powerProfiles.hasPerformanceProfile) {
|
if (enabled) {
|
||||||
powerProfiles.profile = PowerProfile.Performance
|
powerProfiles.profile = PowerProfile.Performance
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -39,19 +40,27 @@ NBox {
|
|||||||
// Balanced
|
// Balanced
|
||||||
NIconButton {
|
NIconButton {
|
||||||
icon: "balance"
|
icon: "balance"
|
||||||
showFilled: powerProfiles.profile === PowerProfile.Balanced
|
enabled: hasPP
|
||||||
showBorder: powerProfiles.profile !== PowerProfile.Balanced
|
opacity: enabled ? Style.opacityFull : Style.opacityMedium
|
||||||
|
showFilled: enabled && powerProfiles.profile === PowerProfile.Balanced
|
||||||
|
showBorder: !enabled || powerProfiles.profile !== PowerProfile.Balanced
|
||||||
onClicked: {
|
onClicked: {
|
||||||
powerProfiles.profile = PowerProfile.Balanced
|
if (enabled) {
|
||||||
|
powerProfiles.profile = PowerProfile.Balanced
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Eco
|
// Eco
|
||||||
NIconButton {
|
NIconButton {
|
||||||
icon: "eco"
|
icon: "eco"
|
||||||
showFilled: powerProfiles.profile === PowerProfile.PowerSaver
|
enabled: hasPP
|
||||||
showBorder: powerProfiles.profile !== PowerProfile.PowerSaver
|
opacity: enabled ? Style.opacityFull : Style.opacityMedium
|
||||||
|
showFilled: enabled && powerProfiles.profile === PowerProfile.PowerSaver
|
||||||
|
showBorder: !enabled || powerProfiles.profile !== PowerProfile.PowerSaver
|
||||||
onClicked: {
|
onClicked: {
|
||||||
powerProfiles.profile = PowerProfile.PowerSaver
|
if (enabled) {
|
||||||
|
powerProfiles.profile = PowerProfile.PowerSaver
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Item {
|
Item {
|
||||||
|
|||||||
Reference in New Issue
Block a user