prettify power layout

This commit is contained in:
ash 2023-01-06 23:10:13 -05:00
parent 34f747b081
commit b21845a073
12 changed files with 66 additions and 26 deletions

View file

@ -10,6 +10,7 @@ TextField {
echoMode: TextInput.Password
passwordCharacter: "•"
passwordMaskDelay: 1000
selectionColor: config.TextFieldTextColor
renderType: Text.NativeRendering
font.family: config.Font

View file

@ -1,5 +1,6 @@
import QtQuick 2.12
import QtQuick.Controls 2.12
import QtGraphicalEffects 1.12
Item {
implicitHeight: powerButton.height
@ -10,7 +11,7 @@ Item {
ListElement { name: "Sleep" }
ListElement { name: "Restart" }
ListElement { name: "Shut Down" }
ListElement { name: "Shut\nDown" }
}
Button {
@ -20,9 +21,9 @@ Item {
width: inputHeight
hoverEnabled: true
icon.source: Qt.resolvedUrl("../icons/power_menu.png")
icon.height: height * 0.5
icon.width: width * 0.5
icon.source: Qt.resolvedUrl("../icons/power.svg")
icon.height: height * 0.8
icon.width: width * 0.8
icon.color: config.PowerIconColor
background: Rectangle {
@ -75,7 +76,7 @@ Item {
Popup {
id: powerPopup
height: (padding + inputHeight) * 2
height: inputHeight * 2.2 + padding * 2
x: powerButton.width + powerList.spacing
y: -height + powerButton.height
padding: 15
@ -97,18 +98,40 @@ Item {
delegate: ItemDelegate {
id: powerEntry
height: inputHeight * 2
width: inputHeight * 2
height: inputHeight * 2.2
width: inputHeight * 2.2
display: AbstractButton.TextUnderIcon
contentItem: Text {
renderType: Text.NativeRendering
font.family: config.Font
font.pointSize: config.GeneralFontSize
font.bold: true
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
color: config.PopupBgColor
text: name
contentItem: Item {
Image {
id: powerIcon
anchors.centerIn: parent
source: index == 0 ? Qt.resolvedUrl("../icons/sleep.svg") : (index == 1 ? Qt.resolvedUrl("../icons/restart.svg") : Qt.resolvedUrl("../icons/power.svg"))
sourceSize: Qt.size(powerEntry.width * 0.5, powerEntry.height * 0.5)
}
ColorOverlay {
id: iconOverlay
anchors.fill: powerIcon
source: powerIcon
color: config.PopupBgColor
}
Text {
id: powerText
anchors.centerIn: parent
renderType: Text.NativeRendering
font.family: config.Font
font.pointSize: config.GeneralFontSize
font.bold: true
horizontalAlignment: Text.AlignHCenter
color: config.PopupBgColor
text: name
opacity: 0
}
}
background: Rectangle {
@ -126,12 +149,20 @@ Item {
target: powerEntryBg
color: Qt.darker(config.PopupHighlightColor, 1.2)
}
PropertyChanges {
target: iconOverlay
color: Qt.darker(config.PopupHighlightColor, 1.2)
}
PropertyChanges {
target: powerText
opacity: 1
}
}
]
transitions: Transition {
PropertyAnimation {
property: "color"
properties: "color, opacity"
duration: 150
}
}
@ -140,7 +171,7 @@ Item {
anchors.fill: parent
onClicked: {
powerPopup.close()
index == 0 ? sddm.suspend() : index == 1 ? sddm.reboot() : sddm.powerOff()
index == 0 ? sddm.suspend() : (index == 1 ? sddm.reboot() : sddm.powerOff())
}
}
}

View file

@ -72,9 +72,9 @@ Item {
width: inputHeight
hoverEnabled: true
icon.source: Qt.resolvedUrl("../icons/session_menu.png")
icon.height: height * 0.5
icon.width: width * 0.5
icon.source: Qt.resolvedUrl("../icons/settings.svg")
icon.height: height * 0.8
icon.width: width * 0.8
icon.color: config.SessionIconColor
background: Rectangle {

View file

@ -9,6 +9,7 @@ TextField {
width: inputWidth
selectByMouse: true
echoMode: TextInput.Normal
selectionColor: config.TextFieldTextColor
renderType: Text.NativeRendering
font.family: config.Font

View file

@ -163,8 +163,8 @@ Column {
name: "hovered"
PropertyChanges {
target: pictureBorder
border.color: Qt.darker(config.UserPictureBorderColor, 1.2)
color: Qt.darker(config.UserPictureColor, 1.2)
border.color: Qt.darker(config.UserPictureBorderColor, 1.4)
color: Qt.darker(config.UserPictureColor, 1.4)
}
},
State {

1
icons/power.svg Normal file
View file

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" height="48" width="48"><path d="M24 26.1q-1 0-1.675-.675t-.675-1.675V6.9q0-1 .675-1.7T24 4.5q1 0 1.675.7t.675 1.7v16.85q0 1-.675 1.675T24 26.1Zm0 17.25q-4 0-7.5-1.5t-6.125-4.125Q7.75 35.1 6.25 31.6t-1.5-7.5q0-3.5 1.25-6.725Q7.25 14.15 9.6 11.6q.65-.8 1.7-.9 1.05-.1 1.85.6.7.7.675 1.675-.025.975-.625 1.725-1.75 1.95-2.75 4.35-1 2.4-1 5.05 0 6.05 4.25 10.3 4.25 4.25 10.3 4.25 6.05 0 10.3-4.25 4.25-4.25 4.25-10.3 0-2.65-.975-5.05T34.85 14.7q-.6-.8-.6-1.775 0-.975.7-1.625.8-.75 1.875-.6 1.075.15 1.825 1 2.25 2.55 3.45 5.75 1.2 3.2 1.2 6.65 0 4-1.525 7.5t-4.15 6.125Q35 40.35 31.5 41.85t-7.5 1.5Z"/></svg>

After

Width:  |  Height:  |  Size: 646 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.8 KiB

1
icons/restart.svg Normal file
View file

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" height="48" width="48"><path d="M19.8 42.7q-5.65-1.35-9.35-5.95-3.7-4.6-3.7-10.65 0-3.3 1.325-6.325Q9.4 16.75 11.85 14.6q.55-.8 1.625-.8t1.825.75q.6.6.6 1.475 0 .875-.65 1.575-1.8 1.6-2.8 3.85-1 2.25-1 4.65 0 4.35 2.6 7.625Q16.65 37 20.7 38q.8.3 1.325.95.525.65.525 1.45 0 1.25-.85 1.925t-1.9.375Zm8.55 0q-1.1.35-1.95-.35-.85-.7-.85-1.9 0-.75.525-1.45t1.325-1q4.1-1 6.65-4.275Q36.6 30.45 36.6 26.1q0-5-3.375-8.6-3.375-3.6-8.375-3.9H23.7l2 2q.45.5.45 1.25t-.45 1.25q-.55.55-1.325.55-.775 0-1.275-.55l-5.5-5.45q-.35-.35-.525-.775Q16.9 11.45 16.9 11q0-.5.175-.9t.525-.75l5.5-5.6q.5-.45 1.275-.45.775 0 1.325.45.45.55.45 1.325 0 .775-.45 1.275l-2.55 2.5h1.2q7.1 0 12.05 5.075Q41.35 19 41.35 26.1q0 6.05-3.7 10.65-3.7 4.6-9.3 5.95Z"/></svg>

After

Width:  |  Height:  |  Size: 775 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4 KiB

1
icons/settings.svg Normal file
View file

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" height="48" width="48"><path d="M27.3 44h-6.6q-.55 0-.975-.35-.425-.35-.525-.9l-.8-5.05q-.95-.35-2-.95t-1.85-1.25L9.9 37.65q-.55.25-1.1.075T7.95 37l-3.3-5.85q-.3-.5-.15-1.05t.6-.9l4.3-3.15q-.1-.45-.125-1.025Q9.25 24.45 9.25 24q0-.45.025-1.025T9.4 21.95L5.1 18.8q-.45-.35-.6-.9-.15-.55.15-1.05L7.95 11q.3-.55.85-.725.55-.175 1.1.075l4.65 2.15q.8-.65 1.85-1.25t2-.9l.8-5.1q.1-.55.525-.9Q20.15 4 20.7 4h6.6q.55 0 .975.35.425.35.525.9l.8 5.05q.95.35 2.025.925Q32.7 11.8 33.45 12.5l4.65-2.15q.55-.25 1.1-.075t.85.725l3.3 5.8q.3.5.175 1.075t-.625.925l-4.3 3.05q.1.5.125 1.075.025.575.025 1.075t-.025 1.05q-.025.55-.125 1.05l4.3 3.1q.45.35.6.9.15.55-.15 1.05L40.05 37q-.3.55-.85.725-.55.175-1.1-.075l-4.65-2.15q-.8.65-1.825 1.275-1.025.625-2.025.925l-.8 5.05q-.1.55-.525.9-.425.35-.975.35ZM24 30.5q2.7 0 4.6-1.9 1.9-1.9 1.9-4.6 0-2.7-1.9-4.6-1.9-1.9-4.6-1.9-2.7 0-4.6 1.9-1.9 1.9-1.9 4.6 0 2.7 1.9 4.6 1.9 1.9 4.6 1.9Z"/></svg>

After

Width:  |  Height:  |  Size: 960 B

1
icons/sleep.svg Normal file
View file

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" height="48" width="48"><path d="M40.95 36.75q-3.25 3.95-7.725 6.3Q28.75 45.4 23.9 45.4q-4.6 0-8.525-1.625-3.925-1.625-6.75-4.475Q5.8 36.45 4.2 32.525 2.6 28.6 2.6 24q0-8.45 5.5-14.05 5.5-5.6 12.95-6.8 1.7-.25 2.5.85t.2 2.85q-1.5 4.55-1.2 8.85.3 4.3 2.25 7.825 1.95 3.525 5.5 5.975 3.55 2.45 8.65 3.25 1.85.3 2.45 1.475.6 1.175-.45 2.525Z"/></svg>

After

Width:  |  Height:  |  Size: 386 B

View file

@ -21,12 +21,15 @@ TextFieldTextColor="#c0caf5"
LoginButtonTextColor="#414868"
LoginButtonBgColor="#c0caf5"
PopupBgColor="#414868"
PopupHighlightColor="#c0caf5"
PopupBgColor="#c0caf5"
PopupHighlightColor="#414868"
SessionButtonColor="#c0caf5"
SessionIconColor="#414868"
PowerButtonColor="#c0caf5"
PowerIconColor="#414868"
DateColor="#c0caf5"
DateSize="36"
DateIsBold="false"