diff --git a/src/app/MainApplicationWindow.qml b/src/app/MainApplicationWindow.qml index 005199cbe9f946263101e4b0e44d51658f00624d..15f0df80385784eefaf70861a44ba010c2cbf4bb 100644 --- a/src/app/MainApplicationWindow.qml +++ b/src/app/MainApplicationWindow.qml @@ -53,14 +53,6 @@ ApplicationWindow { } property ViewManager viewManager: ViewManager {} property ViewCoordinator viewCoordinator: ViewCoordinator { - resources: { - "WelcomePage": "mainview/components/WelcomePage.qml", - "SidePanel": "mainview/components/SidePanel.qml", - "ConversationView": "mainview/ConversationView.qml", - "NewSwarmPage": "mainview/components/NewSwarmPage.qml", - "WizardView": "wizardview/WizardView.qml", - "SettingsView": "settingsview/SettingsView.qml", - } viewManager: root.viewManager } diff --git a/src/app/ViewCoordinator.qml b/src/app/ViewCoordinator.qml index c6079cba21d00c801f32dd88aedae51157f654d9..03561a6b4da8c1427c3e723c0afeccb17e6d441d 100644 --- a/src/app/ViewCoordinator.qml +++ b/src/app/ViewCoordinator.qml @@ -34,12 +34,21 @@ QtObject { signal requestAppWindowWizardView // A map of view names to file paths for QML files that define each view. - required property variant resources + property variant resources: { + "WelcomePage": "mainview/components/WelcomePage.qml", + "SidePanel": "mainview/components/SidePanel.qml", + "ConversationView": "mainview/ConversationView.qml", + "NewSwarmPage": "mainview/components/NewSwarmPage.qml", + "WizardView": "wizardview/WizardView.qml", + "SettingsView": "settingsview/SettingsView.qml", + } // Maybe this state needs to be toggled because the SidePanel content is replaced. // This makes it so the state can't be inferred from loaded views in single pane mode. property bool inSettings: viewManager.hasView("SettingsView") + property bool inWizard: viewManager.hasView("WizardView") property bool inNewSwarm: viewManager.hasView("NewSwarmPage") + property bool inhibitConversationView: inSettings || inWizard || inNewSwarm property bool busy: false @@ -169,6 +178,10 @@ QtObject { function present(viewName, sv=activeStackView) { if (!rootView) return + if (viewName === "ConversationView" && inhibitConversationView) { + return + } + // If the view already exists in the StackView, the function will attempt // to navigate to its StackView position by dismissing elevated views. if (sv.find(function(item) { diff --git a/src/app/mainview/MainView.qml b/src/app/mainview/MainView.qml index 6f5717e171acddaf235d32b6ed97bb36ae7f6340..6d347630b7a9c224798695f5cfa161e63e7b8269 100644 --- a/src/app/mainview/MainView.qml +++ b/src/app/mainview/MainView.qml @@ -42,7 +42,6 @@ Rectangle { // To calculate tab bar bottom border hidden rect left margin. property int tabBarLeftMargin: 8 property int tabButtonShrinkSize: 8 - property bool inSettingsView: viewCoordinator.inSettings signal loaderSourceChangeRequested(int sourceToLoad) diff --git a/src/app/mainview/components/AccountComboBox.qml b/src/app/mainview/components/AccountComboBox.qml index 58f3a3f37a6e394c7b6bc62a835efb445232762b..38ff59ba1471b7ce23ad29976dd6636ccb61ead2 100644 --- a/src/app/mainview/components/AccountComboBox.qml +++ b/src/app/mainview/components/AccountComboBox.qml @@ -33,8 +33,6 @@ Label { signal settingBtnClicked property alias popup: comboBoxPopup - property bool inSettingsView: viewCoordinator.inSettings - // TODO: remove these refresh hacks use QAbstractItemModels correctly Connections { target: AccountAdapter @@ -205,13 +203,13 @@ Label { id: settingsButton anchors.verticalCenter: parent.verticalCenter - source: !inSettingsView ? + source: !viewCoordinator.inSettings ? JamiResources.settings_24dp_svg : JamiResources.round_close_24dp_svg normalColor: JamiTheme.backgroundColor imageColor: JamiTheme.textColor - toolTipText: !inSettingsView ? + toolTipText: !viewCoordinator.inSettings ? JamiStrings.openSettings : JamiStrings.closeSettings diff --git a/src/app/mainview/components/SidePanel.qml b/src/app/mainview/components/SidePanel.qml index c296a8185d0f95b28740b82310927244db196657..fcd224cfd91b7f1f7d75d35e28da3ecb1aeae39c 100644 --- a/src/app/mainview/components/SidePanel.qml +++ b/src/app/mainview/components/SidePanel.qml @@ -184,7 +184,7 @@ BaseView { width: parent.width height: JamiTheme.accountListItemHeight onSettingBtnClicked: { - !inSettingsView ? + !viewCoordinator.inSettings ? viewCoordinator.present("SettingsView") : viewCoordinator.dismiss("SettingsView")} }