Show pages headers to go back to pane when needed

This commit is contained in:
miruka 2020-03-19 20:33:46 -04:00
parent 8b769c42d3
commit ee6ac18671
7 changed files with 62 additions and 4 deletions

View File

@ -2,7 +2,6 @@
## Before release ## Before release
- page back buttons
- Add Gentoo instructions - Add Gentoo instructions
- Build final AppImage and test media opening - Build final AppImage and test media opening

View File

@ -0,0 +1,50 @@
// SPDX-License-Identifier: LGPL-3.0-or-later
import QtQuick 2.12
import QtQuick.Layouts 1.12
Rectangle {
width: page.width
height: show ? theme.baseElementsHeight : 0
visible: height > 0
color: theme.controls.header.background
property HPage page: parent
property bool show: mainUI.mainPane.collapse
Behavior on height { HNumberAnimation {} }
HRowLayout {
anchors.fill: parent
HButton {
id: goToMainPaneButton
padded: false
backgroundColor: "transparent"
icon.name: "go-back-to-main-pane"
toolTip.text: qsTr("Go back to main pane")
onClicked: mainUI.mainPane.toggleFocus()
Layout.preferredWidth: theme.baseElementsHeight
Layout.fillHeight: true
}
HLabel {
text: page.title
elide: Text.ElideRight
horizontalAlignment: Qt.AlignHCenter
verticalAlignment: Qt.AlignVCenter
Layout.fillWidth: true
Layout.fillHeight: true
}
Item {
Layout.preferredWidth: goToMainPaneButton.width
Layout.fillHeight: true
}
}
}

View File

@ -16,7 +16,9 @@ HLoader {
Component.onCompleted: { Component.onCompleted: {
if (! py.startupAnyAccountsSaved) { if (! py.startupAnyAccountsSaved) {
pageLoader.showPage("AddAccount/AddAccount") pageLoader.showPage(
"AddAccount/AddAccount", {"header.show": false},
)
return return
} }

View File

@ -8,6 +8,8 @@ import "../../Base"
HFlickableColumnPage { HFlickableColumnPage {
id: accountSettings id: accountSettings
title: qsTr("Account settings")
header: HPageHeader {}
property int avatarPreferredSize: 256 * theme.uiScale property int avatarPreferredSize: 256 * theme.uiScale

View File

@ -5,6 +5,9 @@ import QtQuick.Layouts 1.12
import "../../Base" import "../../Base"
HFlickableColumnPage { HFlickableColumnPage {
title: qsTr("Add an account")
header: HPageHeader {}
HTabContainer { HTabContainer {
tabModel: [ tabModel: [
qsTr("Sign in"), qsTr("Register"), qsTr("Reset"), qsTr("Sign in"), qsTr("Register"), qsTr("Reset"),

View File

@ -7,6 +7,8 @@ import "../../Base"
HFlickableColumnPage { HFlickableColumnPage {
id: addChatPage id: addChatPage
title: qsTr("Add new chat")
header: HPageHeader {}
property string userId property string userId

View File

@ -107,7 +107,7 @@ controls:
color windowOverlay: hsluv(0, 0, 0, 0.7) color windowOverlay: hsluv(0, 0, 0, 0.7)
header: header:
color background: colors.mediumBackground color background: colors.strongBackground
button: button:
color background: colors.strongBackground color background: colors.strongBackground
@ -306,7 +306,7 @@ mainPane:
chat: chat:
roomHeader: roomHeader:
color background: colors.strongBackground color background: controls.header.background
color name: colors.text color name: colors.text
color topic: colors.dimText color topic: colors.dimText