Skip to content

Commit

Permalink
#50: use advanceWidth to measure text size
Browse files Browse the repository at this point in the history
  • Loading branch information
antroids committed Aug 20, 2024
1 parent 3ca6521 commit cae9393
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions package/contents/ui/main.qml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ PlasmoidItem {
property real widgetHeight: (vertical ? width : height)
property real elementHeight: widgetHeight - plasmoid.configuration.widgetMargins * 2
property real buttonMargins: plasmoid.configuration.widgetButtonsMargins
property real buttonWidth: plasmoid.configuration.widgetButtonsAspectRatio / 100 * buttonHeight
property real buttonHeight: elementHeight - buttonMargins * 2
property real buttonWidth: plasmoid.configuration.widgetButtonsAspectRatio / 100 * buttonHeight
property var widgetAlignment: plasmoid.configuration.widgetHorizontalAlignment | plasmoid.configuration.widgetVerticalAlignment
property KWinConfig kWinConfig
property bool widgetHovered: widgetHoverHandler.hovered
Expand Down Expand Up @@ -197,7 +197,7 @@ PlasmoidItem {
Layout.maximumWidth: !hideEmpty ? plasmoid.configuration.windowTitleMaximumWidth : 0
Layout.alignment: root.widgetAlignment
Layout.fillWidth: plasmoid.configuration.widgetFillWidth
Layout.preferredWidth: textMetrics.width + leftPadding + rightPadding + 1 // Magic number
Layout.preferredWidth: textMetrics.advanceWidth + leftPadding + rightPadding + 1 // Magic number
text: titleText(windowTitleSource) || plasmoid.configuration.windowTitleUndefined
font.pointSize: plasmoid.configuration.windowTitleFontSize
font.bold: plasmoid.configuration.windowTitleFontBold
Expand Down
2 changes: 1 addition & 1 deletion package/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"Id": "com.github.antroids.application-title-bar",
"Name": "Application Title Bar",
"License": "GPL-3.0+",
"Version": "0.7.0",
"Version": "0.7.1",
"Website": "https://github.com/antroids/application-title-bar",
"FormFactors": [
"desktop"
Expand Down

0 comments on commit cae9393

Please sign in to comment.