forked from Shinonome/dots-hyprland
add center title config option
This commit is contained in:
@@ -154,6 +154,7 @@ Singleton {
|
|||||||
|
|
||||||
property QtObject windows: QtObject {
|
property QtObject windows: QtObject {
|
||||||
property bool showTitlebar: true // Client-side decoration for shell apps
|
property bool showTitlebar: true // Client-side decoration for shell apps
|
||||||
|
property bool centerTitle: true
|
||||||
}
|
}
|
||||||
|
|
||||||
property QtObject hacks: QtObject {
|
property QtObject hacks: QtObject {
|
||||||
|
|||||||
@@ -212,13 +212,26 @@ ContentPage {
|
|||||||
|
|
||||||
ContentSection {
|
ContentSection {
|
||||||
title: "Shell windows"
|
title: "Shell windows"
|
||||||
|
spacing: 4
|
||||||
|
|
||||||
ConfigSwitch {
|
RowLayout {
|
||||||
text: "Title bar"
|
spacing: 10
|
||||||
checked: ConfigOptions.windows.showTitlebar
|
uniformCellSizes: true
|
||||||
onClicked: checked = !checked;
|
ConfigSwitch {
|
||||||
onCheckedChanged: {
|
text: "Title bar"
|
||||||
ConfigLoader.setConfigValueAndSave("windows.showTitlebar", checked);
|
checked: ConfigOptions.windows.showTitlebar
|
||||||
|
onClicked: checked = !checked;
|
||||||
|
onCheckedChanged: {
|
||||||
|
ConfigLoader.setConfigValueAndSave("windows.showTitlebar", checked);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ConfigSwitch {
|
||||||
|
text: "Center title"
|
||||||
|
checked: ConfigOptions.windows.centerTitle
|
||||||
|
onClicked: checked = !checked;
|
||||||
|
onCheckedChanged: {
|
||||||
|
ConfigLoader.setConfigValueAndSave("windows.centerTitle", checked);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -73,7 +73,12 @@ ApplicationWindow {
|
|||||||
implicitHeight: Math.max(titleText.implicitHeight, windowControlsRow.implicitHeight)
|
implicitHeight: Math.max(titleText.implicitHeight, windowControlsRow.implicitHeight)
|
||||||
StyledText {
|
StyledText {
|
||||||
id: titleText
|
id: titleText
|
||||||
anchors.centerIn: parent
|
anchors {
|
||||||
|
left: ConfigOptions.windows.centerTitle ? undefined : parent.left
|
||||||
|
horizontalCenter: ConfigOptions.windows.centerTitle ? parent.horizontalCenter : undefined
|
||||||
|
verticalCenter: parent.verticalCenter
|
||||||
|
leftMargin: 12
|
||||||
|
}
|
||||||
color: Appearance.colors.colOnLayer0
|
color: Appearance.colors.colOnLayer0
|
||||||
text: "Settings"
|
text: "Settings"
|
||||||
font.pixelSize: Appearance.font.pixelSize.title
|
font.pixelSize: Appearance.font.pixelSize.title
|
||||||
|
|||||||
@@ -65,7 +65,12 @@ ApplicationWindow {
|
|||||||
implicitHeight: Math.max(welcomeText.implicitHeight, windowControlsRow.implicitHeight)
|
implicitHeight: Math.max(welcomeText.implicitHeight, windowControlsRow.implicitHeight)
|
||||||
StyledText {
|
StyledText {
|
||||||
id: welcomeText
|
id: welcomeText
|
||||||
anchors.centerIn: parent
|
anchors {
|
||||||
|
left: ConfigOptions.windows.centerTitle ? undefined : parent.left
|
||||||
|
horizontalCenter: ConfigOptions.windows.centerTitle ? parent.horizontalCenter : undefined
|
||||||
|
verticalCenter: parent.verticalCenter
|
||||||
|
leftMargin: 12
|
||||||
|
}
|
||||||
color: Appearance.colors.colOnLayer0
|
color: Appearance.colors.colOnLayer0
|
||||||
text: "Yooooo hi there"
|
text: "Yooooo hi there"
|
||||||
font.pixelSize: Appearance.font.pixelSize.title
|
font.pixelSize: Appearance.font.pixelSize.title
|
||||||
|
|||||||
Reference in New Issue
Block a user