Not only tablets have widescreen ;)

This commit is contained in:
Sebastian Wolf 2023-12-02 23:50:13 +01:00 committed by Denis Fedoseev
parent 627faba0db
commit 42a7813776
4 changed files with 7 additions and 7 deletions

View file

@ -129,7 +129,7 @@ ListItem {
}
function getContentWidthMultiplier() {
return Functions.isTablet(appWindow) ? 0.4 : 1.0
return Functions.isWidescreen(appWindow) ? 0.4 : 1.0
}
onClicked: {
@ -377,10 +377,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

View file

@ -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
}

View file

@ -536,6 +536,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
}

View file

@ -1187,7 +1187,7 @@ Page {
readonly property int pageMarginDouble: 2 * Theme.horizontalPageMargin
readonly property int paddingMediumDouble: 2 * Theme.paddingMedium
readonly property int entryWidth: chatView.width - pageMarginDouble //ширина полной строки сообщения вместе с аватаркой
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.isPrivateChat ? textItemWidth - pageMarginDouble : textItemWidth //уменьшенная ширина сообщений для приватных чатов
readonly property int backgroundRadius: textItemWidth/50