Fix configuration scroll view

This commit is contained in:
qewer33 2024-04-18 20:52:06 +03:00
parent 773f9b8820
commit cee507a227

View file

@ -14,7 +14,7 @@ import org.kde.kcmutils as KCM
import "../lib" import "../lib"
KCM.SimpleKCM { KCM.ScrollViewKCM {
id: appearancePage id: appearancePage
width: childrenRect.width width: childrenRect.width
height: childrenRect.height height: childrenRect.height
@ -81,283 +81,279 @@ KCM.SimpleKCM {
} }
} }
QtControls.ScrollView { QtLayouts.ColumnLayout {
id: scrollView id: layout
anchors.fill: parent
spacing: 30
QtLayouts.ColumnLayout { QtLayouts.ColumnLayout {
id: layout QtLayouts.Layout.fillWidth: true
anchors.fill: parent spacing: 10
spacing: 30
QtLayouts.ColumnLayout { QtControls.Label {
QtLayouts.Layout.fillWidth: true text: i18n("Clock Display Settings")
spacing: 10 font.bold: true
font.pixelSize: 17
}
QtControls.CheckBox {
id: use24hFormat
text: i18n("Use 24-hour clock")
tristate: false
checked: cfg_clockUse24hFormat
}
QtControls.CheckBox {
id: showSeconds
text: i18n("Show seconds")
tristate: false
checked: cfg_clockShowSeconds
}
QtLayouts.RowLayout {
QtControls.Label {
text: i18n("Separator:")
}
QtControls.TextField {
id: clockSeparatorTextField
maximumLength: 1
}
}
FontConfig {
fontModel: fontsModel
colorValue: cfg_clockFontColor
onColorValueChanged: {
cfg_clockFontColor = colorValue
}
fontValue: cfg_clockFontFamily
onFontValueChanged: {
cfg_clockFontFamily = fontValue
}
boldValue: cfg_clockBoldText
onBoldValueChanged: {
cfg_clockBoldText = boldValue
}
italicValue: cfg_clockItalicText
onItalicValueChanged: {
cfg_clockItalicText = italicValue
}
pxSizeValue: cfg_clockFontSize
onPxSizeValueChanged: {
cfg_clockFontSize = pxSizeValue
}
}
QtControls.CheckBox {
id: clockShadowCheckBox
text: i18n("Enable shadow")
tristate: false
checked: cfg_clockShadowEnabled
}
ShadowConfig {
enabled: clockShadowCheckBox.checked
colorValue: cfg_clockShadowColor
onColorValueChanged: {
cfg_clockShadowColor = colorValue
}
radiusValue: cfg_clockShadowRadius
onRadiusValueChanged: {
cfg_clockShadowRadius = radiusValue
}
offsetXValue: cfg_clockShadowXOffset
onOffsetXValueChanged: {
cfg_clockShadowXOffset = offsetXValue
}
offsetYValue: cfg_clockShadowYOffset
onOffsetYValueChanged: {
cfg_clockShadowYOffset = offsetYValue
}
}
}
QtLayouts.ColumnLayout {
QtLayouts.Layout.fillWidth: true
spacing: 10
QtControls.Label {
text: i18n("Day Display Settings")
font.bold: true
font.pixelSize: 17
}
QtControls.CheckBox {
id: showDayDisplayCheckBox
text: i18n("Show day display")
}
FontConfig {
fontModel: fontsModel
enabled: showDayDisplayCheckBox.checked
colorValue: cfg_dayFontColor
onColorValueChanged: {
cfg_dayFontColor = colorValue
}
fontValue: cfg_dayFontFamily
onFontValueChanged: {
cfg_dayFontFamily = fontValue
}
boldValue: cfg_dayBoldText
onBoldValueChanged: {
cfg_dayBoldText = boldValue
}
italicValue: cfg_dayItalicText
onItalicValueChanged: {
cfg_dayItalicText = italicValue
}
pxSizeValue: cfg_dayFontSize
onPxSizeValueChanged: {
cfg_dayFontSize = pxSizeValue
}
}
QtControls.CheckBox {
id: dayShadowCheckBox
text: i18n("Enable shadow")
tristate: false
checked: cfg_dayShadowEnabled
}
ShadowConfig {
enabled: dayShadowCheckBox.checked
colorValue: cfg_dayShadowColor
onColorValueChanged: {
cfg_dayShadowColor = colorValue
}
radiusValue: cfg_dayShadowRadius
onRadiusValueChanged: {
cfg_dayShadowRadius = radiusValue
}
offsetXValue: cfg_dayShadowXOffset
onOffsetXValueChanged: {
cfg_dayShadowXOffset = offsetXValue
}
offsetYValue: cfg_clockShadowYOffset
onOffsetYValueChanged: {
cfg_dayShadowYOffset = offsetYValue
}
}
}
QtLayouts.ColumnLayout {
QtLayouts.Layout.fillWidth: true
spacing: 10
QtControls.Label {
text: i18n("Date Display Settings")
font.bold: true
font.pixelSize: 17
}
QtControls.CheckBox {
id: showDateDisplayCheckBox
text: i18n("Show date display")
}
QtLayouts.RowLayout {
enabled: showDateDisplayCheckBox.checked
QtControls.Label { QtControls.Label {
text: i18n("Clock Display Settings") text: i18n("Date format:")
font.bold: true opacity: if (enabled) 1
font.pixelSize: 17 else 0.4
}
QtControls.CheckBox {
id: use24hFormat
text: i18n("Use 24-hour clock")
tristate: false
checked: cfg_clockUse24hFormat
}
QtControls.CheckBox {
id: showSeconds
text: i18n("Show seconds")
tristate: false
checked: cfg_clockShowSeconds
} }
QtLayouts.RowLayout { QtLayouts.RowLayout {
QtControls.Label {
text: i18n("Separator:")
}
QtControls.TextField { QtControls.TextField {
id: clockSeparatorTextField id: customDateFormat
maximumLength: 1 QtLayouts.Layout.fillWidth: true
}
}
FontConfig {
fontModel: fontsModel
colorValue: cfg_clockFontColor
onColorValueChanged: {
cfg_clockFontColor = colorValue
} }
fontValue: cfg_clockFontFamily QtControls.Button {
onFontValueChanged: { icon.name: "exifinfo"
cfg_clockFontFamily = fontValue onClicked: Qt.openUrlExternally("https://doc.qt.io/qt-5/qml-qtqml-qt.html#formatDateTime-method")
}
boldValue: cfg_clockBoldText
onBoldValueChanged: {
cfg_clockBoldText = boldValue
}
italicValue: cfg_clockItalicText
onItalicValueChanged: {
cfg_clockItalicText = italicValue
}
pxSizeValue: cfg_clockFontSize
onPxSizeValueChanged: {
cfg_clockFontSize = pxSizeValue
}
}
QtControls.CheckBox {
id: clockShadowCheckBox
text: i18n("Enable shadow")
tristate: false
checked: cfg_clockShadowEnabled
}
ShadowConfig {
enabled: clockShadowCheckBox.checked
colorValue: cfg_clockShadowColor
onColorValueChanged: {
cfg_clockShadowColor = colorValue
}
radiusValue: cfg_clockShadowRadius
onRadiusValueChanged: {
cfg_clockShadowRadius = radiusValue
}
offsetXValue: cfg_clockShadowXOffset
onOffsetXValueChanged: {
cfg_clockShadowXOffset = offsetXValue
}
offsetYValue: cfg_clockShadowYOffset
onOffsetYValueChanged: {
cfg_clockShadowYOffset = offsetYValue
} }
} }
} }
QtLayouts.ColumnLayout { FontConfig {
QtLayouts.Layout.fillWidth: true fontModel: fontsModel
spacing: 10 enabled: showDateDisplayCheckBox.checked
QtControls.Label { colorValue: cfg_dateFontColor
text: i18n("Day Display Settings") onColorValueChanged: {
font.bold: true cfg_dateFontColor = colorValue
font.pixelSize: 17
} }
QtControls.CheckBox { fontValue: cfg_dateFontFamily
id: showDayDisplayCheckBox onFontValueChanged: {
text: i18n("Show day display") cfg_dateFontFamily = fontValue
} }
FontConfig { boldValue: cfg_dateBoldText
fontModel: fontsModel onBoldValueChanged: {
enabled: showDayDisplayCheckBox.checked cfg_dateBoldText = boldValue
colorValue: cfg_dayFontColor
onColorValueChanged: {
cfg_dayFontColor = colorValue
}
fontValue: cfg_dayFontFamily
onFontValueChanged: {
cfg_dayFontFamily = fontValue
}
boldValue: cfg_dayBoldText
onBoldValueChanged: {
cfg_dayBoldText = boldValue
}
italicValue: cfg_dayItalicText
onItalicValueChanged: {
cfg_dayItalicText = italicValue
}
pxSizeValue: cfg_dayFontSize
onPxSizeValueChanged: {
cfg_dayFontSize = pxSizeValue
}
} }
QtControls.CheckBox { italicValue: cfg_dateItalicText
id: dayShadowCheckBox onItalicValueChanged: {
text: i18n("Enable shadow") cfg_dateItalicText = italicValue
tristate: false
checked: cfg_dayShadowEnabled
} }
ShadowConfig { pxSizeValue: cfg_dateFontSize
enabled: dayShadowCheckBox.checked onPxSizeValueChanged: {
cfg_dateFontSize = pxSizeValue
colorValue: cfg_dayShadowColor
onColorValueChanged: {
cfg_dayShadowColor = colorValue
}
radiusValue: cfg_dayShadowRadius
onRadiusValueChanged: {
cfg_dayShadowRadius = radiusValue
}
offsetXValue: cfg_dayShadowXOffset
onOffsetXValueChanged: {
cfg_dayShadowXOffset = offsetXValue
}
offsetYValue: cfg_clockShadowYOffset
onOffsetYValueChanged: {
cfg_dayShadowYOffset = offsetYValue
}
} }
} }
QtLayouts.ColumnLayout { QtControls.CheckBox {
QtLayouts.Layout.fillWidth: true id: dateShadowCheckBox
spacing: 10 text: i18n("Enable shadow")
tristate: false
checked: cfg_dateShadowEnabled
}
QtControls.Label { ShadowConfig {
text: i18n("Date Display Settings") enabled: dateShadowCheckBox.checked
font.bold: true
font.pixelSize: 17 colorValue: cfg_dateShadowColor
onColorValueChanged: {
cfg_dateShadowColor = colorValue
} }
QtControls.CheckBox { radiusValue: cfg_dateShadowRadius
id: showDateDisplayCheckBox onRadiusValueChanged: {
text: i18n("Show date display") cfg_dateShadowRadius = radiusValue
} }
QtLayouts.RowLayout { offsetXValue: cfg_dateShadowXOffset
enabled: showDateDisplayCheckBox.checked onOffsetXValueChanged: {
cfg_dateShadowXOffset = offsetXValue
QtControls.Label {
text: i18n("Date format:")
opacity: if (enabled) 1
else 0.4
}
QtLayouts.RowLayout {
QtControls.TextField {
id: customDateFormat
QtLayouts.Layout.fillWidth: true
}
QtControls.Button {
icon.name: "exifinfo"
onClicked: Qt.openUrlExternally("https://doc.qt.io/qt-5/qml-qtqml-qt.html#formatDateTime-method")
}
}
} }
FontConfig { offsetYValue: cfg_dateShadowYOffset
fontModel: fontsModel onOffsetYValueChanged: {
enabled: showDateDisplayCheckBox.checked cfg_dateShadowYOffset = offsetYValue
colorValue: cfg_dateFontColor
onColorValueChanged: {
cfg_dateFontColor = colorValue
}
fontValue: cfg_dateFontFamily
onFontValueChanged: {
cfg_dateFontFamily = fontValue
}
boldValue: cfg_dateBoldText
onBoldValueChanged: {
cfg_dateBoldText = boldValue
}
italicValue: cfg_dateItalicText
onItalicValueChanged: {
cfg_dateItalicText = italicValue
}
pxSizeValue: cfg_dateFontSize
onPxSizeValueChanged: {
cfg_dateFontSize = pxSizeValue
}
}
QtControls.CheckBox {
id: dateShadowCheckBox
text: i18n("Enable shadow")
tristate: false
checked: cfg_dateShadowEnabled
}
ShadowConfig {
enabled: dateShadowCheckBox.checked
colorValue: cfg_dateShadowColor
onColorValueChanged: {
cfg_dateShadowColor = colorValue
}
radiusValue: cfg_dateShadowRadius
onRadiusValueChanged: {
cfg_dateShadowRadius = radiusValue
}
offsetXValue: cfg_dateShadowXOffset
onOffsetXValueChanged: {
cfg_dateShadowXOffset = offsetXValue
}
offsetYValue: cfg_dateShadowYOffset
onOffsetYValueChanged: {
cfg_dateShadowYOffset = offsetYValue
}
} }
} }
} }