Allow to customize font color

This commit is contained in:
hat3ph
2024-06-09 11:15:20 +08:00
committed by GitHub
parent 6b53193506
commit b56c52d06b
4 changed files with 28 additions and 20 deletions

View File

@@ -25,7 +25,7 @@ Rectangle {
}
function onLoginFailed() {
error_message.color = "#dc322f"
error_message.color = config.errorMsgFontColor
error_message.text = textConstants.loginFailed
}
}
@@ -207,7 +207,7 @@ Rectangle {
Column {
id: clock
property date dateTime: new Date()
property color color: "white"
property color color: config.clockFontColor
y: parent.height * config.relativePositionY - clock.height / 2
x: parent.width * config.relativePositionX - clock.width / 2
@@ -263,7 +263,7 @@ Rectangle {
font.family: textFont.name
font.bold: true
font.pixelSize: config.labelFontSize
color: "white"
color: config.labelFontColor
text: "Username"
anchors.verticalCenter: parent.verticalCenter
}
@@ -280,7 +280,7 @@ Rectangle {
font: textFont.name
color: "#25000000"
borderColor: "transparent"
textColor: "white"
textColor: config.labelFontColor
Keys.onPressed: {
if (event.key === Qt.Key_Return || event.key === Qt.Key_Enter) {
@@ -313,7 +313,7 @@ Rectangle {
font.family: textFont.name
font.bold: true
font.pixelSize: config.labelFontSize
color: "white"
color: config.labelFontColor
}
PasswordBox {
@@ -327,7 +327,7 @@ Rectangle {
anchors.left: password_label.right
anchors.leftMargin: config.passwordLeftMargin
borderColor: "transparent"
textColor: "white"
textColor: config.labelFontColor
tooltipBG: "#25000000"
tooltipFG: "#dc322f"
image: "components/resources/warning_red.png"
@@ -357,6 +357,7 @@ Rectangle {
width: parent.height
color: "transparent"
text: "x"
textColor: config.labelFontColor
font: textFont.name
border.color: "transparent"
@@ -388,7 +389,7 @@ Rectangle {
disabledColor: "#dc322f"
activeColor: "#268bd2"
pressedColor: "#2aa198"
textColor: "white"
textColor: config.labelFontColor
font: textFont.name
onClicked: sddm.login(username_input_box.text, password_input_box.text, session.index)
@@ -402,7 +403,7 @@ Rectangle {
height: parent.height
font.family: textFont.name
font.pixelSize: config.errorMsgFontSize
color: "white"
//color: "white"
anchors.top: password_input_box.bottom
anchors.left: password_input_box.left
anchors.leftMargin: 0
@@ -436,9 +437,11 @@ Rectangle {
anchors.verticalCenter: parent.verticalCenter
color: "transparent"
arrowColor: "transparent"
textColor: "#505050"
textColor: config.actionBarFontColor
borderColor: "transparent"
hoverColor: "#5692c4"
font.family: textFont.name
font.pixelSize: config.actionBarFontSize
model: sessionModel
index: sessionModel.lastIndex
@@ -457,7 +460,7 @@ Rectangle {
anchors.verticalCenter: parent.verticalCenter
color: "transparent"
arrowColor: "transparent"
textColor: "white"
//textColor: "white"
borderColor: "transparent"
hoverColor: "#5692c4"
@@ -483,8 +486,8 @@ Rectangle {
text: modelItem ? modelItem.modelData.shortName : "zz"
font.family: textFont.name
font.pixelSize: config.languageBoxFontSize
color: "#505050"
font.pixelSize: config.actionBarFontSize
color: config.actionBarFontColor
}
}
KeyNavigation.backtab: session

View File

@@ -61,7 +61,8 @@ You can change a few settings in this file
- `bgImgDay` and `bgImgNight` - default background day/night image, now support GIF animated image
- `bgVidDay` and `bgImgNight` - video day/night playlists
- `displayFont` - font
- `clockFontSize`, `dateFontSize`, `labelFontSize`, `errorMsgFontSize` and `languageBoxFontSize` - customize font size
- `clockFontSize`, `dateFontSize`, `labelFontSize`, `errorMsgFontSize` and `actionBarFontSize` - customize font size
- `clockFontColor`, `labelFontColor` and `actionBarFontColor` - customize font color
- `dateFormat` and `timeFormat` - customize [date and time](https://doc.qt.io/qt-5/qml-qtqml-date.html) format
- `showLoginButton` - if set to false will hide the login button
- `showClearPasswordButton` - if set to false will hide the clear password button that appears when text is inputed
@@ -84,10 +85,11 @@ showTopBar=true
### Note that some configs names have changed from previous values:
```
day_time_start => dayTimeStart
day_time_end => dayTimeEnd
background_vid_day => bgVidDay
background_vid_night => bgVidNight
day_time_start => dayTimeStart
day_time_end => dayTimeEnd
background_vid_day => bgVidDay
background_vid_night => bgVidNight
languageBoxFontSize => actionBarFontSize
```
## Preview

View File

@@ -10,7 +10,7 @@ clockFontSize="72"
dateFontSize="24"
labelFontSize="16"
errorMsgFontSize="12"
languageBoxFontSize="14"
actionBarFontSize="14"
timeFormat="hh:mm"
dateFormat="dddd, dd MMMM yyyy"
showLoginButton=true
@@ -19,4 +19,8 @@ usernameLeftMargin=15
relativePositionX=0.3
relativePositionY=0.7
showTopBar=true
autofocusInput=true
autofocusInput=true
errorMsgFontColor="#dc322f"
clockFontColor="white"
labelFontColor="white"
actionBarFontColor="#505050"

View File

@@ -8,7 +8,6 @@ passwordLeftMargin=15
relativePositionX=0.5
relativePositionY=0.75
showLoginButton=false
type=color
usernameLeftMargin=15
showTopBar=true
autofocusInput=true