SidePanel: added PowerProfileCard and UtilitiesCard
This commit is contained in:
parent
a11e310580
commit
bfe70e8f46
6 changed files with 85 additions and 70 deletions
|
|
@ -11,8 +11,8 @@ NIconButton {
|
||||||
|
|
||||||
readonly property real scaling: Scaling.scale(screen)
|
readonly property real scaling: Scaling.scale(screen)
|
||||||
readonly property bool wifiEnabled: Settings.data.network.wifiEnabled
|
readonly property bool wifiEnabled: Settings.data.network.wifiEnabled
|
||||||
sizeMultiplier: 0.8
|
sizeMultiplier: 0.8
|
||||||
showBorder: false
|
showBorder: false
|
||||||
icon: {
|
icon: {
|
||||||
let connected = false
|
let connected = false
|
||||||
for (const net in network.networks) {
|
for (const net in network.networks) {
|
||||||
|
|
|
||||||
|
|
@ -168,19 +168,17 @@ NLoader {
|
||||||
font.weight: Style.fontWeightBold
|
font.weight: Style.fontWeightBold
|
||||||
}
|
}
|
||||||
|
|
||||||
NTextInput {
|
NTextInput {
|
||||||
text: "Type anything"
|
text: "Type anything"
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
onEditingFinished: function () {
|
onEditingFinished: function () {}
|
||||||
}
|
|
||||||
|
|
||||||
NDivider {
|
NDivider {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
// NBusyIndicator
|
// NBusyIndicator
|
||||||
ColumnLayout {
|
ColumnLayout {
|
||||||
spacing: Style.marginMedium * scaling
|
spacing: Style.marginMedium * scaling
|
||||||
|
|
|
||||||
|
|
@ -185,7 +185,7 @@ PanelWindow {
|
||||||
}
|
}
|
||||||
|
|
||||||
NIconButton {
|
NIconButton {
|
||||||
sizeMultiplier: 0.8
|
sizeMultiplier: 0.8
|
||||||
showBorder: false
|
showBorder: false
|
||||||
anchors.top: parent.top
|
anchors.top: parent.top
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
|
|
|
||||||
40
Modules/SidePanel/Cards/PowerProfileCard.qml
Normal file
40
Modules/SidePanel/Cards/PowerProfileCard.qml
Normal file
|
|
@ -0,0 +1,40 @@
|
||||||
|
import QtQuick
|
||||||
|
import QtQuick.Controls
|
||||||
|
import QtQuick.Layouts
|
||||||
|
import Quickshell
|
||||||
|
import qs.Services
|
||||||
|
import qs.Widgets
|
||||||
|
|
||||||
|
// Power Profiles: performance, balanced, eco
|
||||||
|
NBox {
|
||||||
|
Layout.fillWidth: true
|
||||||
|
Layout.preferredWidth: 1
|
||||||
|
implicitHeight: powerRow.implicitHeight + Style.marginMedium * 2 * scaling
|
||||||
|
RowLayout {
|
||||||
|
id: powerRow
|
||||||
|
anchors.fill: parent
|
||||||
|
anchors.margins: Style.marginSmall * scaling
|
||||||
|
spacing: sidePanel.cardSpacing
|
||||||
|
Item {
|
||||||
|
Layout.fillWidth: true
|
||||||
|
}
|
||||||
|
// Performance
|
||||||
|
NIconButton {
|
||||||
|
icon: "speed"
|
||||||
|
onClicked: function () {/* TODO: hook to power profile */ }
|
||||||
|
}
|
||||||
|
// Balanced
|
||||||
|
NIconButton {
|
||||||
|
icon: "balance"
|
||||||
|
onClicked: function () {/* TODO: hook to power profile */ }
|
||||||
|
}
|
||||||
|
// Eco
|
||||||
|
NIconButton {
|
||||||
|
icon: "eco"
|
||||||
|
onClicked: function () {/* TODO: hook to power profile */ }
|
||||||
|
}
|
||||||
|
Item {
|
||||||
|
Layout.fillWidth: true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
34
Modules/SidePanel/Cards/UtilitiesCard.qml
Normal file
34
Modules/SidePanel/Cards/UtilitiesCard.qml
Normal file
|
|
@ -0,0 +1,34 @@
|
||||||
|
import QtQuick
|
||||||
|
import QtQuick.Controls
|
||||||
|
import QtQuick.Layouts
|
||||||
|
import Quickshell
|
||||||
|
import qs.Services
|
||||||
|
import qs.Widgets
|
||||||
|
|
||||||
|
// Utilities: record & wallpaper
|
||||||
|
NBox {
|
||||||
|
Layout.fillWidth: true
|
||||||
|
Layout.preferredWidth: 1
|
||||||
|
implicitHeight: utilRow.implicitHeight + Style.marginMedium * 2 * scaling
|
||||||
|
RowLayout {
|
||||||
|
id: utilRow
|
||||||
|
anchors.fill: parent
|
||||||
|
anchors.margins: Style.marginSmall * scaling
|
||||||
|
spacing: sidePanel.cardSpacing
|
||||||
|
Item {
|
||||||
|
Layout.fillWidth: true
|
||||||
|
}
|
||||||
|
// Record
|
||||||
|
NIconButton {
|
||||||
|
icon: "fiber_manual_record"
|
||||||
|
}
|
||||||
|
// Wallpaper
|
||||||
|
NIconButton {
|
||||||
|
icon: "image"
|
||||||
|
}
|
||||||
|
Item {
|
||||||
|
Layout.fillWidth: true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -2,7 +2,6 @@ import QtQuick
|
||||||
import QtQuick.Controls
|
import QtQuick.Controls
|
||||||
import QtQuick.Layouts
|
import QtQuick.Layouts
|
||||||
import Quickshell
|
import Quickshell
|
||||||
import Quickshell.Wayland
|
|
||||||
import qs.Modules.SidePanel.Cards
|
import qs.Modules.SidePanel.Cards
|
||||||
import qs.Services
|
import qs.Services
|
||||||
import qs.Widgets
|
import qs.Widgets
|
||||||
|
|
@ -123,66 +122,10 @@ NLoader {
|
||||||
Layout.bottomMargin: 0
|
Layout.bottomMargin: 0
|
||||||
spacing: sidePanel.cardSpacing
|
spacing: sidePanel.cardSpacing
|
||||||
|
|
||||||
// Power Profiles: performance, balanced, eco
|
PowerProfileCard {}
|
||||||
NBox {
|
|
||||||
Layout.fillWidth: true
|
UtilitiesCard {}
|
||||||
Layout.preferredWidth: 1
|
|
||||||
implicitHeight: powerRow.implicitHeight + Style.marginSmall * 2 * scaling
|
|
||||||
RowLayout {
|
|
||||||
id: powerRow
|
|
||||||
anchors.fill: parent
|
|
||||||
anchors.margins: Style.marginSmall * scaling
|
|
||||||
spacing: sidePanel.cardSpacing
|
|
||||||
Item {
|
|
||||||
Layout.fillWidth: true
|
|
||||||
}
|
|
||||||
// Performance
|
|
||||||
NIconButton {
|
|
||||||
icon: "speed"
|
|
||||||
onClicked: function () {/* TODO: hook to power profile */ }
|
|
||||||
}
|
|
||||||
// Balanced
|
|
||||||
NIconButton {
|
|
||||||
icon: "balance"
|
|
||||||
onClicked: function () {/* TODO: hook to power profile */ }
|
|
||||||
}
|
|
||||||
// Eco
|
|
||||||
NIconButton {
|
|
||||||
icon: "eco"
|
|
||||||
onClicked: function () {/* TODO: hook to power profile */ }
|
|
||||||
}
|
|
||||||
Item {
|
|
||||||
Layout.fillWidth: true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Utilities: record & wallpaper
|
|
||||||
NBox {
|
|
||||||
Layout.fillWidth: true
|
|
||||||
Layout.preferredWidth: 1
|
|
||||||
implicitHeight: utilRow.implicitHeight + Style.marginSmall * 2 * scaling
|
|
||||||
RowLayout {
|
|
||||||
id: utilRow
|
|
||||||
anchors.fill: parent
|
|
||||||
anchors.margins: Style.marginSmall * scaling
|
|
||||||
spacing: sidePanel.cardSpacing
|
|
||||||
Item {
|
|
||||||
Layout.fillWidth: true
|
|
||||||
}
|
|
||||||
// Record
|
|
||||||
NIconButton {
|
|
||||||
icon: "fiber_manual_record"
|
|
||||||
}
|
|
||||||
// Wallpaper
|
|
||||||
NIconButton {
|
|
||||||
icon: "image"
|
|
||||||
}
|
|
||||||
Item {
|
|
||||||
Layout.fillWidth: true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue