Skip to content

Commit

Permalink
Not only tablets have widescreen ;)
Browse files Browse the repository at this point in the history
  • Loading branch information
Wunderfitz committed Dec 2, 2023
1 parent 64479f0 commit bba4a64
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions qml/components/MessageListViewItem.qml
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ ListItem {
}

function getContentWidthMultiplier() {
return Functions.isTablet(appWindow) ? 0.4 : 1.0
return Functions.isWidescreen(appWindow) ? 0.4 : 1.0
}

onClicked: {
Expand Down Expand Up @@ -369,10 +369,10 @@ ListItem {
id: messageTextRow
spacing: Theme.paddingSmall
width: precalculatedValues.entryWidth
anchors.horizontalCenter: Functions.isTablet(appWindow) ? undefined : parent.horizontalCenter
anchors.left: Functions.isTablet(appWindow) ? parent.left : undefined
anchors.horizontalCenter: Functions.isWidescreen(appWindow) ? undefined : parent.horizontalCenter
anchors.left: Functions.isWidescreen(appWindow) ? parent.left : undefined
y: Theme.paddingSmall
anchors.leftMargin: Functions.isTablet(appWindow) ? Theme.paddingMedium : undefined
anchors.leftMargin: Functions.isWidescreen(appWindow) ? Theme.paddingMedium : undefined

Loader {
id: profileThumbnailLoader
Expand Down
2 changes: 1 addition & 1 deletion qml/components/settingsPage/ResponsiveGrid.qml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@ import "../../js/functions.js" as Functions

Grid {
width: parent.width - ( 2 * x )
columns: Functions.isTablet(appWindow) ? 2 : 1
columns: Functions.isWidescreen(appWindow) ? 2 : 1
readonly property real columnWidth: width/columns
}
2 changes: 1 addition & 1 deletion qml/js/functions.js
Original file line number Diff line number Diff line change
Expand Up @@ -541,6 +541,6 @@ function getMessagesNeededForwardPermissions(messages) {
return neededPermissions
}

function isTablet(appWindow) {
function isWidescreen(appWindow) {
return (appWindow.deviceOrientation & Silica.Orientation.LandscapeMask) || Silica.Screen.sizeCategory === Silica.Screen.Large || Silica.Screen.sizeCategory === Silica.Screen.ExtraLarge
}
2 changes: 1 addition & 1 deletion qml/pages/ChatPage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -1193,7 +1193,7 @@ Page {
readonly property int profileThumbnailDimensions: showUserInfo ? Theme.itemSizeSmall : 0
readonly property int pageMarginDouble: 2 * Theme.horizontalPageMargin
readonly property int paddingMediumDouble: 2 * Theme.paddingMedium
readonly property int entryWidth: Functions.isTablet(appWindow) ? chatView.width * 0.75 : chatView.width - pageMarginDouble
readonly property int entryWidth: Functions.isWidescreen(appWindow) ? chatView.width * 0.75 : chatView.width - pageMarginDouble
readonly property int textItemWidth: entryWidth - profileThumbnailDimensions - Theme.paddingSmall
readonly property int backgroundWidth: page.isChannel ? textItemWidth : textItemWidth - pageMarginDouble
readonly property int backgroundRadius: textItemWidth/50
Expand Down

0 comments on commit bba4a64

Please sign in to comment.