From a84e5fdbdc7e6b69cb79872f609a1330964b7cc0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Blin?= <sebastien.blin@savoirfairelinux.com> Date: Sun, 16 Aug 2020 17:39:15 -0400 Subject: [PATCH] welcomepage: re-add credits + changelog Change-Id: Ib253521997c3271885f83c628e918bb26ae61a2c --- src/mainview/MainView.qml | 4 ++-- src/mainview/components/AboutPopUp.qml | 32 +++++++------------------ src/mainview/components/WelcomePage.qml | 32 ++++++++++++++----------- 3 files changed, 28 insertions(+), 40 deletions(-) diff --git a/src/mainview/MainView.qml b/src/mainview/MainView.qml index d7a0a89ee..a271fab10 100644 --- a/src/mainview/MainView.qml +++ b/src/mainview/MainView.qml @@ -43,7 +43,7 @@ Window { property int mainViewWindowPreferredHeight: 600 property int sidePanelViewStackPreferredWidth: 250 property int mainViewStackPreferredWidth: 250 - property int aboutPopUpPreferredWidth: 250 + property int aboutPopUpPreferredWidth: 400 property int savedSidePanelViewMinWidth: 0 property int savedSidePanelViewMaxWidth: 0 @@ -679,7 +679,7 @@ Window { x: Math.round((mainViewWindow.width - width) / 2) y: Math.round((mainViewWindow.height - height) / 2) - width: Math.max(mainViewWindow.width / 2, aboutPopUpPreferredWidth) + width: aboutPopUpPreferredWidth height: aboutPopUpDialog.contentHeight } diff --git a/src/mainview/components/AboutPopUp.qml b/src/mainview/components/AboutPopUp.qml index f13c46a01..0ed5fb7f9 100644 --- a/src/mainview/components/AboutPopUp.qml +++ b/src/mainview/components/AboutPopUp.qml @@ -241,22 +241,11 @@ Dialog { anchors.fill: parent - HoverableButton { + MaterialButton { id: changeLogButton - - Layout.alignment: Qt.AlignCenter - Layout.preferredWidth: textMetricschangeLogButton.boundingRect.width + 20 - Layout.preferredHeight: 30 - - radius: 10 - fontPointSize: JamiTheme.textFontSize - 2 - text: textMetricschangeLogButton.text - - TextMetrics { - id: textMetricschangeLogButton - font: changeLogButton.font - text: qsTr("Change Log") - } + text: qsTr("Changelog") + color: projectCreditsScrollView.visible? JamiTheme.buttonTintedGreyInactive : JamiTheme.buttonTintedGrey + Layout.preferredWidth: 100 onClicked: { if (changeLogOrCreditsStack.depth > 1) { @@ -265,16 +254,11 @@ Dialog { } } - HoverableButton { + MaterialButton { id: creditsButton - - Layout.alignment: Qt.AlignCenter - Layout.preferredWidth: changeLogButton.width - Layout.preferredHeight: 30 - - radius: 10 - fontPointSize: JamiTheme.textFontSize - 2 - text: qsTr("Credits") + text: qsTr("Credit") + color: projectCreditsScrollView.visible? JamiTheme.buttonTintedGrey : JamiTheme.buttonTintedGreyInactive + Layout.preferredWidth: 100 onClicked: { if (changeLogOrCreditsStack.depth == 1) { diff --git a/src/mainview/components/WelcomePage.qml b/src/mainview/components/WelcomePage.qml index ad4887174..49d8061d8 100644 --- a/src/mainview/components/WelcomePage.qml +++ b/src/mainview/components/WelcomePage.qml @@ -99,37 +99,27 @@ Rectangle { Rectangle { id: jamiRegisteredNameRect - Layout.alignment: Qt.AlignCenter Layout.preferredWidth: welcomeRectComponentsGroup.width Layout.preferredHeight: 65 Layout.bottomMargin: 5 - visible: accountListModel.data(accountListModel.index( 0, 0), 260) === 1 ColumnLayout { id: jamiRegisteredNameRectColumnLayout - spacing: 0 - Text { id: jamiRegisteredNameText - Layout.alignment: Qt.AlignCenter Layout.preferredWidth: welcomeRectComponentsGroup.width Layout.preferredHeight: 30 - font.pointSize: JamiTheme.textFontSize + 1 - horizontalAlignment: Text.AlignHCenter verticalAlignment: Text.AlignVCenter - text: textMetricsjamiRegisteredNameText.elidedText - TextMetrics { id: textMetricsjamiRegisteredNameText - font: jamiRegisteredNameText.font text: accountListModel.data( accountListModel.index( @@ -138,17 +128,13 @@ Rectangle { elide: Qt.ElideMiddle } } - HoverableButton { id: copyRegisterednameButton - Layout.alignment: Qt.AlignCenter Layout.preferredWidth: buttonPreferredSize Layout.preferredHeight: buttonPreferredSize - radius: 30 source: "qrc:/images/icons/ic_content_copy.svg" - onClicked: { ClientWrapper.utilsAdaptor.setText( textMetricsjamiRegisteredNameText.text) @@ -159,6 +145,24 @@ Rectangle { } } + + Button { + anchors.bottom: parent.bottom + anchors.horizontalCenter: parent.horizontalCenter + background: Rectangle { + color: "transparent" + } + anchors.bottomMargin: 12 + contentItem: Text { + text: qsTr("About Jami") + color: "grey" + } + + onClicked: { + aboutPopUpDialog.open() + } + } + CustomBorder { commonBorder: false lBorderwidth: 1 -- GitLab