Skip to content

Commit

Permalink
Replace various subline pixel font size with one small pt based size
Browse files Browse the repository at this point in the history
Signed-off-by: Claudio Cambra <[email protected]>
  • Loading branch information
claucambra committed Nov 19, 2024
1 parent 41c9113 commit 2785ed5
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/gui/tray/ActivityItemContent.qml
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ RowLayout {
height: (text === "") ? 0 : implicitHeight

text: root.activityData.dateTime
font.pixelSize: Style.subLinePixelSize
font.pointSize: Style.smallFontPtSize
visible: text !== ""
}

Expand Down Expand Up @@ -220,7 +220,7 @@ RowLayout {
elide: Text.ElideRight
wrapMode: Text.Wrap
maximumLineCount: 2
font.pixelSize: Style.subLinePixelSize
font.pointSize: Style.smallFontPtSize
visible: text !== ""
}

Expand Down
2 changes: 1 addition & 1 deletion src/gui/tray/ListItemLineAndSubline.qml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ ColumnLayout {
property string sublineText: ""

property int titleFontSize: Style.unifiedSearchResultTitleFontSize
property int sublineFontSize: Style.unifiedSearchResultSublineFontSize
property int sublineFontSize: Style.smallFontPtSize

property color titleColor: palette.windowText
property color sublineColor: palette.midlight
Expand Down
2 changes: 1 addition & 1 deletion src/gui/tray/SyncStatus.qml
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ RowLayout {

text: syncStatus.syncStatusDetailString
visible: syncStatus.syncStatusDetailString !== ""
font.pixelSize: Style.subLinePixelSize
font.pointSize: Style.smallFontPtSize
wrapMode: Text.Wrap
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/gui/tray/UnifiedSearchResultItem.qml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ RowLayout {

property int iconWidth: iconsIsThumbnail && icons !== "" ? Style.unifiedSearchResultIconWidth : Style.unifiedSearchResultSmallIconWidth
property int titleFontSize: Style.unifiedSearchResultTitleFontSize
property int sublineFontSize: Style.unifiedSearchResultSublineFontSize
property int sublineFontSize: Style.smallFontPtSize

property color titleColor: palette.buttonText
property color sublineColor: palette.midlight
Expand Down
2 changes: 1 addition & 1 deletion src/gui/tray/UnifiedSearchResultItemSkeleton.qml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ RowLayout {

property int iconWidth: Style.unifiedSearchResultIconWidth
property int titleFontSize: Style.unifiedSearchResultTitleFontSize
property int sublineFontSize: Style.unifiedSearchResultSublineFontSize
readonly property int sublineFontSize: Style.smallFontPtSize

Accessible.role: Accessible.ListItem
Accessible.name: qsTr("Search result skeleton.").arg(model.index)
Expand Down
3 changes: 1 addition & 2 deletions theme/Style/Style.qml
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ QtObject {

// Fonts
// We are using pixel size because this is cross platform comparable, point size isn't
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
readonly property int titleFontPtSize: defaultFontPtSize + 8
readonly property int smallFontPtSize: defaultFontPtSize - 2

// Dimensions and sizes
property int trayWindowWidth: variableSize(400)
Expand Down Expand Up @@ -135,7 +135,6 @@ QtObject {
readonly property int unifiedSearchResultSmallIconWidth: trayListItemIconSize * (1 - thumbnailImageSizeReduction * 2)
readonly property int unifiedSearchResultIconLeftMargin: 12
readonly property int unifiedSearchResultTitleFontSize: pixelSize
readonly property int unifiedSearchResultSublineFontSize: subLinePixelSize
readonly property int unifiedSearchResultSectionItemLeftPadding: 16
readonly property int unifiedSearchResultSectionItemVerticalPadding: 8
readonly property int unifiedSearchResultNothingFoundHorizontalMargin: 10
Expand Down

0 comments on commit 2785ed5

Please sign in to comment.