Skip to content

Commit

Permalink
#56: title horizontal alignment option
Browse files Browse the repository at this point in the history
  • Loading branch information
antroids committed Sep 24, 2024
1 parent ce46288 commit 9976f27
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 0 deletions.
9 changes: 9 additions & 0 deletions package/contents/config/main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,15 @@
</choices>
<default>2</default>
</entry>
<entry name="windowTitleHorizontalAlignment" type="Enum">
<choices>
<choice name="Left" />
<choice name="Right" />
<choice name="Center" />
<choice name="Justify" />
</choices>
<default>0</default>
</entry>
<entry name="windowTitleHideEmpty" type="Bool">
<default>false</default>
</entry>
Expand Down
8 changes: 8 additions & 0 deletions package/contents/ui/config/ConfigAppearance.qml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ KCM.SimpleKCM {
property alias cfg_windowTitleFontBold: windowTitleFontBold.checked
property alias cfg_windowTitleFontSizeMode: windowTitleFontSizeMode.currentIndex
property alias cfg_windowTitleSource: windowTitleSource.currentIndex
property alias cfg_windowTitleHorizontalAlignment: windowTitleHorizontalAlignment.currentIndex
property alias cfg_windowTitleHideEmpty: windowTitleHideEmpty.checked
property alias cfg_windowTitleUndefined: windowTitleUndefined.text
property alias cfg_windowTitleMarginsLeft: windowTitleMarginsLeft.value
Expand Down Expand Up @@ -338,6 +339,13 @@ You can install more of regular Aurorae themes for window decorations in System
model: [i18n("Application name"), i18n("Decoration"), i18n("Generic Application name"), i18n("Always undefined")]
}

ComboBox {
id: windowTitleHorizontalAlignment

Kirigami.FormData.label: i18n("Horizontal alignment:")
model: [i18n("Left"), i18n("Right"), i18n("Center"), i18n("Justify")]
}

RowLayout {
Kirigami.FormData.label: i18n("Window title margins:")

Expand Down
3 changes: 3 additions & 0 deletions package/contents/ui/main.qml
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,8 @@ PlasmoidItem {
PlasmaComponents.Label {
id: windowTitleLabel

readonly property var horizontalAlignmentValues: [Text.AlignLeft, Text.AlignRight, Text.AlignHCenter, Text.AlignJustify]

property var modelData
property bool empty: text === undefined || text === ""
property bool hideEmpty: empty && plasmoid.configuration.windowTitleHideEmpty
Expand All @@ -206,6 +208,7 @@ PlasmoidItem {
elide: Text.ElideRight
wrapMode: Text.WrapAnywhere
enabled: tasksModel.hasActiveWindow
horizontalAlignment: horizontalAlignmentValues[plasmoid.configuration.windowTitleHorizontalAlignment]

Accessible.role: Accessible.TitleBar
Accessible.name: text
Expand Down

0 comments on commit 9976f27

Please sign in to comment.