Skip to content
Snippets Groups Projects
Commit 5e3d6c90 authored by Aline Gondim Santos's avatar Aline Gondim Santos
Browse files

windows/popups: set max size

Set a maximum size for Jami secondary windows/popups.

Change-Id: Ie03c48c58e6f08662fe4a51bacbd2c02a500012c
GitLab: #691
parent bc5af75c
Branches
Tags
No related merge requests found
......@@ -215,16 +215,12 @@ ApplicationWindow {
onClosing: root.close()
onScreenChanged: JamiQmlUtils.mainApplicationScreen = root.screen
Component.onCompleted: {
if (CurrentAccountToMigrate.accountToMigrateListSize <= 0)
startClient()
else
startAccountMigration()
JamiQmlUtils.mainApplicationScreen = root.screen
if (Qt.platform.os.toString() !== "windows" && Qt.platform.os.toString() !== "osx")
DBusErrorHandler.setActive(true)
}
......
......@@ -31,8 +31,6 @@ Item {
readonly property string accountMigrationViewLoadPath: "qrc:/src/AccountMigrationView.qml"
readonly property string base64StringTitle: "data:image/png;base64,"
property var mainApplicationScreen: ""
property var accountCreationInputParaObject: ({})
function setUpAccountCreationInputPara(inputPara) {
......
......@@ -271,6 +271,7 @@ Item {
property real minimumPreviewWidth: 120
property real pluginHandlersPopupViewHeight: 200
property real pluginHandlersPopupViewDelegateHeight: 50
property real secondaryDialogDimension: 500
property real lineEditContextMenuItemsHeight: 15
property real lineEditContextMenuItemsWidth: 100
......
......@@ -449,13 +449,8 @@ Rectangle {
AboutPopUp {
id: aboutPopUpDialog
onVisibleChanged: {
height = Qt.binding(function () {
return Math.min(preferredHeight,
mainView.height - JamiTheme.preferredMarginSize * 2)
})
}
width: Math.min(mainView.width - 2 * JamiTheme.preferredMarginSize, JamiTheme.secondaryDialogDimension)
height: Math.min(mainView.height - 2 * JamiTheme.preferredMarginSize, JamiTheme.secondaryDialogDimension)
}
WelcomePageQrDialog {
......@@ -464,6 +459,8 @@ Rectangle {
UserProfile {
id: userProfile
width: Math.min(mainView.width - 2 * JamiTheme.preferredMarginSize, JamiTheme.secondaryDialogDimension)
height: Math.min(mainView.height - 2 * JamiTheme.preferredMarginSize, JamiTheme.secondaryDialogDimension)
}
Shortcut {
......
......@@ -29,26 +29,16 @@ import "../../commoncomponents"
BaseModalDialog {
id: root
property int preferredHeight: 0
width: 400
onPopupContentLoadStatusChanged: {
if (popupContentLoadStatus === Loader.Ready)
preferredHeight = Qt.binding(function() {
return popupContentLoader.item.contentHeight
})
}
popupContent: JamiFlickable {
id: aboutPopUpScrollView
contentHeight: aboutPopUpContentRectColumnLayout.implicitHeight
width: root.width
ColumnLayout {
id: aboutPopUpContentRectColumnLayout
width: Math.max(root.width, implicitWidth)
width: root.width
height: Math.max(aboutPopUpScrollView.height, implicitHeight)
ResponsiveImage {
......
......@@ -160,7 +160,7 @@ Item {
if (Qt.application.screens.length === 1) {
AvAdapter.shareEntireScreen(0)
} else {
SelectScreenWindowCreation.createSelectScreenWindowObject(JamiQmlUtils.mainApplicationScreen)
SelectScreenWindowCreation.createSelectScreenWindowObject(appWindow)
SelectScreenWindowCreation.showSelectScreenWindow(callPreviewId, false)
}
}
......@@ -169,7 +169,7 @@ Item {
AvAdapter.muteCamera = !sharingActive && root.isVideoMuted
AvAdapter.getListWindows()
if (AvAdapter.windowsNames.length >= 1) {
SelectScreenWindowCreation.createSelectScreenWindowObject(JamiQmlUtils.mainApplicationScreen)
SelectScreenWindowCreation.createSelectScreenWindowObject(appWindow)
SelectScreenWindowCreation.showSelectScreenWindow(callPreviewId, true)
}
}
......
......@@ -35,15 +35,17 @@ import "../../commoncomponents"
Window {
id: root
property int minWidth: 650
property int minHeight: 500
property bool window: false
property int selectedScreenNumber: -1
property bool selectAllScreens: false
property string currentPreview: ""
property var screens: []
property real componentMinWidth: 200
property real componentWidthDoubleColumn: screenSelectionScrollView.width / 2 -
screenSelectionScrollViewFlow.spacing / 2 - JamiTheme.preferredMarginSize
property real componentWidthSingleColumn: screenSelectionScrollView.width -
2 * JamiTheme.preferredMarginSize
modality: Qt.ApplicationModal
title: window ? JamiStrings.selectWindow : JamiStrings.selectScreen
......@@ -75,11 +77,6 @@ Window {
screenInfo2.model = screens.length
windowsText.visible = root.window
}
minimumWidth: minWidth
minimumHeight: minHeight
width: minWidth
height: minHeight
Rectangle {
id: selectScreenWindowRect
......@@ -110,7 +107,7 @@ Window {
rightPadding: JamiTheme.preferredMarginSize
leftPadding: JamiTheme.preferredMarginSize
spacing: 10
spacing: JamiTheme.preferredMarginSize
Text {
width: screenSelectionScrollView.width
......@@ -134,8 +131,7 @@ Window {
color: JamiTheme.secondaryBackgroundColor
width: screenSelectionScrollView.width / 2 -
screenSelectionScrollViewFlow.spacing / 2 - JamiTheme.preferredMarginSize
width: componentWidthDoubleColumn > componentMinWidth ? componentWidthDoubleColumn : componentWidthSingleColumn
height: 3 * width / 4
border.color: selectedScreenNumber === index ? JamiTheme.screenSelectionBorderColor : JamiTheme.tabbarBorderColor
......@@ -208,8 +204,7 @@ Window {
color: JamiTheme.secondaryBackgroundColor
width: screenSelectionScrollView.width / 2 -
screenSelectionScrollViewFlow.spacing / 2 - JamiTheme.preferredMarginSize
width: componentWidthDoubleColumn > componentMinWidth ? componentWidthDoubleColumn : componentWidthSingleColumn
height: 3 * width / 4
border.color: selectAllScreens ? JamiTheme.screenSelectionBorderColor : JamiTheme.tabbarBorderColor
......@@ -286,8 +281,7 @@ Window {
color: JamiTheme.secondaryBackgroundColor
width: screenSelectionScrollView.width / 2 -
screenSelectionScrollViewFlow.spacing / 2 - JamiTheme.preferredMarginSize
width: componentWidthDoubleColumn > componentMinWidth ? componentWidthDoubleColumn : componentWidthSingleColumn
height: 3 * width / 4
border.color: selectedScreenNumber === index ? JamiTheme.screenSelectionBorderColor : JamiTheme.tabbarBorderColor
......@@ -356,14 +350,17 @@ Window {
anchors.bottomMargin: JamiTheme.preferredMarginSize
anchors.horizontalCenter: selectScreenWindowRect.horizontalCenter
width: childrenRect.width
width: parent.width
height: childrenRect.height
spacing: JamiTheme.preferredMarginSize
MaterialButton {
id: selectButton
preferredWidth: 200
Layout.maximumWidth: 200
Layout.fillWidth: true
Layout.alignment: Qt.AlignHCenter
Layout.leftMargin: JamiTheme.preferredMarginSize
enabled: selectedScreenNumber != -1 || selectAllScreens
opacity: enabled ? 1.0 : 0.5
......@@ -392,7 +389,10 @@ Window {
MaterialButton {
id: cancelButton
preferredWidth: 200
Layout.maximumWidth: 200
Layout.fillWidth: true
Layout.alignment: Qt.AlignHCenter
Layout.rightMargin: JamiTheme.preferredMarginSize
color: JamiTheme.buttonTintedBlack
hoveredColor: JamiTheme.buttonTintedBlackHovered
......
......@@ -35,14 +35,12 @@ BaseModalDialog {
property int preferredImgSize: 80
width: 480
height: 480
popupContent: Rectangle {
id: userProfileContentRect
color: JamiTheme.backgroundColor
radius: JamiTheme.modalPopupRadius
anchors.fill: parent
GridLayout {
id: userProfileDialogLayout
......@@ -160,6 +158,7 @@ BaseModalDialog {
id: contactId
Layout.alignment: Qt.AlignLeft
width: userProfileContentRect.width - 200
font.pointSize: JamiTheme.textFontSize
font.kerning: true
......@@ -169,19 +168,11 @@ BaseModalDialog {
readOnly: true
selectByMouse: true
wrapMode: Text.NoWrap
text: textMetricsContactIdText.elidedText
wrapMode: Text.WrapAnywhere
text: idText
horizontalAlignment: Text.AlignLeft
verticalAlignment: Text.AlignVCenter
TextMetrics {
id: textMetricsContactIdText
font: contactId.font
text: idText
elideWidth: userProfileContentRect.width - 200
elide: Qt.ElideMiddle
}
}
Text {
......
......@@ -19,13 +19,14 @@
// Global select screen window component, object variable for creation.
var selectScreenWindowComponent
var selectScreenWindowObject
var mainWindow
function createSelectScreenWindowObject(providedScreen) {
function createSelectScreenWindowObject(appWindow) {
if (selectScreenWindowObject)
return
selectScreenWindowComponent = Qt.createComponent(
"../components/SelectScreen.qml")
selectScreenWindowComponent.screen = providedScreen
mainWindow = appWindow
if (selectScreenWindowComponent.status === Component.Ready)
finishCreation()
else if (selectScreenWindowComponent.status === Component.Error)
......@@ -49,11 +50,13 @@ function showSelectScreenWindow(previewId, window) {
selectScreenWindowObject.window = window
selectScreenWindowObject.show()
var screen = selectScreenWindowComponent.screen
selectScreenWindowObject.x = screen.virtualX +
(screen.width - selectScreenWindowObject.width) / 2
selectScreenWindowObject.y = screen.virtualY +
(screen.height - selectScreenWindowObject.height) / 2
var centerX = mainWindow.x + mainWindow.width / 2
var centerY = mainWindow.y + mainWindow.height / 2
selectScreenWindowObject.width = 0.75 * appWindow.width
selectScreenWindowObject.height = 0.75 * appWindow.height
selectScreenWindowObject.x = centerX - selectScreenWindowObject.width / 2
selectScreenWindowObject.y = centerY - selectScreenWindowObject.height / 2
}
// Destroy and reset selectScreenWindowObject when window is closed.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment