Add font settings, replace some Text with NText
This commit is contained in:
parent
784eb0e592
commit
bb4510bbcd
6 changed files with 72 additions and 27 deletions
|
|
@ -223,7 +223,12 @@ Singleton {
|
|||
property JsonObject ui
|
||||
|
||||
ui: JsonObject {
|
||||
property string fontFamily: "Roboto" // Family for all text
|
||||
property string fontDefault: "Roboto" // Default font for all text
|
||||
property string fontFixed: "DejaVu Sans Mono" // Fixed width font for terminal
|
||||
property string fontBillboard: "Inter" // Large bold font for clocks and prominent displays
|
||||
|
||||
// Legacy compatibility
|
||||
property string fontFamily: fontDefault // Keep for backward compatibility
|
||||
}
|
||||
|
||||
// Scaling (not stored inside JsonObject, or it crashes)
|
||||
|
|
|
|||
|
|
@ -369,7 +369,7 @@ NLoader {
|
|||
visible: !parent.iconLoaded
|
||||
}
|
||||
|
||||
Text {
|
||||
NText {
|
||||
anchors.centerIn: parent
|
||||
visible: !parent.iconLoaded && !(modelData.isCalculator || modelData.isClipboard
|
||||
|| modelData.isCommand)
|
||||
|
|
|
|||
|
|
@ -233,13 +233,13 @@ NLoader {
|
|||
|
||||
// Time display - Large and prominent with pulse animation
|
||||
Column {
|
||||
spacing: Style.marginS * scaling
|
||||
spacing: Style.marginXS * scaling
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
|
||||
Text {
|
||||
NText {
|
||||
id: timeText
|
||||
text: Qt.formatDateTime(new Date(), "HH:mm")
|
||||
font.family: "Inter"
|
||||
font.family: Settings.data.ui.fontBillboard
|
||||
font.pointSize: Style.fontSizeXXXL * 6 * scaling
|
||||
font.weight: Font.Bold
|
||||
font.letterSpacing: -2 * scaling
|
||||
|
|
@ -261,10 +261,10 @@ NLoader {
|
|||
}
|
||||
}
|
||||
|
||||
Text {
|
||||
NText {
|
||||
id: dateText
|
||||
text: Qt.formatDateTime(new Date(), "dddd, MMMM d")
|
||||
font.family: "Inter"
|
||||
font.family: Settings.data.ui.fontBillboard
|
||||
font.pointSize: Style.fontSizeXXL * scaling
|
||||
font.weight: Font.Light
|
||||
color: Color.mOnSurface
|
||||
|
|
@ -404,10 +404,10 @@ NLoader {
|
|||
anchors.margins: Style.marginM * scaling
|
||||
spacing: Style.marginM * scaling
|
||||
|
||||
Text {
|
||||
NText {
|
||||
text: "SECURE TERMINAL"
|
||||
color: Color.mOnSurface
|
||||
font.family: "DejaVu Sans Mono"
|
||||
font.family: Settings.data.ui.fontFixed
|
||||
font.pointSize: Style.fontSizeL * scaling
|
||||
font.weight: Font.Bold
|
||||
Layout.fillWidth: true
|
||||
|
|
@ -424,10 +424,10 @@ NLoader {
|
|||
color: batteryIndicator.charging ? Color.mPrimary : Color.mOnSurface
|
||||
}
|
||||
|
||||
Text {
|
||||
NText {
|
||||
text: Math.round(batteryIndicator.percent) + "%"
|
||||
color: Color.mOnSurface
|
||||
font.family: "DejaVu Sans Mono"
|
||||
font.family: Settings.data.ui.fontFixed
|
||||
font.pointSize: Style.fontSizeM * scaling
|
||||
font.weight: Font.Bold
|
||||
}
|
||||
|
|
@ -450,19 +450,19 @@ NLoader {
|
|||
Layout.fillWidth: true
|
||||
spacing: Style.marginM * scaling
|
||||
|
||||
Text {
|
||||
NText {
|
||||
text: "root@noctalia:~$"
|
||||
color: Color.mPrimary
|
||||
font.family: "DejaVu Sans Mono"
|
||||
font.family: Settings.data.ui.fontFixed
|
||||
font.pointSize: Style.fontSizeL * scaling
|
||||
font.weight: Font.Bold
|
||||
}
|
||||
|
||||
Text {
|
||||
NText {
|
||||
id: welcomeText
|
||||
text: ""
|
||||
color: Color.mOnSurface
|
||||
font.family: "DejaVu Sans Mono"
|
||||
font.family: Settings.data.ui.fontFixed
|
||||
font.pointSize: Style.fontSizeL * scaling
|
||||
property int currentIndex: 0
|
||||
property string fullText: "Welcome back, " + Quickshell.env("USER") + "!"
|
||||
|
|
@ -488,18 +488,18 @@ NLoader {
|
|||
Layout.fillWidth: true
|
||||
spacing: Style.marginM * scaling
|
||||
|
||||
Text {
|
||||
NText {
|
||||
text: "root@noctalia:~$"
|
||||
color: Color.mPrimary
|
||||
font.family: "DejaVu Sans Mono"
|
||||
font.family: Settings.data.ui.fontFixed
|
||||
font.pointSize: Style.fontSizeL * scaling
|
||||
font.weight: Font.Bold
|
||||
}
|
||||
|
||||
Text {
|
||||
NText {
|
||||
text: "sudo unlock-session"
|
||||
color: Color.mOnSurface
|
||||
font.family: "DejaVu Sans Mono"
|
||||
font.family: Settings.data.ui.fontFixed
|
||||
font.pointSize: Style.fontSizeL * scaling
|
||||
}
|
||||
|
||||
|
|
@ -509,7 +509,7 @@ NLoader {
|
|||
width: 0
|
||||
height: 0
|
||||
visible: false
|
||||
font.family: "DejaVu Sans Mono"
|
||||
font.family: Settings.data.ui.fontFixed
|
||||
font.pointSize: Style.fontSizeL * scaling
|
||||
color: Color.mOnSurface
|
||||
echoMode: TextInput.Password
|
||||
|
|
@ -535,11 +535,11 @@ NLoader {
|
|||
}
|
||||
|
||||
// Visual password display with integrated cursor
|
||||
Text {
|
||||
NText {
|
||||
id: asterisksText
|
||||
text: "*".repeat(passwordInput.text.length)
|
||||
color: Color.mOnSurface
|
||||
font.family: "DejaVu Sans Mono"
|
||||
font.family: Settings.data.ui.fontFixed
|
||||
font.pointSize: Style.fontSizeL * scaling
|
||||
visible: passwordInput.activeFocus
|
||||
|
||||
|
|
@ -585,7 +585,7 @@ NLoader {
|
|||
}
|
||||
|
||||
// Status messages
|
||||
Text {
|
||||
NText {
|
||||
text: lock.authenticating ? "Authenticating..." : (lock.errorMessage !== "" ? "Authentication failed." : "")
|
||||
color: lock.authenticating ? Color.mPrimary : (lock.errorMessage !== "" ? Color.mError : Color.transparent)
|
||||
font.family: "DejaVu Sans Mono"
|
||||
|
|
@ -618,11 +618,11 @@ NLoader {
|
|||
Layout.alignment: Qt.AlignRight
|
||||
Layout.bottomMargin: -12 * scaling
|
||||
|
||||
Text {
|
||||
NText {
|
||||
anchors.centerIn: parent
|
||||
text: lock.authenticating ? "EXECUTING" : "EXECUTE"
|
||||
color: executeButtonArea.containsMouse ? Color.mOnPrimary : Color.mPrimary
|
||||
font.family: "DejaVu Sans Mono"
|
||||
font.family: Settings.data.ui.fontFixed
|
||||
font.pointSize: Style.fontSizeM * scaling
|
||||
font.weight: Font.Bold
|
||||
}
|
||||
|
|
|
|||
|
|
@ -92,6 +92,45 @@ ColumnLayout {
|
|||
Layout.bottomMargin: Style.marginS * scaling
|
||||
}
|
||||
|
||||
// Font configuration section
|
||||
ColumnLayout {
|
||||
spacing: Style.marginS * scaling
|
||||
Layout.fillWidth: true
|
||||
|
||||
NTextInput {
|
||||
label: "Default Font"
|
||||
description: "Main font used throughout the interface."
|
||||
text: Settings.data.ui.fontDefault
|
||||
placeholderText: "Roboto"
|
||||
Layout.fillWidth: true
|
||||
onEditingFinished: {
|
||||
Settings.data.ui.fontDefault = text
|
||||
}
|
||||
}
|
||||
|
||||
NTextInput {
|
||||
label: "Fixed Width Font"
|
||||
description: "Monospace font used for terminal and code display."
|
||||
text: Settings.data.ui.fontFixed
|
||||
placeholderText: "DejaVu Sans Mono"
|
||||
Layout.fillWidth: true
|
||||
onEditingFinished: {
|
||||
Settings.data.ui.fontFixed = text
|
||||
}
|
||||
}
|
||||
|
||||
NTextInput {
|
||||
label: "Billboard Font"
|
||||
description: "Large font used for clocks and prominent displays."
|
||||
text: Settings.data.ui.fontBillboard
|
||||
placeholderText: "Inter"
|
||||
Layout.fillWidth: true
|
||||
onEditingFinished: {
|
||||
Settings.data.ui.fontBillboard = text
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
NToggle {
|
||||
label: "Show Corners"
|
||||
description: "Display rounded corners on the edge of the screen."
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
import QtQuick
|
||||
import qs.Commons
|
||||
import qs.Services
|
||||
import qs.Widgets
|
||||
|
||||
// Compact circular statistic display used in the SidePanel
|
||||
Rectangle {
|
||||
|
|
@ -73,7 +74,7 @@ Rectangle {
|
|||
}
|
||||
|
||||
// Percent centered in the circle
|
||||
Text {
|
||||
NText {
|
||||
id: valueLabel
|
||||
anchors.centerIn: parent
|
||||
text: `${root.value}${root.suffix}`
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ import qs.Widgets
|
|||
Text {
|
||||
id: root
|
||||
|
||||
font.family: Settings.data.ui.fontFamily
|
||||
font.family: Settings.data.ui.fontDefault
|
||||
font.pointSize: Style.fontSizeM * scaling
|
||||
font.weight: Style.fontWeightMedium
|
||||
color: Color.mOnSurface
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue