diff --git a/src/constant/JamiTheme.qml b/src/constant/JamiTheme.qml index fdc376db1e52db41640a866e03f93d1bf7b42f3b..0f8bff2c7f01779b08b6e6812cc3e588e130dc0e 100644 --- a/src/constant/JamiTheme.qml +++ b/src/constant/JamiTheme.qml @@ -73,7 +73,7 @@ Item { property string faddedFontColor: "#c0c0c0" property string faddedLastInteractionFontColor: "#505050" - property int splitViewHandlePreferedWidth: 4 + property int splitViewHandlePreferredWidth: 4 property int textFontSize: 9 property int titleFontSize: 16 property int menuFontSize: 12 diff --git a/src/mainview/MainView.qml b/src/mainview/MainView.qml index e948cd0bf5df78e33de410d3c67e30b65b6076e8..aa9dcec2e15eb48005e60a16c2dc91e83f681023 100644 --- a/src/mainview/MainView.qml +++ b/src/mainview/MainView.qml @@ -30,58 +30,119 @@ import net.jami.Models 1.0 */ import "components" import "../settingsview" +import "../settingsview/components" Window { id: mainViewWindow - property int minWidth: sidePanelViewStackPreferedWidth + property int minWidth: sidePanelViewStackPreferredWidth property int minHeight: aboutPopUpDialog.contentHeight - property int mainViewWindowPreferedWidth: 650 - property int mainViewWindowPreferedHeight: 600 - property int sidePanelViewStackPreferedWidth: 250 - property int welcomePageGroupPreferedWidth: 250 - property int aboutPopUpPreferedWidth: 250 + property int mainViewWindowPreferredWidth: 650 + property int mainViewWindowPreferredHeight: 600 + property int sidePanelViewStackPreferredWidth: 250 + property int mainViewStackPreferredWidth: 250 + property int aboutPopUpPreferredWidth: 250 property int savedSidePanelViewMinWidth: 0 property int savedSidePanelViewMaxWidth: 0 property int savedWelcomeViewMinWidth: 0 property int savedWelcomeViewMaxWidth: 0 - property bool hiddenView: false + property bool sidePanelHidden: false /* * To calculate tab bar bottom border hidden rect left margin. */ property int tabBarLeftMargin: 8 property int tabButtonShrinkSize: 8 + property bool inSettingsView: false + property bool needToShowCallStack: false + property bool needToCloseCallStack: false signal noAccountIsAvailable signal needToAddNewAccount signal closeApp + function pushCallStackView(){ + if (mainViewStack.visible) { + mainViewStack.pop(null, StackView.Immediate) + mainViewStack.push(callStackView, StackView.Immediate) + } else { + sidePanelViewStack.pop(null, StackView.Immediate) + sidePanelViewStack.push(callStackView, StackView.Immediate) + } + } + + function pushCommunicationMessageWebView(){ + if (mainViewStack.visible) { + mainViewStack.pop(null, StackView.Immediate) + mainViewStack.push(communicationPageMessageWebView, + StackView.Immediate) + } else { + sidePanelViewStack.pop(null, StackView.Immediate) + sidePanelViewStack.push( + communicationPageMessageWebView, + StackView.Immediate) + } + } + function newAccountAdded(index) { mainViewWindowSidePanel.refreshAccountComboBox(index) } - function recursionStackViewItemMove(stackOne, stackTwo) { - + function recursionStackViewItemMove(stackOne, stackTwo, depth=1) { /* * Move all items (expect the bottom item) to stacktwo by the same order in stackone. */ - if (stackOne.depth === 1) { + if (stackOne.depth === depth) { return } var tempItem = stackOne.pop(StackView.Immediate) - recursionStackViewItemMove(stackOne, stackTwo) + recursionStackViewItemMove(stackOne, stackTwo, depth) stackTwo.push(tempItem, StackView.Immediate) } + function toggleSettingsView() { + + if (!inSettingsView) { + + if (sidePanelHidden){ + recursionStackViewItemMove(sidePanelViewStack, mainViewStack, 1) + mainViewStack.push(settingsView, StackView.Immediate) + sidePanelViewStack.push(leftPanelSettingsView, StackView.Immediate) + recursionStackViewItemMove(mainViewStack, sidePanelViewStack, 1) + } else { + mainViewStack.push(settingsView, StackView.Immediate) + sidePanelViewStack.push(leftPanelSettingsView, StackView.Immediate) + } + + } else { + + if (!sidePanelHidden) { + sidePanelViewStack.pop(mainViewWindowSidePanel, StackView.Immediate) + mainViewStack.pop(StackView.Immediate) + } else { + recursionStackViewItemMove(sidePanelViewStack, mainViewStack, 2) + sidePanelViewStack.pop(StackView.Immediate) + mainViewStack.pop(StackView.Immediate) + recursionStackViewItemMove(mainViewStack, sidePanelViewStack, 1) + } + + if (needToCloseCallStack) { + pushCommunicationMessageWebView() + needToShowCallStack = false + needToCloseCallStack = false + } + } + inSettingsView = !inSettingsView + } + title: "Jami" visible: true - width: mainViewWindowPreferedWidth - height: mainViewWindowPreferedHeight + width: mainViewWindowPreferredWidth + height: mainViewWindowPreferredHeight minimumWidth: minWidth minimumHeight: minHeight @@ -89,6 +150,8 @@ Window { target: CallAdapter function onShowCallStack(accountId, convUid, forceReset) { + + needToShowCallStack = true if (forceReset) { callStackView.responsibleAccountId = accountId callStackView.responsibleConvUid = convUid @@ -101,13 +164,7 @@ Window { */ if (callStackView.responsibleAccountId === accountId && callStackView.responsibleConvUid === convUid) { - if (welcomeViewStack.visible) { - welcomeViewStack.pop(null, StackView.Immediate) - welcomeViewStack.push(callStackView, StackView.Immediate) - } else { - sidePanelViewStack.pop(null, StackView.Immediate) - sidePanelViewStack.push(callStackView, StackView.Immediate) - } + pushCallStackView() } } @@ -120,22 +177,20 @@ Window { /* * Check if call stack view is on any of the stackview. */ - if (responsibleCallId === callId || responsibleCallId.length === 0) { - if (welcomeViewStack.find(function (item, index) { + if (callStackView.responsibleAccountId === accountId + && callStackView.responsibleConvUid === convUid) { + if (mainViewStack.find(function (item, index) { return item.objectName === "callStackViewObject" }) || sidePanelViewStack.find(function (item, index) { return item.objectName === "callStackViewObject" - })) { + }) || (inSettingsView && needToShowCallStack)) { callStackView.needToCloseInCallConversationAndPotentialWindow() - if (welcomeViewStack.visible) { - welcomeViewStack.pop(null, StackView.Immediate) - welcomeViewStack.push(communicationPageMessageWebView, - StackView.Immediate) + + if (!inSettingsView) { + pushCommunicationMessageWebView() + needToShowCallStack = false } else { - sidePanelViewStack.pop(null, StackView.Immediate) - sidePanelViewStack.push( - communicationPageMessageWebView, - StackView.Immediate) + needToCloseCallStack = true } } } @@ -143,12 +198,15 @@ Window { function onIncomingCallNeedToSetupMainView(accountId, convUid) { - /* * Set up the call stack view that is needed by call overlay. */ - welcomeViewStack.pop(null, StackView.Immediate) - sidePanelViewStack.pop(null, StackView.Immediate) + if (!inSettingsView) { + mainViewStack.pop(null, StackView.Immediate) + sidePanelViewStack.pop(null, StackView.Immediate) + } else { + toggleSettingsView() + } var index = ClientWrapper.utilsAdaptor.getCurrAccList().indexOf(accountId) var name = ClientWrapper.utilsAdaptor.getBestName(accountId, convUid) @@ -189,7 +247,7 @@ Window { height: mainViewWindow.height handle: Rectangle { - implicitWidth: JamiTheme.splitViewHandlePreferedWidth + implicitWidth: JamiTheme.splitViewHandlePreferredWidth implicitHeight: splitView.height color:"transparent" Rectangle { @@ -199,60 +257,165 @@ Window { } } - StackView { - id: sidePanelViewStack + Rectangle { + id: mainViewSidePanelRect + SplitView.minimumWidth: sidePanelViewStackPreferredWidth + SplitView.maximumWidth: (sidePanelHidden ? splitView.width : + splitView.width - sidePanelViewStackPreferredWidth) + SplitView.fillHeight: true - initialItem: mainViewWindowSidePanel + /* + * AccountComboBox is always visible + */ + AccountComboBox { + id: accountComboBox - SplitView.maximumWidth: splitView.width - sidePanelViewStackPreferedWidth - SplitView.minimumWidth: sidePanelViewStackPreferedWidth - SplitView.fillHeight: true + anchors.top: mainViewSidePanelRect.top + width: mainViewSidePanelRect.width + height: 64 - clip: true + visible: (mainViewWindowSidePanel.visible || leftPanelSettingsView.visible) + + currentIndex: 0 + + Connections { + target: ClientWrapper.accountAdaptor + + function onAccountSignalsReconnect(accountId) { + CallAdapter.connectCallModel(accountId) + ConversationsAdapter.accountChangedSetUp(accountId) + mainViewWindowSidePanel.accountSignalsReconnect(accountId) + } + + function onUpdateConversationForAddedContact() { + mainViewWindowSidePanel.needToUpdateConversationForAddedContact() + } + + function onAccountStatusChanged() { + accountComboBox.updateAccountListModel() + } + } + + onSettingBtnClicked: { + toggleSettingsView() + } + + onAccountChanged: { + ClientWrapper.accountAdaptor.accountChanged(index) + mainViewWindowSidePanel.refreshAccountComboBox(0) + settingsView.slotAccountListChanged() + settingsView.setSelected(settingsView.selectedMenu, true) + + if (needToShowCallStack + && callStackView.responsibleAccountId === ClientWrapper.utilsAdaptor.getCurrAccId()){ + if (!ClientWrapper.accountAdaptor.hasVideoCall()) { + pushCommunicationMessageWebView() + needToShowCallStack = false + } else if (needToShowCallStack) { + pushCallStackView() + } + } + } + + onNeedToUpdateSmartList: { + mainViewWindowSidePanel.updateSmartList(accountId) + } + + onNeedToBackToWelcomePage: { + if (!inSettingsView) + mainViewWindowSidePanel.accountComboBoxNeedToShowWelcomePage(index) + } + + onNewAccountButtonClicked: { + mainViewWindowSidePanel.needToAddNewAccount() + } + + Component.onCompleted: { + ClientWrapper.accountAdaptor.setQmlObject(this) + } + } + + StackView { + id: sidePanelViewStack + + initialItem: mainViewWindowSidePanel + + anchors.top: accountComboBox.visible ? accountComboBox.bottom : mainViewSidePanelRect.top + width: mainViewSidePanelRect.width + height: accountComboBox.visible ? mainViewSidePanelRect.height - accountComboBox.height : + mainViewSidePanelRect.height + + clip: true + } } StackView { - id: welcomeViewStack + id: mainViewStack initialItem: welcomePage - SplitView.maximumWidth: hiddenView ? splitView.width : splitView.width - sidePanelViewStackPreferedWidth - SplitView.minimumWidth: sidePanelViewStackPreferedWidth + SplitView.maximumWidth: sidePanelHidden ? splitView.width : splitView.width - sidePanelViewStackPreferredWidth + SplitView.minimumWidth: sidePanelViewStackPreferredWidth SplitView.fillHeight: true clip: true } } + } - SettingsView { - id: settingsView + AccountListModel { + id: accountListModel + } - Layout.fillWidth: true - Layout.fillHeight: true - onSettingsViewWindowNeedToShowMainViewWindow: { - mainViewWindowSidePanel.refreshAccountComboBox( - accountDeleted ? 0 : -1) - mainViewStackLayout.currentIndex = 0 - } + LeftPanelView { + id: leftPanelSettingsView + visible: false + contentViewportWidth: mainViewSidePanelRect.width + contentViewPortHeight: mainViewSidePanelRect.height - onSettingsViewWindowNeedToShowNewWizardWindow: { - mainViewWindow.noAccountIsAvailable() + Connections { + target: leftPanelSettingsView.btnAccountSettings + function onCheckedToggledForRightPanel(checked) { + settingsView.setSelected(SettingsView.Account) + if (sidePanelHidden) { + recursionStackViewItemMove(mainViewStack, sidePanelViewStack, 1) + } + } + } + Connections { + target: leftPanelSettingsView.btnGeneralSettings + function onCheckedToggledForRightPanel(checked) { + settingsView.setSelected(SettingsView.General) + if (sidePanelHidden) { + recursionStackViewItemMove(mainViewStack, sidePanelViewStack, 1) + } + } + } + Connections { + target: leftPanelSettingsView.btnMediaSettings + function onCheckedToggledForRightPanel(checked) { + settingsView.setSelected(SettingsView.Media) + if (sidePanelHidden) { + recursionStackViewItemMove(mainViewStack, sidePanelViewStack, 1) + } + } + } + Connections { + target: leftPanelSettingsView.btnPluginSettings + function onCheckedToggledForRightPanel(checked) { + settingsView.setSelected(SettingsView.Plugin) + if (sidePanelHidden) { + recursionStackViewItemMove(mainViewStack, sidePanelViewStack, 1) + } } } } - AccountListModel { - id: accountListModel - } SidePanel { id: mainViewWindowSidePanel - onSettingBtnClicked_AccountComboBox: { - mainViewStackLayout.currentIndex = 1 - } - onConversationSmartListNeedToAccessMessageWebView: { communicationPageMessageWebView.headerUserAliasLabelText = currentUserAlias @@ -288,7 +451,7 @@ Window { callStackView.setLinkedWebview( communicationPageMessageWebView) - if (welcomeViewStack.find(function (item, index) { + if (mainViewStack.find(function (item, index) { return item.objectName === "communicationPageMessageWebView" }) || sidePanelViewStack.find(function (item, index) { return item.objectName === "communicationPageMessageWebView" @@ -301,24 +464,24 @@ Window { /* * Push messageWebView or callStackView onto the correct stackview */ - welcomeViewStack.pop(null, StackView.Immediate) + mainViewStack.pop(null, StackView.Immediate) sidePanelViewStack.pop(null, StackView.Immediate) - if (sidePanelViewStack.visible && welcomeViewStack.visible) { + if (sidePanelViewStack.visible && mainViewStack.visible) { if (callStackViewShouldShow) { - welcomeViewStack.push(callStackView) + mainViewStack.push(callStackView) } else { - welcomeViewStack.push(communicationPageMessageWebView) + mainViewStack.push(communicationPageMessageWebView) } } else if (sidePanelViewStack.visible - && !welcomeViewStack.visible) { + && !mainViewStack.visible) { if (callStackViewShouldShow) { sidePanelViewStack.push(callStackView) } else { sidePanelViewStack.push(communicationPageMessageWebView) } } else if (!sidePanelViewStack.visible - && !welcomeViewStack.visible) { + && !mainViewStack.visible) { if (callStackViewShouldShow) { sidePanelViewStack.push(callStackView) } else { @@ -329,17 +492,18 @@ Window { onAccountComboBoxNeedToShowWelcomePage: { - /* * If the item argument is specified, all items down to (but not including) item will be popped. */ - welcomeViewStack.pop(welcomePage) - welcomePage.currentAccountIndex = index - qrDialog.currentAccountIndex = index + if (!inSettingsView) { + mainViewStack.pop(welcomePage) + welcomePage.currentAccountIndex = index + qrDialog.currentAccountIndex = index + } } onConversationSmartListViewNeedToShowWelcomePage: { - welcomeViewStack.pop(welcomePage) + mainViewStack.pop(welcomePage) welcomePage.currentAccountIndex = 0 qrDialog.currentAccountIndex = 0 } @@ -365,6 +529,7 @@ Window { visible: false objectName: "callStackViewObject" + } WelcomePage { @@ -372,6 +537,30 @@ Window { visible: false } + SettingsView { + id: settingsView + + visible: false + + width: Math.max(mainViewStackPreferredWidth, mainViewStack.width - 100) + height: mainViewWindow.minimumHeight + + onSettingsViewWindowNeedToShowMainViewWindow: { + mainViewWindowSidePanel.refreshAccountComboBox( + accountDeleted ? 0 : -1) + toggleSettingsView() + } + + onSettingsViewWindowNeedToShowNewWizardWindow: { + mainViewWindow.noAccountIsAvailable() + } + + onSettingsBackArrowClicked: { + mainViewStack.pop(StackView.Immediate) + recursionStackViewItemMove(sidePanelViewStack, mainViewStack, 2) + } + } + MessageWebView { id: communicationPageMessageWebView @@ -394,28 +583,15 @@ Window { onNeedToGoBackToWelcomeView: { mainViewWindowSidePanel.deselectConversationSmartList() if (communicationPageMessageWebView.visible - && !welcomeViewStack.visible) { + && !mainViewStack.visible) { sidePanelViewStack.pop() } else if (communicationPageMessageWebView.visible - && welcomeViewStack.visible) { - welcomeViewStack.pop() + && mainViewStack.visible) { + mainViewStack.pop() } } Component.onCompleted: { - sidePanelViewStack.SplitView.maximumWidth = Qt.binding(function() { - return (hiddenView ? splitView.width : splitView.width - sidePanelViewStackPreferedWidth) - }) - - recordBox.x = Qt.binding(function() { - var i = (welcomeViewStack.width > 1000 ? Math.round((welcomeViewStack.width-1000)*0.5) : 0) - return sidePanelViewStack.width + recordBox.x_offset + i - }) - - recordBox.y = Qt.binding(function() { - return sidePanelViewStack.height + recordBox.y_offset - }) - /* * Set qml MessageWebView object pointer to c++. @@ -430,37 +606,37 @@ Window { /* * Hide unnecessary stackview when width is changed. */ - if (mainViewWindow.width < sidePanelViewStackPreferedWidth - + welcomePageGroupPreferedWidth - 5 - && welcomeViewStack.visible) { - welcomeViewStack.visible = false - hiddenView = true + if (mainViewWindow.width < sidePanelViewStackPreferredWidth + + mainViewStackPreferredWidth - 5 + && mainViewStack.visible) { + mainViewStack.visible = false + sidePanelHidden = true /* * The find callback function is called for each item in the stack. */ - var inWelcomeViewStack = welcomeViewStack.find( + var inWelcomeViewStack = mainViewStack.find( function (item, index) { return index > 0 }) if (inWelcomeViewStack) { - recursionStackViewItemMove(welcomeViewStack, sidePanelViewStack) + recursionStackViewItemMove(mainViewStack, sidePanelViewStack) } mainViewWindow.update() - } else if (mainViewWindow.width >= sidePanelViewStackPreferedWidth - + welcomePageGroupPreferedWidth + 5 - && !welcomeViewStack.visible) { - welcomeViewStack.visible = true - hiddenView = false + } else if (mainViewWindow.width >= sidePanelViewStackPreferredWidth + + mainViewStackPreferredWidth + 5 + && !mainViewStack.visible) { + mainViewStack.visible = true + sidePanelHidden = false var inSidePanelViewStack = sidePanelViewStack.find( function (item, index) { return index > 0 }) if (inSidePanelViewStack) { - recursionStackViewItemMove(sidePanelViewStack, welcomeViewStack) + recursionStackViewItemMove(sidePanelViewStack, mainViewStack, (inSettingsView ? 2 : 1)) } mainViewWindow.update() @@ -472,7 +648,7 @@ Window { x: Math.round((mainViewWindow.width - width) / 2) y: Math.round((mainViewWindow.height - height) / 2) - width: Math.max(mainViewWindow.width / 2, aboutPopUpPreferedWidth) + width: Math.max(mainViewWindow.width / 2, aboutPopUpPreferredWidth) height: aboutPopUpDialog.contentHeight } @@ -488,6 +664,17 @@ Window { RecordBox{ id: recordBox visible: false + + Component.onCompleted: { + recordBox.x = Qt.binding(function() { + var i = (mainViewStack.width > 1000 ? Math.round((mainViewStack.width-1000)*0.5) : 0) + return sidePanelViewStack.width + recordBox.x_offset + i + }) + + recordBox.y = Qt.binding(function() { + return mainViewStack.height + recordBox.y_offset + }) + } } UserProfile { @@ -495,7 +682,7 @@ Window { x: Math.round((mainViewWindow.width - width) / 2) y: Math.round((mainViewWindow.height - height) / 2) - width: Math.max(mainViewWindow.width / 2, aboutPopUpPreferedWidth) + width: Math.max(mainViewWindow.width / 2, aboutPopUpPreferredWidth) height: userProfile.contentHeight } diff --git a/src/mainview/components/AccountComboBox.qml b/src/mainview/components/AccountComboBox.qml index 3175068579a06e84c860d0fcd5ca4cf3a856a3ff..fac5b11aa5b3bd169b21ba5f1f292dbdcb038ebe 100644 --- a/src/mainview/components/AccountComboBox.qml +++ b/src/mainview/components/AccountComboBox.qml @@ -241,7 +241,8 @@ ComboBox { width: 25 height: 25 - source: "qrc:/images/icons/round-settings-24px.svg" + source: !mainViewWindow.inSettingsView ? "qrc:/images/icons/round-settings-24px.svg" : + "qrc:/images/icons/round-close-24px.svg" backgroundColor: "white" onClicked: { settingBtnClicked() diff --git a/src/mainview/components/AccountComboBoxPopup.qml b/src/mainview/components/AccountComboBoxPopup.qml index 0d0c2844e882131f83b71af2f1e04724d0c4b8e4..7f0974ab06fd2ed351e73ddf5532156664097581 100644 --- a/src/mainview/components/AccountComboBoxPopup.qml +++ b/src/mainview/components/AccountComboBoxPopup.qml @@ -40,9 +40,9 @@ Popup { */ implicitHeight: { comboBoxPopup.visible - return Math.min(accountComboBox.height * Math.min( - 5, accountListModel.rowCount() + 1), - sidePanelRect.height) + return Math.min(accountComboBox.height * + Math.min(5, accountListModel.rowCount() + 1), + mainViewSidePanelRect.height) } padding: 0 diff --git a/src/mainview/components/AudioCallPage.qml b/src/mainview/components/AudioCallPage.qml index 9c3f46c00056f2881ed3281d0dc967ade023c381..0a85cf235897a6d8774da405ca1110b74593bf3b 100644 --- a/src/mainview/components/AudioCallPage.qml +++ b/src/mainview/components/AudioCallPage.qml @@ -75,7 +75,7 @@ Rectangle { handle: Rectangle { implicitWidth: audioCallPageRect.width - implicitHeight: JamiTheme.splitViewHandlePreferedWidth + implicitHeight: JamiTheme.splitViewHandlePreferredWidth color: SplitHandle.pressed ? JamiTheme.pressColor : (SplitHandle.hovered ? JamiTheme.hoverColor : JamiTheme.tabbarBorderColor) } diff --git a/src/mainview/components/SidePanel.qml b/src/mainview/components/SidePanel.qml index 1dc18346b7159eda862178206ae921867ecc6f39..0500a793119e45c6f0db57c1d4d62355c1373976 100644 --- a/src/mainview/components/SidePanel.qml +++ b/src/mainview/components/SidePanel.qml @@ -37,7 +37,6 @@ Rectangle { signal accountSignalsReconnect(string accountId) signal needToUpdateConversationForAddedContact signal needToAddNewAccount - signal settingBtnClicked_AccountComboBox /* @@ -117,67 +116,16 @@ Rectangle { conversationSmartListView.updateConversationSmartListView() } + function updateSmartList(accountId) { + conversationSmartListView.currentIndex = -1 + conversationSmartListView.updateSmartList(accountId) + } /* * Intended -> since strange behavior will happen without this for stackview. */ anchors.top: parent.top - - AccountComboBox { - id: accountComboBox - - anchors.top: sidePanelRect.top - width: sidePanelRect.width - height: 64 - - currentIndex: 0 - - Connections { - target: ClientWrapper.accountAdaptor - - function onAccountSignalsReconnect(accountId) { - CallAdapter.connectCallStatusChanged(accountId) - ConversationsAdapter.accountChangedSetUp(accountId) - sidePanelRect.accountSignalsReconnect(accountId) - } - - function onUpdateConversationForAddedContact() { - sidePanelRect.needToUpdateConversationForAddedContact() - } - - function onAccountStatusChanged() { - accountComboBox.updateAccountListModel() - } - } - - onSettingBtnClicked: { - settingBtnClicked_AccountComboBox() - } - - onAccountChanged: { - ClientWrapper.accountAdaptor.accountChanged(index) - refreshAccountComboBox(0) - sidePanelRect.accountComboBoxNeedToShowWelcomePage(0) - } - - onNeedToUpdateSmartList: { - conversationSmartListView.currentIndex = -1 - conversationSmartListView.updateSmartList(accountId) - } - - onNeedToBackToWelcomePage: { - sidePanelRect.accountComboBoxNeedToShowWelcomePage(index) - } - - onNewAccountButtonClicked: { - sidePanelRect.needToAddNewAccount() - } - - Component.onCompleted: { - ClientWrapper.accountAdaptor.setQmlObject(this) - ClientWrapper.accountAdaptor.accountChanged(0) - } - } + anchors.fill: parent /* * Search bar container to embed search label @@ -186,7 +134,7 @@ Rectangle { id: contactSearchBar width: sidePanelRect.width - 26 height: 35 - anchors.top: accountComboBox.bottom + anchors.top: sidePanelRect.top anchors.topMargin: 10 anchors.left: sidePanelRect.left anchors.leftMargin: 16 @@ -211,8 +159,8 @@ Rectangle { anchors.top: tabBarVisible ? sidePanelTabBar.bottom : contactSearchBar.bottom anchors.topMargin: tabBarVisible ? 0 : 10 width: parent.width - height: tabBarVisible ? sidePanelRect.height - sidePanelTabBar.height - contactSearchBar.height - accountComboBox.height - 20 : - sidePanelRect.height - contactSearchBar.height - accountComboBox.height - 20 + height: tabBarVisible ? sidePanelRect.height - sidePanelTabBar.height - contactSearchBar.height - 20 : + sidePanelRect.height - contactSearchBar.height - 20 Connections { target: ConversationsAdapter diff --git a/src/mainview/components/VideoCallPage.qml b/src/mainview/components/VideoCallPage.qml index 047e332d6fcf97bd542e294cbeb4ebdb6d494091..105f7c8d482e25753bb1655ed8d1b9853a72d3a5 100644 --- a/src/mainview/components/VideoCallPage.qml +++ b/src/mainview/components/VideoCallPage.qml @@ -157,7 +157,7 @@ Rectangle { handle: Rectangle { implicitWidth: videoCallPageRect.width - implicitHeight: JamiTheme.splitViewHandlePreferedWidth + implicitHeight: JamiTheme.splitViewHandlePreferredWidth color: SplitHandle.pressed ? JamiTheme.pressColor : (SplitHandle.hovered ? JamiTheme.hoverColor : JamiTheme.tabbarBorderColor) } diff --git a/src/mainview/components/WelcomePage.qml b/src/mainview/components/WelcomePage.qml index 85aea30f07f367ec3509427a3d373246e1ba1765..3563eeadacb72530927d677b03b73047be22b8af 100644 --- a/src/mainview/components/WelcomePage.qml +++ b/src/mainview/components/WelcomePage.qml @@ -28,13 +28,14 @@ Rectangle { property int currentAccountIndex: 0 property int buttonPreferredSize: 30 + anchors.fill: parent Rectangle { id: welcomeRectComponentsGroup anchors.centerIn: parent - width: Math.max(welcomePageGroupPreferedWidth, welcomeRect.width - 100) + width: Math.max(mainViewStackPreferredWidth, welcomeRect.width - 100) height: mainViewWindow.minimumHeight ColumnLayout { diff --git a/src/settingsview/SettingsView.qml b/src/settingsview/SettingsView.qml index 3cc0f7770de427117417656c72c09bccfdc303ad..de667123106f6656faf3ab1dedff293a57fc9f87 100644 --- a/src/settingsview/SettingsView.qml +++ b/src/settingsview/SettingsView.qml @@ -29,6 +29,7 @@ import "components" Rectangle { id: settingsViewWindow + enum SettingsMenu{ Account, General, @@ -144,9 +145,10 @@ Rectangle { signal settingsViewWindowNeedToShowMainViewWindow(bool accountDeleted) signal settingsViewWindowNeedToShowNewWizardWindow - property int textFontSize: 9 + signal settingsBackArrowClicked visible: true + anchors.fill: parent Rectangle { id: settingsViewRect @@ -161,130 +163,86 @@ Rectangle { } } - SplitView { + StackLayout { anchors.fill: parent - orientation: Qt.Horizontal - - handle: Rectangle { - implicitWidth: 3 - implicitHeight: 3 - color: JamiTheme.lightGrey_ - } - - Rectangle { - id: leftSettingsWidget - - SplitView.minimumWidth: 200 - SplitView.preferredWidth: 200 - SplitView.maximumWidth: parent.width / 2 - SplitView.fillHeight: true - LeftPanelView { - id: leftPanelView - - contentViewportWidth: leftSettingsWidget.width - contentViewPortHeight: leftSettingsWidget.height - - onBtnExitClicked:{ - leaveSettingsSlot() - } - Connections { - target: leftPanelView.btnAccountSettings - function onCheckedToggledForRightPanel(checked) { - setSelected(SettingsView.Account) + id: rightSettingsWidget + + property int pageIdCurrentAccountSettingsScrollPage: 0 + property int pageIdCurrentSIPAccountSettingScrollPage: 1 + property int pageIdGeneralSettingsPage: 2 + property int pageIdAvSettingPage: 3 + property int pageIdPluginSettingsPage: 4 + + currentIndex: { + switch(selectedMenu){ + case SettingsView.Account: + if(settingsViewRect.isSIP){ + return pageIdCurrentSIPAccountSettingScrollPage + } else { + return pageIdCurrentAccountSettingsScrollPage } - } - Connections { - target: leftPanelView.btnGeneralSettings - function onCheckedToggledForRightPanel(checked) { - setSelected(SettingsView.General) - } - } - Connections { - target: leftPanelView.btnMediaSettings - function onCheckedToggledForRightPanel(checked) { - setSelected(SettingsView.Media) - } - } - Connections { - target: leftPanelView.btnPluginSettings - function onCheckedToggledForRightPanel(checked) { - setSelected(SettingsView.Plugin) - } - } + case SettingsView.General: + return pageIdGeneralSettingsPage + case SettingsView.Media: + return pageIdAvSettingPage + case SettingsView.Plugin: + return pageIdPluginSettingsPage } } - StackLayout { - id: rightSettingsWidget - - property int pageIdCurrentAccountSettingsScrollPage: 0 - property int pageIdCurrentSIPAccountSettingScrollPage: 1 - property int pageIdGeneralSettingsPage: 2 - property int pageIdAvSettingPage: 3 - property int pageIdPluginSettingsPage: 4 - - currentIndex: { - switch(selectedMenu){ - case SettingsView.Account: - if(settingsViewRect.isSIP){ - return pageIdCurrentSIPAccountSettingScrollPage - } else { - return pageIdCurrentAccountSettingsScrollPage - } - case SettingsView.General: - return pageIdGeneralSettingsPage - case SettingsView.Media: - return pageIdAvSettingPage - case SettingsView.Plugin: - return pageIdPluginSettingsPage - } - } - - SplitView.fillWidth: true - SplitView.fillHeight: true - - // current account setting scroll page, index 0 - CurrentAccountSettingsScrollPage { - id: currentAccountSettingsScrollWidget - - onNavigateToMainView:{ - leaveSettingsSlot(true) - } + // current account setting scroll page, index 0 + CurrentAccountSettingsScrollPage { + id: currentAccountSettingsScrollWidget - onNavigateToNewWizardView: { - leaveSettingsSlot(true, false) - } + onNavigateToMainView: { + leaveSettingsSlot(true) } - // current SIP account setting scroll page, index 1 - CurrentSIPAccountSettingScrollPage { - id: currentSIPAccountSettingsScrollWidget + onNavigateToNewWizardView: { + leaveSettingsSlot(true, false) + } + } - onNavigateToMainView: { - leaveSettingsSlot(true) - } + // current SIP account setting scroll page, index 1 + CurrentSIPAccountSettingScrollPage { + id: currentSIPAccountSettingsScrollWidget - onNavigateToNewWizardView: { - leaveSettingsSlot(true, false) - } + onNavigateToMainView: { + leaveSettingsSlot(true) } - // general setting page, index 2 - GeneralSettingsPage { - id: generalSettings + onNavigateToNewWizardView: { + leaveSettingsSlot(true, false) } + } - // av setting page, index 3 - AvSettingPage { - id: avSettings - } + // general setting page, index 2 + GeneralSettingsPage { + id: generalSettings + } - // plugin setting page, index 4 - PluginSettingsPage { - id: pluginSettings - } + // av setting page, index 3 + AvSettingPage { + id: avSettings + } + + // plugin setting page, index 4 + PluginSettingsPage { + id: pluginSettings } } } + + + /* + * Back button signal redirection + */ + Component.onCompleted: { + currentAccountSettingsScrollWidget.backArrowClicked.connect(settingsBackArrowClicked) + currentSIPAccountSettingsScrollWidget.backArrowClicked.connect(settingsBackArrowClicked) + generalSettings.backArrowClicked.connect(settingsBackArrowClicked) + avSettings.backArrowClicked.connect(settingsBackArrowClicked) + pluginSettings.backArrowClicked.connect(settingsBackArrowClicked) + } } diff --git a/src/settingsview/components/AvSettingPage.qml b/src/settingsview/components/AvSettingPage.qml index a999e32fad443a7cf1bc25c52c2a64acea9b2d2d..52d3e05effd0612f2b60bb5ebd03644761527cd9 100644 --- a/src/settingsview/components/AvSettingPage.qml +++ b/src/settingsview/components/AvSettingPage.qml @@ -24,6 +24,7 @@ import QtQuick.Layouts 1.3 import QtGraphicalEffects 1.14 import QtQuick.Controls.Styles 1.4 import net.jami.Models 1.0 +import "../../commoncomponents" Rectangle { id: avSettingPage @@ -216,6 +217,7 @@ Rectangle { } property bool previewAvailable: false + signal backArrowClicked Connections{ target: ClientWrapper.avmodel @@ -267,18 +269,47 @@ Rectangle { Layout.maximumHeight: 10 } - Label { + RowLayout { + + Layout.alignment: Qt.AlignLeft | Qt.AlignVCenter + Layout.leftMargin: 16 Layout.fillWidth: true - Layout.minimumHeight: 25 - Layout.preferredHeight: 25 - Layout.maximumHeight: 25 + Layout.maximumHeight: 64 + Layout.minimumHeight: 64 + Layout.preferredHeight: 64 - text: qsTr("Audio / Video") - font.pointSize: 15 - font.kerning: true + HoverableButton { - horizontalAlignment: Text.AlignLeft - verticalAlignment: Text.AlignVCenter + Layout.alignment: Qt.AlignVCenter | Qt.AlignLeft + Layout.preferredWidth: 30 + Layout.preferredHeight: 30 + + radius: 30 + source: "qrc:/images/icons/ic_arrow_back_24px.svg" + backgroundColor: "white" + onExitColor: "white" + + visible: mainViewWindow.sidePanelHidden + + onClicked: { + backArrowClicked() + } + } + + + Label { + Layout.fillWidth: true + Layout.minimumHeight: 25 + Layout.preferredHeight: 25 + Layout.maximumHeight: 25 + + text: qsTr("Audio / Video") + font.pointSize: 15 + font.kerning: true + + horizontalAlignment: Text.AlignLeft + verticalAlignment: Text.AlignVCenter + } } Item { diff --git a/src/settingsview/components/CurrentAccountSettingsScrollPage.qml b/src/settingsview/components/CurrentAccountSettingsScrollPage.qml index b3d43923f10ae106f7d58ca57171b887078d9c4a..78358f1d4f5a2143ac1fe47900ee917cc01456e3 100644 --- a/src/settingsview/components/CurrentAccountSettingsScrollPage.qml +++ b/src/settingsview/components/CurrentAccountSettingsScrollPage.qml @@ -48,6 +48,7 @@ Rectangle { signal navigateToMainView signal navigateToNewWizardView + signal backArrowClicked function refreshRelevantUI(){ refreshVariable++ @@ -479,6 +480,26 @@ Rectangle { Layout.minimumWidth: 30 } + + HoverableButton { + + Layout.alignment: Qt.AlignVCenter | Qt.AlignLeft + Layout.preferredWidth: 30 + Layout.preferredHeight: 30 + + radius: 30 + source: "qrc:/images/icons/ic_arrow_back_24px.svg" + backgroundColor: "white" + onExitColor: "white" + + visible: mainViewWindow.sidePanelHidden + + onClicked: { + backArrowClicked() + } + } + + Label { id: accountPageTitle diff --git a/src/settingsview/components/CurrentSIPAccountSettingScrollPage.qml b/src/settingsview/components/CurrentSIPAccountSettingScrollPage.qml index b5d1d2c0020c8de3cd4c365aa039ffc9416daaf3..68de1e14937dabb5b27e19e1be67bb62342358e3 100644 --- a/src/settingsview/components/CurrentSIPAccountSettingScrollPage.qml +++ b/src/settingsview/components/CurrentSIPAccountSettingScrollPage.qml @@ -29,6 +29,7 @@ import "../../commoncomponents" Rectangle { signal navigateToMainView signal navigateToNewWizardView + signal backArrowClicked function updateAccountInfoDisplayed() { displaySIPNameLineEdit.text = ClientWrapper.settingsAdaptor.getCurrentAccount_Profile_Info_Alias() @@ -124,6 +125,24 @@ Rectangle { Layout.minimumWidth: 48 } + HoverableButton { + + Layout.alignment: Qt.AlignVCenter | Qt.AlignLeft + Layout.preferredWidth: 30 + Layout.preferredHeight: 30 + + radius: 30 + source: "qrc:/images/icons/ic_arrow_back_24px.svg" + backgroundColor: "white" + onExitColor: "white" + + visible: mainViewWindow.sidePanelHidden + + onClicked: { + backArrowClicked() + } + } + Label { id: accountPageTitleSIP diff --git a/src/settingsview/components/GeneralSettingsPage.qml b/src/settingsview/components/GeneralSettingsPage.qml index 72eb4d1920fd19d5b151566792dc76fb20d97865..50895fbeb999db13ca6cad7242fe0f16523ae68f 100644 --- a/src/settingsview/components/GeneralSettingsPage.qml +++ b/src/settingsview/components/GeneralSettingsPage.qml @@ -74,7 +74,7 @@ Rectangle { updateRecordQualityTimer.restart() } - Timer{ + Timer { id: updateRecordQualityTimer interval: 500 @@ -148,6 +148,8 @@ Rectangle { //property AVModel avmodel: ClientWrapper.accountAdaptor.avModel() property string recordPath: ClientWrapper.settingsAdaptor.getDir_Document() + signal backArrowClicked + onDownloadPathChanged: { if(downloadPath === "") return ClientWrapper.settingsAdaptor.setDownloadPath(downloadPath) @@ -164,46 +166,74 @@ Rectangle { Layout.fillHeight: true Layout.fillWidth: true - ScrollView{ + ScrollView { anchors.fill: parent clip: true - RowLayout { - width: generalSettingsRect.width - height: generalSettingsRect.height + ColumnLayout { + spacing: 8 - spacing: 0 + Layout.fillHeight: true + Layout.maximumWidth: 580 + Layout.preferredWidth: 580 + Layout.minimumWidth: 580 - Item { - Layout.fillHeight: true - Layout.maximumWidth: 48 - Layout.preferredWidth: 48 - Layout.minimumWidth: 48 - } + RowLayout { - ColumnLayout { - spacing: 6 + Layout.alignment: Qt.AlignLeft | Qt.AlignVCenter + Layout.leftMargin: 16 + Layout.fillWidth: true + Layout.maximumHeight: 64 + Layout.minimumHeight: 64 + Layout.preferredHeight: 64 - Layout.fillHeight: true - Layout.maximumWidth: 580 - Layout.preferredWidth: 580 - Layout.minimumWidth: 580 + HoverableButton { + id: backToSettingsMenuButton - Item { - Layout.fillWidth: true - Layout.minimumHeight: 10 - Layout.preferredHeight: 10 - Layout.maximumHeight: 10 + Layout.alignment: Qt.AlignVCenter | Qt.AlignLeft + Layout.preferredWidth: 30 + Layout.preferredHeight: 30 + + radius: 30 + source: "qrc:/images/icons/ic_arrow_back_24px.svg" + backgroundColor: "white" + onExitColor: "white" + + visible: mainViewWindow.sidePanelHidden + + onClicked: { + backArrowClicked() + } } Label { Layout.fillWidth: true - Layout.minimumHeight: 25 - Layout.preferredHeight: 25 - Layout.maximumHeight: 25 + Layout.minimumHeight: 64 + Layout.preferredHeight: 64 + Layout.maximumHeight: 64 text: qsTr("General") - font.pointSize: 15 + font.pointSize: JamiTheme.titleFontSize + font.kerning: true + + horizontalAlignment: Text.AlignLeft + verticalAlignment: Text.AlignVCenter + } + } + + // system setting panel + ColumnLayout { + spacing: 6 + Layout.fillWidth: true + + Label { + Layout.fillWidth: true + Layout.minimumHeight: 21 + Layout.preferredHeight: 21 + Layout.maximumHeight: 21 + + text: qsTr("System") + font.pointSize: 13 font.kerning: true horizontalAlignment: Text.AlignLeft @@ -212,214 +242,221 @@ Rectangle { Item { Layout.fillWidth: true - Layout.minimumHeight: 24 - Layout.preferredHeight: 24 - Layout.maximumHeight: 24 + + Layout.minimumHeight: 10 + Layout.preferredHeight: 10 + Layout.maximumHeight: 10 } - // system setting panel ColumnLayout { spacing: 6 Layout.fillWidth: true - Label { - Layout.fillWidth: true - Layout.minimumHeight: 21 - Layout.preferredHeight: 21 - Layout.maximumHeight: 21 + ToggleSwitch { + id: notificationCheckBox - text: qsTr("System") - font.pointSize: 13 - font.kerning: true + Layout.leftMargin: 20 - horizontalAlignment: Text.AlignLeft - verticalAlignment: Text.AlignVCenter - } + labelText: "Enable desktop notifications" + fontPointSize: 11 - Item { - Layout.fillWidth: true - - Layout.minimumHeight: 10 - Layout.preferredHeight: 10 - Layout.maximumHeight: 10 + onSwitchToggled: { + slotSetNotifications(checked) + } } - ColumnLayout { - spacing: 6 - Layout.fillWidth: true - - ToggleSwitch { - id: notificationCheckBox + ToggleSwitch { + id: closeOrMinCheckBox - Layout.leftMargin: 20 + Layout.leftMargin: 20 - labelText: "Enable desktop notifications" - fontPointSize: 11 + labelText: "Keep minimize on close" + fontPointSize: 11 - onSwitchToggled: { - slotSetNotifications(checked) - } + onSwitchToggled: { + slotSetClosedOrMin(checked) } + } - ToggleSwitch { - id: closeOrMinCheckBox + ToggleSwitch { + id: applicationOnStartUpCheckBox - Layout.leftMargin: 20 + Layout.leftMargin: 20 - labelText: "Keep minimize on close" - fontPointSize: 11 + labelText: "Run on Startup" + fontPointSize: 11 - onSwitchToggled: { - slotSetClosedOrMin(checked) - } + onSwitchToggled: { + slotSetRunOnStartUp(checked) } + } - ToggleSwitch { - id: applicationOnStartUpCheckBox + RowLayout { + spacing: 6 - Layout.leftMargin: 20 + Layout.leftMargin: 20 + Layout.fillWidth: true + Layout.maximumHeight: 30 - labelText: "Run on Startup" - fontPointSize: 11 + Label { + Layout.fillHeight: true - onSwitchToggled: { - slotSetRunOnStartUp(checked) - } - } + Layout.maximumWidth: 94 + Layout.preferredWidth: 94 + Layout.minimumWidth: 94 + + text: qsTr("Download folder") + font.pointSize: 10 + font.kerning: true - RowLayout { - spacing: 6 + horizontalAlignment: Text.AlignLeft + verticalAlignment: Text.AlignVCenter + } - Layout.leftMargin: 20 + Item { + Layout.fillHeight: true Layout.fillWidth: true - Layout.maximumHeight: 30 + } - Label { - Layout.fillHeight: true + HoverableRadiusButton { + id: downloadButton - Layout.maximumWidth: 94 - Layout.preferredWidth: 94 - Layout.minimumWidth: 94 + Layout.maximumWidth: 320 + Layout.preferredWidth: 320 + Layout.minimumWidth: 320 - text: qsTr("Download folder") - font.pointSize: 10 - font.kerning: true + Layout.minimumHeight: 30 + Layout.preferredHeight: 30 + Layout.maximumHeight: 30 - horizontalAlignment: Text.AlignLeft - verticalAlignment: Text.AlignVCenter - } + radius: height / 2 - Item { - Layout.fillHeight: true - Layout.fillWidth: true - } + icon.source: "qrc:/images/icons/round-folder-24px.svg" + icon.height: 24 + icon.width: 24 - HoverableRadiusButton { - id: downloadButton + text: downloadPath + fontPointSize: 10 - Layout.maximumWidth: 320 - Layout.preferredWidth: 320 - Layout.minimumWidth: 320 + onClicked: { + openDownloadFolderSlot() + } + } + } + } + } - Layout.minimumHeight: 30 - Layout.preferredHeight: 30 - Layout.maximumHeight: 30 + Item { + Layout.fillWidth: true + Layout.minimumHeight: 20 + Layout.preferredHeight: 20 + Layout.maximumHeight: 20 + } - radius: height / 2 + // call recording setting panel + ColumnLayout { + spacing: 6 + Layout.fillWidth: true - icon.source: "qrc:/images/icons/round-folder-24px.svg" - icon.height: 24 - icon.width: 24 + Label { + Layout.fillWidth: true + Layout.minimumHeight: 21 + Layout.preferredHeight: 21 + Layout.maximumHeight: 21 - text: downloadPath - fontPointSize: 10 + text: qsTr("Call Recording") + font.pointSize: 13 + font.kerning: true - onClicked: { - openDownloadFolderSlot() - } - } - } - } + horizontalAlignment: Text.AlignLeft + verticalAlignment: Text.AlignVCenter } Item { Layout.fillWidth: true - Layout.minimumHeight: 20 - Layout.preferredHeight: 20 - Layout.maximumHeight: 20 + + Layout.minimumHeight: 10 + Layout.preferredHeight: 10 + Layout.maximumHeight: 10 } - // call recording setting panel ColumnLayout { spacing: 6 Layout.fillWidth: true - Label { - Layout.fillWidth: true - Layout.minimumHeight: 21 - Layout.preferredHeight: 21 - Layout.maximumHeight: 21 + ToggleSwitch { + id: alwaysRecordingCheckBox - text: qsTr("Call Recording") - font.pointSize: 13 - font.kerning: true + Layout.leftMargin: 20 - horizontalAlignment: Text.AlignLeft - verticalAlignment: Text.AlignVCenter + labelText: "Always record calls" + fontPointSize: 11 + + onSwitchToggled: { + slotAlwaysRecordingClicked(checked) + } } - Item { - Layout.fillWidth: true + ToggleSwitch { + id: recordPreviewCheckBox - Layout.minimumHeight: 10 - Layout.preferredHeight: 10 - Layout.maximumHeight: 10 + Layout.leftMargin: 20 + + labelText: "Record preview video for a call" + fontPointSize: 11 + + onSwitchToggled: { + slotRecordPreviewClicked(checked) + } } - ColumnLayout { + RowLayout { spacing: 6 + Layout.leftMargin: 20 Layout.fillWidth: true + Layout.maximumHeight: 30 - ToggleSwitch { - id: alwaysRecordingCheckBox + Label { + Layout.fillHeight: true - Layout.leftMargin: 20 + Layout.maximumWidth: 42 + Layout.preferredWidth: 42 + Layout.minimumWidth: 42 - labelText: "Always record calls" - fontPointSize: 11 + text: qsTr("Quality") + font.pointSize: 10 + font.kerning: true - onSwitchToggled: { - slotAlwaysRecordingClicked(checked) - } + horizontalAlignment: Text.AlignLeft + verticalAlignment: Text.AlignVCenter } - ToggleSwitch { - id: recordPreviewCheckBox - - Layout.leftMargin: 20 + Item { + Layout.fillHeight: true + Layout.fillWidth: true + } - labelText: "Record preview video for a call" - fontPointSize: 11 + ColumnLayout { + spacing: 0 + Layout.fillHeight: true - onSwitchToggled: { - slotRecordPreviewClicked(checked) + Layout.maximumWidth: recordQualityValueLabel.width + Item { + Layout.fillHeight: true + Layout.fillWidth: true } - } - - RowLayout { - spacing: 6 - Layout.leftMargin: 20 - Layout.fillWidth: true - Layout.maximumHeight: 30 Label { - Layout.fillHeight: true + id: recordQualityValueLabel + + Layout.minimumWidth: 40 - Layout.maximumWidth: 42 - Layout.preferredWidth: 42 - Layout.minimumWidth: 42 + Layout.minimumHeight: 16 + Layout.preferredHeight: 16 + Layout.maximumHeight: 16 + + text: qsTr("VALUE ") - text: qsTr("Quality") font.pointSize: 10 font.kerning: true @@ -431,244 +468,205 @@ Rectangle { Layout.fillHeight: true Layout.fillWidth: true } + } - ColumnLayout { - spacing: 0 - Layout.fillHeight: true - - Layout.maximumWidth: recordQualityValueLabel.width - Item { - Layout.fillHeight: true - Layout.fillWidth: true - } - - Label { - id: recordQualityValueLabel - - Layout.minimumWidth: 40 - - Layout.minimumHeight: 16 - Layout.preferredHeight: 16 - Layout.maximumHeight: 16 + Slider { + id: recordQualitySlider - text: qsTr("VALUE ") + Layout.fillHeight: true - font.pointSize: 10 - font.kerning: true + Layout.maximumWidth: 320 + Layout.preferredWidth: 320 + Layout.minimumWidth: 320 - horizontalAlignment: Text.AlignLeft - verticalAlignment: Text.AlignVCenter - } + from: 0 + to: 500 + stepSize: 1 - Item { - Layout.fillHeight: true - Layout.fillWidth: true - } + onMoved: { + slotRecordQualitySliderValueChanged(value) } + } + } - Slider{ - id: recordQualitySlider + RowLayout { + spacing: 6 - Layout.fillHeight: true + Layout.leftMargin: 20 + Layout.fillWidth: true + Layout.maximumHeight: 30 - Layout.maximumWidth: 320 - Layout.preferredWidth: 320 - Layout.minimumWidth: 320 + Label { + Layout.fillHeight: true - from: 0 - to: 500 - stepSize: 1 + Layout.maximumWidth: 42 + Layout.preferredWidth: 42 + Layout.minimumWidth: 42 - onMoved: { - slotRecordQualitySliderValueChanged(value) - } - } - } + text: qsTr("Save in") + font.pointSize: 10 + font.kerning: true - RowLayout { - spacing: 6 + horizontalAlignment: Text.AlignLeft + verticalAlignment: Text.AlignVCenter + } - Layout.leftMargin: 20 + Item { + Layout.fillHeight: true Layout.fillWidth: true - Layout.maximumHeight: 30 + } - Label { - Layout.fillHeight: true + HoverableRadiusButton { + id: recordPathButton - Layout.maximumWidth: 42 - Layout.preferredWidth: 42 - Layout.minimumWidth: 42 + Layout.maximumWidth: 320 + Layout.preferredWidth: 320 + Layout.minimumWidth: 320 - text: qsTr("Save in") - font.pointSize: 10 - font.kerning: true + Layout.minimumHeight: 30 + Layout.preferredHeight: 30 + Layout.maximumHeight: 30 - horizontalAlignment: Text.AlignLeft - verticalAlignment: Text.AlignVCenter - } + radius: height / 2 - Item { - Layout.fillHeight: true - Layout.fillWidth: true - } + icon.source: "qrc:/images/icons/round-folder-24px.svg" + icon.height: 24 + icon.width: 24 - HoverableRadiusButton { - id: recordPathButton + text: recordPath + fontPointSize: 10 - Layout.maximumWidth: 320 - Layout.preferredWidth: 320 - Layout.minimumWidth: 320 + onClicked: { + openRecordFolderSlot() + } + } + } + } + } - Layout.minimumHeight: 30 - Layout.preferredHeight: 30 - Layout.maximumHeight: 30 + Item { + Layout.fillWidth: true + Layout.minimumHeight: 20 + Layout.preferredHeight: 20 + Layout.maximumHeight: 20 + } - radius: height / 2 + // update setting panel + ColumnLayout { + spacing: 6 + Layout.fillWidth: true + visible: Qt.platform.os == "windows"? true : false - icon.source: "qrc:/images/icons/round-folder-24px.svg" - icon.height: 24 - icon.width: 24 + Label { + Layout.fillWidth: true + Layout.minimumHeight: 21 + Layout.preferredHeight: 21 + Layout.maximumHeight: 21 - text: recordPath - fontPointSize: 10 + text: qsTr("Updates") + font.pointSize: 13 + font.kerning: true - onClicked: { - openRecordFolderSlot() - } - } - } - } + horizontalAlignment: Text.AlignLeft + verticalAlignment: Text.AlignVCenter } Item { Layout.fillWidth: true - Layout.minimumHeight: 20 - Layout.preferredHeight: 20 - Layout.maximumHeight: 20 + + Layout.minimumHeight: 10 + Layout.preferredHeight: 10 + Layout.maximumHeight: 10 } - // update setting panel ColumnLayout { spacing: 6 Layout.fillWidth: true - visible: Qt.platform.os == "windows"? true : false - Label { - Layout.fillWidth: true - Layout.minimumHeight: 21 - Layout.preferredHeight: 21 - Layout.maximumHeight: 21 + ToggleSwitch { + id: autoUpdateCheckBox - text: qsTr("Updates") - font.pointSize: 13 - font.kerning: true + Layout.leftMargin: 20 - horizontalAlignment: Text.AlignLeft - verticalAlignment: Text.AlignVCenter - } - - Item { - Layout.fillWidth: true + labelText: "Check for updates automatically" + fontPointSize: 11 - Layout.minimumHeight: 10 - Layout.preferredHeight: 10 - Layout.maximumHeight: 10 + onSwitchToggled: { + slotSetUpdateAutomatic(checked) + } } - ColumnLayout { + RowLayout { spacing: 6 - Layout.fillWidth: true - - ToggleSwitch { - id: autoUpdateCheckBox - Layout.leftMargin: 20 - - labelText: "Check for updates automatically" - fontPointSize: 11 + Layout.leftMargin: 20 + Layout.fillWidth: true + Layout.maximumHeight: 30 - onSwitchToggled: { - slotSetUpdateAutomatic(checked) - } - } + HoverableRadiusButton { + id: checkUpdateButton - RowLayout { - spacing: 6 + Layout.maximumWidth: 275 + Layout.preferredWidth: 275 + Layout.minimumWidth: 275 - Layout.leftMargin: 20 - Layout.fillWidth: true + Layout.minimumHeight: 30 + Layout.preferredHeight: 30 Layout.maximumHeight: 30 - HoverableRadiusButton { - id: checkUpdateButton - - Layout.maximumWidth: 275 - Layout.preferredWidth: 275 - Layout.minimumWidth: 275 + radius: height / 2 - Layout.minimumHeight: 30 - Layout.preferredHeight: 30 - Layout.maximumHeight: 30 + text: "Check for updates now" + fontPointSize: 10 - radius: height / 2 - - text: "Check for updates now" - fontPointSize: 10 - - onClicked: { - checkForUpdateSlot() - } + onClicked: { + checkForUpdateSlot() } + } - Item { - Layout.fillHeight: true - Layout.fillWidth: true - } + Item { + Layout.fillHeight: true + Layout.fillWidth: true } + } - RowLayout { - spacing: 6 + RowLayout { + spacing: 6 - Layout.leftMargin: 20 - Layout.fillWidth: true - Layout.maximumHeight: 30 + Layout.leftMargin: 20 + Layout.fillWidth: true + Layout.maximumHeight: 30 - HoverableRadiusButton { - id: installBetaButton + HoverableRadiusButton { + id: installBetaButton - Layout.maximumWidth: 275 - Layout.preferredWidth: 275 - Layout.minimumWidth: 275 + Layout.maximumWidth: 275 + Layout.preferredWidth: 275 + Layout.minimumWidth: 275 - Layout.minimumHeight: 30 - Layout.preferredHeight: 30 - Layout.maximumHeight: 30 + Layout.minimumHeight: 30 + Layout.preferredHeight: 30 + Layout.maximumHeight: 30 - radius: height / 2 + radius: height / 2 - text: "Install the latest beta version" - fontPointSize: 10 + text: "Install the latest beta version" + fontPointSize: 10 - onClicked: { - installBetaSlot() - } + onClicked: { + installBetaSlot() } + } - Item { - Layout.fillHeight: true - Layout.fillWidth: true - } + Item { + Layout.fillHeight: true + Layout.fillWidth: true } } } - - // spacer on the bottom - Item { - Layout.fillHeight: true - Layout.fillWidth: true - } } + // spacer on the bottom Item { Layout.fillHeight: true Layout.fillWidth: true diff --git a/src/settingsview/components/LeftPanelView.qml b/src/settingsview/components/LeftPanelView.qml index f11fe2377dd32c98f921dd53f40add71e59aa5a3..e1e0a1312cb1aea5cb42a609f527c5f8fc07af16 100644 --- a/src/settingsview/components/LeftPanelView.qml +++ b/src/settingsview/components/LeftPanelView.qml @@ -23,11 +23,13 @@ import QtQuick.Controls 2.14 import QtQuick.Controls.Universal 2.12 import QtQuick.Layouts 1.3 import QtGraphicalEffects 1.14 +import net.jami.Models 1.0 import "../../commoncomponents" +import "../../mainview/components" -ScrollView{ - id: leftPanelView +Rectangle { + id: leftPanelRect property int contentViewportWidth: 200 property int contentViewPortHeight: 768 @@ -45,6 +47,7 @@ ScrollView{ anchors.fill: parent clip: true + color: JamiTheme.backgroundColor ColumnLayout { spacing: 0 @@ -52,83 +55,6 @@ ScrollView{ width: contentViewportWidth height: contentViewPortHeight - Item { - Layout.fillWidth: true - Layout.maximumHeight: 13 - Layout.preferredHeight: 13 - Layout.minimumHeight: 13 - } - - RowLayout { - Layout.fillWidth: true - Layout.maximumHeight: 20 - Layout.preferredHeight: 20 - Layout.minimumHeight: 20 - - Layout.rightMargin: 14 - - Item { - Layout.fillHeight: true - - Layout.maximumWidth: 20 - Layout.preferredWidth: 20 - Layout.minimumWidth: 20 - } - - Label { - Layout.maximumWidth: 57 - Layout.preferredWidth: 57 - Layout.minimumWidth: 57 - - Layout.maximumHeight: 30 - Layout.preferredHeight: 30 - Layout.minimumHeight: 30 - - text: qsTr("Settings") - font.pointSize: 12 - font.kerning: true - - horizontalAlignment: Text.AlignLeft - verticalAlignment: Text.AlignVCenter - } - - Item { - Layout.fillWidth: true - Layout.fillHeight: true - } - - HoverableRadiusButton { - id: btnExitSettings - Layout.maximumWidth: 30 - Layout.preferredWidth: 30 - Layout.minimumWidth: 30 - - Layout.maximumHeight: 30 - Layout.preferredHeight: 30 - Layout.minimumHeight: 30 - - buttonImageHeight: height - buttonImageWidth: height - backgroundColor: "transparent" - - radius: height / 2 - - icon.source: "qrc:/images/icons/round-close-24px.svg" - icon.height: 24 - icon.width: 24 - - onClicked: { - btnExitClicked() - } - } - } - Item { - Layout.fillWidth: true - Layout.maximumHeight: 13 - Layout.preferredHeight: 13 - Layout.minimumHeight: 13 - } - IconButton { id: accountSettingsButton @@ -186,6 +112,5 @@ ScrollView{ Layout.fillHeight: true } } - } diff --git a/src/settingsview/components/PluginSettingsPage.qml b/src/settingsview/components/PluginSettingsPage.qml index b71f7aa412c6aae73ce79660b77dafa6a88ebf6b..a9d59d0ed71272b6ddf141b2d8740da5d6c9f08f 100644 --- a/src/settingsview/components/PluginSettingsPage.qml +++ b/src/settingsview/components/PluginSettingsPage.qml @@ -45,28 +45,56 @@ Rectangle { Layout.fillHeight: true Layout.fillWidth: true + signal backArrowClicked + ColumnLayout { anchors.fill: parent spacing: 6 width: parent.width height: parent.height - - Label { - width: parent.width - height: parent.height - Layout.leftMargin: 35 - Layout.topMargin: 15 - Layout.alignment: Qt.AlignTop + RowLayout { + + Layout.alignment: Qt.AlignLeft | Qt.AlignVCenter + Layout.leftMargin: 16 + Layout.fillWidth: true + Layout.maximumHeight: 64 + Layout.minimumHeight: 64 + Layout.preferredHeight: 64 - text: qsTr("Plugin") + HoverableButton { - font.pointSize: 15 - font.kerning: true + Layout.alignment: Qt.AlignVCenter | Qt.AlignLeft + Layout.preferredWidth: 30 + Layout.preferredHeight: 30 - horizontalAlignment: Text.AlignBottom - verticalAlignment: Text.AlignVCenter + radius: 30 + source: "qrc:/images/icons/ic_arrow_back_24px.svg" + backgroundColor: "white" + onExitColor: "white" + + visible: mainViewWindow.sidePanelHidden + + onClicked: { + backArrowClicked() + } + } + + Label { + Layout.fillWidth: true + Layout.minimumHeight: 25 + Layout.preferredHeight: 25 + Layout.maximumHeight: 25 + + text: qsTr("Plugin") + + font.pointSize: 15 + font.kerning: true + + horizontalAlignment: Text.AlignLeft + verticalAlignment: Text.AlignVCenter + } } ScrollView { @@ -96,7 +124,7 @@ Rectangle { onSwitchToggled: { slotSetPluginEnabled(checked) - + pluginListSettingsView.visible = checked if (!checked) { pluginListPreferencesView.visible = checked @@ -111,7 +139,7 @@ Rectangle { Layout.fillHeight: true width:380 height:100 - + // instantiate plugin list setting page PluginListSettingsView { id: pluginListSettingsView