Lock screen improvements
This commit is contained in:
@@ -206,9 +206,10 @@ accent = "{{ accent }}"
|
|||||||
background = "{{ background }}"
|
background = "{{ background }}"
|
||||||
background-alpha = 0.8
|
background-alpha = 0.8
|
||||||
text = "{{ foreground }}"
|
text = "{{ foreground }}"
|
||||||
|
placeholder = "{{ mix foreground background 34% }}"
|
||||||
text-error = "{{ red }}"
|
text-error = "{{ red }}"
|
||||||
border = "{{ shell_gradient hyprland_active_border foreground }}"
|
border = "{{ foreground }}"
|
||||||
border-active = "{{ shell_gradient hyprland_active_border accent }}"
|
border-active = "{{ accent }}"
|
||||||
border-error = "{{ red }}"
|
border-error = "{{ red }}"
|
||||||
border-alpha = 1.0
|
border-alpha = 1.0
|
||||||
# selection is the text-selection tint inside the input field.
|
# selection is the text-selection tint inside the input field.
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ QtObject {
|
|||||||
property color background: "#101315"
|
property color background: "#101315"
|
||||||
property color accent: "#cacccc"
|
property color accent: "#cacccc"
|
||||||
property color urgent: "#a55555"
|
property color urgent: "#a55555"
|
||||||
|
property color muted: "#707880"
|
||||||
|
|
||||||
// Flat dictionary of "section.key" -> raw string from shell.toml.
|
// Flat dictionary of "section.key" -> raw string from shell.toml.
|
||||||
// Reassigning this whole property is what makes surface bindings below
|
// Reassigning this whole property is what makes surface bindings below
|
||||||
@@ -49,6 +50,7 @@ QtObject {
|
|||||||
if (role === "foreground" || role === "text") return root.foreground
|
if (role === "foreground" || role === "text") return root.foreground
|
||||||
if (role === "accent") return root.accent
|
if (role === "accent") return root.accent
|
||||||
if (role === "urgent") return root.urgent
|
if (role === "urgent") return root.urgent
|
||||||
|
if (role === "muted") return root.muted
|
||||||
if (role === "background") return root.background
|
if (role === "background") return root.background
|
||||||
if (role === "transparent") return Qt.rgba(0, 0, 0, 0)
|
if (role === "transparent") return Qt.rgba(0, 0, 0, 0)
|
||||||
|
|
||||||
@@ -117,6 +119,7 @@ QtObject {
|
|||||||
readonly property QtObject lock: QtObject {
|
readonly property QtObject lock: QtObject {
|
||||||
property color background: root.composed("lock.background", "lock.background-alpha", root.background, 0.8)
|
property color background: root.composed("lock.background", "lock.background-alpha", root.background, 0.8)
|
||||||
property color text: root.pick("lock.text", root.foreground)
|
property color text: root.pick("lock.text", root.foreground)
|
||||||
|
property color placeholder: root.shellValues["lock.placeholder"] ? root.flatColor(root.shellValues["lock.placeholder"], Util.alpha(root.foreground, 0.66)) : Util.alpha(root.foreground, 0.66)
|
||||||
property color textError: root.pick("lock.text-error", root.urgent)
|
property color textError: root.pick("lock.text-error", root.urgent)
|
||||||
property color border: root.composed("lock.border", "lock.border-alpha", root.foreground, 1.0)
|
property color border: root.composed("lock.border", "lock.border-alpha", root.foreground, 1.0)
|
||||||
property color borderActive: root.composed("lock.border-active", "lock.border-alpha", root.accent, 1.0)
|
property color borderActive: root.composed("lock.border-active", "lock.border-alpha", root.accent, 1.0)
|
||||||
@@ -136,7 +139,9 @@ QtObject {
|
|||||||
function loadColors(raw) {
|
function loadColors(raw) {
|
||||||
var lines = String(raw || "").split("\n")
|
var lines = String(raw || "").split("\n")
|
||||||
var foundAccent = false
|
var foundAccent = false
|
||||||
|
var foundMuted = false
|
||||||
var color4Value = ""
|
var color4Value = ""
|
||||||
|
var color8Value = ""
|
||||||
for (var i = 0; i < lines.length; i++) {
|
for (var i = 0; i < lines.length; i++) {
|
||||||
var match = lines[i].match(/^\s*([A-Za-z0-9_-]+)\s*=\s*["']?(#[0-9A-Fa-f]{6})/)
|
var match = lines[i].match(/^\s*([A-Za-z0-9_-]+)\s*=\s*["']?(#[0-9A-Fa-f]{6})/)
|
||||||
if (!match) continue
|
if (!match) continue
|
||||||
@@ -146,10 +151,13 @@ QtObject {
|
|||||||
// theme doesn't define a separate accent. color4 appears later in the
|
// theme doesn't define a separate accent. color4 appears later in the
|
||||||
// file so the old single-property approach clobbered accent with it.
|
// file so the old single-property approach clobbered accent with it.
|
||||||
else if (match[1] === "accent") { accent = match[2]; foundAccent = true }
|
else if (match[1] === "accent") { accent = match[2]; foundAccent = true }
|
||||||
|
else if (match[1] === "muted") { muted = match[2]; foundMuted = true }
|
||||||
else if (match[1] === "color4") color4Value = match[2]
|
else if (match[1] === "color4") color4Value = match[2]
|
||||||
|
else if (match[1] === "color8") color8Value = match[2]
|
||||||
else if (match[1] === "red" || match[1] === "color1") urgent = match[2]
|
else if (match[1] === "red" || match[1] === "color1") urgent = match[2]
|
||||||
}
|
}
|
||||||
if (!foundAccent && color4Value.length > 0) accent = color4Value
|
if (!foundAccent && color4Value.length > 0) accent = color4Value
|
||||||
|
if (!foundMuted) muted = color8Value.length > 0 ? color8Value : foreground
|
||||||
}
|
}
|
||||||
|
|
||||||
// Single TOML walker for shell.toml. Both Color (surface roles) and Style
|
// Single TOML walker for shell.toml. Both Color (surface roles) and Style
|
||||||
|
|||||||
@@ -15,17 +15,15 @@ Item {
|
|||||||
property bool inputEnabled: true
|
property bool inputEnabled: true
|
||||||
property bool loadBackground: true
|
property bool loadBackground: true
|
||||||
property string passwordText: ""
|
property string passwordText: ""
|
||||||
property real scaleFactor: 1
|
|
||||||
property bool syncingPasswordText: false
|
property bool syncingPasswordText: false
|
||||||
|
|
||||||
readonly property string fingerprintGlyph: "\uDB80\uDE37"
|
readonly property string placeholderText: "Password"
|
||||||
readonly property string placeholderText: fingerprintConfigured ? "Enter Password " + fingerprintGlyph : "Enter Password"
|
readonly property int fieldWidth: 650
|
||||||
readonly property real effectiveScale: Math.max(1, scaleFactor)
|
readonly property int fieldHeight: 100
|
||||||
readonly property int fieldWidth: Math.round(650 / effectiveScale)
|
readonly property int outlineThickness: 4
|
||||||
readonly property int fieldHeight: Math.round(100 / effectiveScale)
|
|
||||||
readonly property int outlineThickness: Math.max(1, Math.round(4 / effectiveScale))
|
|
||||||
readonly property int fieldFontSize: Style.font.heading
|
readonly property int fieldFontSize: Style.font.heading
|
||||||
readonly property int passwordDotFontSize: Math.round(fieldFontSize * 1.3)
|
readonly property int passwordDotFontSize: Math.round(fieldFontSize * 2.0)
|
||||||
|
readonly property int passwordDotLetterSpacing: Math.round(fieldFontSize * 0.28)
|
||||||
readonly property bool showPasswordCursor: inputEnabled && !authenticatingPassword && failureMessage.length === 0
|
readonly property bool showPasswordCursor: inputEnabled && !authenticatingPassword && failureMessage.length === 0
|
||||||
readonly property string borderToken: failureMessage.length > 0 ? "border-error" : (authenticatingPassword ? "border-active" : "border")
|
readonly property string borderToken: failureMessage.length > 0 ? "border-error" : (authenticatingPassword ? "border-active" : "border")
|
||||||
readonly property color borderFallback: failureMessage.length > 0 ? Color.lock.borderError : (authenticatingPassword ? Color.lock.borderActive : Color.lock.border)
|
readonly property color borderFallback: failureMessage.length > 0 ? Color.lock.borderError : (authenticatingPassword ? Color.lock.borderActive : Color.lock.border)
|
||||||
@@ -90,8 +88,9 @@ Item {
|
|||||||
autoPaddingEnabled: false
|
autoPaddingEnabled: false
|
||||||
blurEnabled: root.loadBackground && wallpaper.status === Image.Ready
|
blurEnabled: root.loadBackground && wallpaper.status === Image.Ready
|
||||||
blur: 1.0
|
blur: 1.0
|
||||||
blurMax: 64
|
blurMax: 128
|
||||||
blurMultiplier: 1.0
|
blurMultiplier: 1.25
|
||||||
|
contrast: -0.08
|
||||||
}
|
}
|
||||||
|
|
||||||
MouseArea {
|
MouseArea {
|
||||||
@@ -108,7 +107,7 @@ Item {
|
|||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
color: Color.lock.background
|
color: Color.lock.background
|
||||||
borderSpec: root.inputBorderSpec
|
borderSpec: root.inputBorderSpec
|
||||||
radius: Style.cornerRadius
|
radius: 0
|
||||||
clip: true
|
clip: true
|
||||||
|
|
||||||
TextInput {
|
TextInput {
|
||||||
@@ -125,16 +124,17 @@ Item {
|
|||||||
enabled: root.inputEnabled && !root.authenticatingPassword
|
enabled: root.inputEnabled && !root.authenticatingPassword
|
||||||
readOnly: root.authenticatingPassword
|
readOnly: root.authenticatingPassword
|
||||||
echoMode: TextInput.Password
|
echoMode: TextInput.Password
|
||||||
passwordCharacter: "\u2022"
|
passwordCharacter: "\u25CF"
|
||||||
passwordMaskDelay: 0
|
passwordMaskDelay: 0
|
||||||
color: Color.lock.text
|
color: Color.lock.text
|
||||||
selectionColor: Color.lock.selection
|
selectionColor: Color.lock.selection
|
||||||
selectedTextColor: Color.lock.text
|
selectedTextColor: Color.lock.text
|
||||||
font.family: Style.font.family
|
font.family: Style.font.family
|
||||||
font.pixelSize: text.length > 0 ? root.passwordDotFontSize : root.fieldFontSize
|
font.pixelSize: text.length > 0 ? root.passwordDotFontSize : root.fieldFontSize
|
||||||
|
font.letterSpacing: text.length > 0 ? root.passwordDotLetterSpacing : 0
|
||||||
cursorVisible: activeFocus && root.showPasswordCursor && text.length > 0
|
cursorVisible: activeFocus && root.showPasswordCursor && text.length > 0
|
||||||
cursorDelegate: Rectangle {
|
cursorDelegate: Rectangle {
|
||||||
width: Math.max(1, Math.round(2 / root.effectiveScale))
|
width: 2
|
||||||
color: Color.lock.text
|
color: Color.lock.text
|
||||||
visible: passwordInput.cursorVisible
|
visible: passwordInput.cursorVisible
|
||||||
}
|
}
|
||||||
@@ -166,7 +166,7 @@ Item {
|
|||||||
anchors.fill: passwordInput
|
anchors.fill: passwordInput
|
||||||
text: root.authenticatingPassword ? "Checking…" : (root.failureMessage.length > 0 ? root.failureMessage : root.placeholderText)
|
text: root.authenticatingPassword ? "Checking…" : (root.failureMessage.length > 0 ? root.failureMessage : root.placeholderText)
|
||||||
visible: passwordInput.text.length === 0
|
visible: passwordInput.text.length === 0
|
||||||
color: (!root.authenticatingPassword && root.failureMessage.length > 0) ? Color.lock.textError : Color.lock.text
|
color: root.authenticatingPassword ? Color.lock.text : (root.failureMessage.length > 0 ? Color.lock.textError : Color.lock.placeholder)
|
||||||
font.family: Style.font.family
|
font.family: Style.font.family
|
||||||
font.pixelSize: root.fieldFontSize
|
font.pixelSize: root.fieldFontSize
|
||||||
font.italic: !root.authenticatingPassword && root.failureMessage.length > 0
|
font.italic: !root.authenticatingPassword && root.failureMessage.length > 0
|
||||||
|
|||||||
@@ -189,7 +189,6 @@ Item {
|
|||||||
inputEnabled: root.lockRequested
|
inputEnabled: root.lockRequested
|
||||||
loadBackground: root.locked
|
loadBackground: root.locked
|
||||||
passwordText: root.enteredPassword
|
passwordText: root.enteredPassword
|
||||||
scaleFactor: lockSurface.screen && lockSurface.screen.devicePixelRatio > 0 ? lockSurface.screen.devicePixelRatio : 1
|
|
||||||
onPasswordTextEdited: function(password) { root.enteredPassword = password }
|
onPasswordTextEdited: function(password) { root.enteredPassword = password }
|
||||||
onSubmitPassword: function(password) { root.submitPassword(password) }
|
onSubmitPassword: function(password) { root.submitPassword(password) }
|
||||||
onClearFailureRequested: root.failureMessage = ""
|
onClearFailureRequested: root.failureMessage = ""
|
||||||
@@ -220,7 +219,6 @@ Item {
|
|||||||
inputEnabled: false
|
inputEnabled: false
|
||||||
loadBackground: root.previewVisible
|
loadBackground: root.previewVisible
|
||||||
passwordText: ""
|
passwordText: ""
|
||||||
scaleFactor: previewWindow.screen && previewWindow.screen.devicePixelRatio > 0 ? previewWindow.screen.devicePixelRatio : 1
|
|
||||||
}
|
}
|
||||||
|
|
||||||
MouseArea {
|
MouseArea {
|
||||||
|
|||||||
Reference in New Issue
Block a user