forked from Shinonome/dots-hyprland
hefty: bar: systeminfo: add to default bar config, add ppd btns
This commit is contained in:
@@ -7,7 +7,7 @@ JsonObject {
|
|||||||
property list<var> leftWidgets: ["HWindowInfo"]
|
property list<var> leftWidgets: ["HWindowInfo"]
|
||||||
property list<var> centerLeftWidgets: ["HTime"]
|
property list<var> centerLeftWidgets: ["HTime"]
|
||||||
property list<var> centerWidgets: ["HWorkspaces"]
|
property list<var> centerWidgets: ["HWorkspaces"]
|
||||||
property list<var> centerRightWidgets: ["HBattery"]
|
property list<var> centerRightWidgets: ["HSystemInfo"]
|
||||||
property list<var> rightWidgets: []
|
property list<var> rightWidgets: []
|
||||||
property bool m3ExpressiveGrouping: true
|
property bool m3ExpressiveGrouping: true
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,6 +23,10 @@ Flow {
|
|||||||
]
|
]
|
||||||
property var currentValue: null
|
property var currentValue: null
|
||||||
|
|
||||||
|
function focusSelectedChild() {
|
||||||
|
children.find(c => c.value == currentValue).forceActiveFocus()
|
||||||
|
}
|
||||||
|
|
||||||
signal selected(var newValue)
|
signal selected(var newValue)
|
||||||
|
|
||||||
Repeater {
|
Repeater {
|
||||||
@@ -31,6 +35,7 @@ Flow {
|
|||||||
id: paletteButton
|
id: paletteButton
|
||||||
required property var modelData
|
required property var modelData
|
||||||
required property int index
|
required property int index
|
||||||
|
readonly property var value: modelData.value
|
||||||
onYChanged: {
|
onYChanged: {
|
||||||
if (index === 0) {
|
if (index === 0) {
|
||||||
paletteButton.leftmost = true
|
paletteButton.leftmost = true
|
||||||
|
|||||||
@@ -136,12 +136,19 @@ HBarWidgetWithPopout {
|
|||||||
}
|
}
|
||||||
|
|
||||||
component SysInfoPopupContent: W.ChoreographerGridLayout {
|
component SysInfoPopupContent: W.ChoreographerGridLayout {
|
||||||
|
id: popupRoot
|
||||||
|
rowSpacing: 8
|
||||||
|
|
||||||
|
onShownChanged: {
|
||||||
|
if (shown) {
|
||||||
|
powerProfileSelection.focusSelectedChild()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
W.FlyFadeEnterChoreographable {
|
W.FlyFadeEnterChoreographable {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
|
|
||||||
RowLayout {
|
RowLayout {
|
||||||
anchors.fill: parent
|
|
||||||
spacing: 10
|
spacing: 10
|
||||||
|
|
||||||
W.CircularProgress {
|
W.CircularProgress {
|
||||||
@@ -198,6 +205,34 @@ HBarWidgetWithPopout {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
W.FlyFadeEnterChoreographable {
|
||||||
|
Layout.fillWidth: true
|
||||||
|
W.ConfigSelectionArray {
|
||||||
|
id: powerProfileSelection
|
||||||
|
currentValue: PowerProfiles.profile
|
||||||
|
onSelected: newValue => {
|
||||||
|
PowerProfiles.profile = newValue
|
||||||
|
}
|
||||||
|
options: [
|
||||||
|
{
|
||||||
|
displayName: S.Translation.tr("Power saver"),
|
||||||
|
// icon: "line_curve",
|
||||||
|
value: PowerProfile.PowerSaver
|
||||||
|
},
|
||||||
|
{
|
||||||
|
displayName: S.Translation.tr("Balanced"),
|
||||||
|
// icon: "page_header",
|
||||||
|
value: PowerProfile.Balanced
|
||||||
|
},
|
||||||
|
{
|
||||||
|
displayName: S.Translation.tr("Performance"),
|
||||||
|
// icon: "toolbar",
|
||||||
|
value: PowerProfile.Performance
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
component StatWithIcon: Item {
|
component StatWithIcon: Item {
|
||||||
|
|||||||
Reference in New Issue
Block a user