Skip to content

Commit

Permalink
Remove topLinePixelSize
Browse files Browse the repository at this point in the history
In most cases we should just rely on the element providing the default
system theme font size, and in cases where we do something else, we
already have the pixelSize value set as a property

Signed-off-by: Claudio Cambra <[email protected]>
  • Loading branch information
claucambra committed Nov 19, 2024
1 parent 355ced8 commit 41c9113
Show file tree
Hide file tree
Showing 7 changed files with 3 additions and 18 deletions.
2 changes: 0 additions & 2 deletions src/gui/tray/ActivityItemContent.qml
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,6 @@ RowLayout {
elide: Text.ElideRight
wrapMode: Text.Wrap
maximumLineCount: 2
font.pixelSize: Style.topLinePixelSize
visible: text !== ""
}

Expand Down Expand Up @@ -240,7 +239,6 @@ RowLayout {
elide: Text.ElideRight
wrapMode: Text.Wrap
maximumLineCount: 2
font.pixelSize: Style.topLinePixelSize
visible: text !== ""
}

Expand Down
1 change: 0 additions & 1 deletion src/gui/tray/CallNotificationDialog.qml
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,6 @@ ApplicationWindow {
EnforcedPlainTextLabel {
id: message
text: root.subject
font.pixelSize: Style.topLinePixelSize
wrapMode: Text.WordWrap
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
Expand Down
6 changes: 0 additions & 6 deletions src/gui/tray/MainWindow.qml
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,6 @@ ApplicationWindow {

MenuItem {
id: syncPauseButton
font.pixelSize: Style.topLinePixelSize
hoverEnabled: true
onClicked: Systray.syncIsPaused = !Systray.syncIsPaused
Accessible.role: Accessible.MenuItem
Expand All @@ -354,7 +353,6 @@ ApplicationWindow {
MenuItem {
id: settingsButton
text: qsTr("Settings")
font.pixelSize: Style.topLinePixelSize
hoverEnabled: true
onClicked: Systray.openSettings()
Accessible.role: Accessible.MenuItem
Expand All @@ -365,7 +363,6 @@ ApplicationWindow {
MenuItem {
id: exitButton
text: qsTr("Exit");
font.pixelSize: Style.topLinePixelSize
hoverEnabled: true
onClicked: Systray.shutdown()
Accessible.role: Accessible.MenuItem
Expand Down Expand Up @@ -436,8 +433,6 @@ ApplicationWindow {
width: Style.currentAccountLabelWidth
text: UserModel.currentUser ? UserModel.currentUser.name : ""
elide: Text.ElideRight

font.pixelSize: Style.topLinePixelSize
font.bold: true
}

Expand Down Expand Up @@ -565,7 +560,6 @@ ApplicationWindow {
anchors.left: parent.left
anchors.right: parent.right
text: model.appName
font.pixelSize: Style.topLinePixelSize
icon.source: model.appIconUrl
icon.color: palette.windowText
onTriggered: UserAppsModel.openAppUrl(appUrl)
Expand Down
1 change: 0 additions & 1 deletion src/gui/tray/SyncStatus.qml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ RowLayout {

text: syncStatus.syncStatusString
verticalAlignment: Text.AlignVCenter
font.pixelSize: Style.topLinePixelSize
font.bold: true
wrapMode: Text.Wrap
}
Expand Down
2 changes: 1 addition & 1 deletion src/gui/tray/UnifiedSearchResultNothingFound.qml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ ColumnLayout {
EnforcedPlainTextLabel {
id: unifiedSearchResultsNoResultsLabelDetails
text: unifiedSearchResultNothingFoundContainer.text
font.pixelSize: Style.topLinePixelSize * 1.25
font.pixelSize: Style.pixelSize * 1.25
wrapMode: Text.Wrap
maximumLineCount: 2
elide: Text.ElideRight
Expand Down
4 changes: 0 additions & 4 deletions src/gui/tray/UserLine.qml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ AbstractButton {
verticalAlignment: Text.AlignBottom
text: name
elide: Text.ElideRight
font.pixelSize: Style.topLinePixelSize
font.bold: true
}

Expand Down Expand Up @@ -148,14 +147,12 @@ AbstractButton {
visible: model.isConnected && model.serverHasUserStatus
height: visible ? implicitHeight : 0
text: qsTr("Set status")
font.pixelSize: Style.topLinePixelSize
hoverEnabled: true
onClicked: showUserStatusSelector(index)
}

MenuItem {
text: model.isConnected ? qsTr("Log out") : qsTr("Log in")
font.pixelSize: Style.topLinePixelSize
hoverEnabled: true
onClicked: {
model.isConnected ? UserModel.logout(index) : UserModel.login(index)
Expand All @@ -178,7 +175,6 @@ AbstractButton {
MenuItem {
id: removeAccountButton
text: qsTr("Remove account")
font.pixelSize: Style.topLinePixelSize
hoverEnabled: true
onClicked: {
UserModel.removeAccount(index)
Expand Down
5 changes: 2 additions & 3 deletions theme/Style/Style.qml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@ QtObject {

// Fonts
// We are using pixel size because this is cross platform comparable, point size isn't
readonly property int topLinePixelSize: pixelSize
readonly property int subLinePixelSize: topLinePixelSize - 2
readonly property int subLinePixelSize: pixelSize - 2
readonly property int defaultFontPtSize: fontMetrics.font.pointSize
readonly property int subheaderFontPtSize: defaultFontPtSize + 2
readonly property int headerFontPtSize: defaultFontPtSize + 4
Expand Down Expand Up @@ -135,7 +134,7 @@ QtObject {
readonly property int unifiedSearchResultIconWidth: trayListItemIconSize * (1 - thumbnailImageSizeReduction)
readonly property int unifiedSearchResultSmallIconWidth: trayListItemIconSize * (1 - thumbnailImageSizeReduction * 2)
readonly property int unifiedSearchResultIconLeftMargin: 12
readonly property int unifiedSearchResultTitleFontSize: topLinePixelSize
readonly property int unifiedSearchResultTitleFontSize: pixelSize
readonly property int unifiedSearchResultSublineFontSize: subLinePixelSize
readonly property int unifiedSearchResultSectionItemLeftPadding: 16
readonly property int unifiedSearchResultSectionItemVerticalPadding: 8
Expand Down

0 comments on commit 41c9113

Please sign in to comment.