Skip to content
Snippets Groups Projects
Commit fe9745ce authored by Sébastien Blin's avatar Sébastien Blin Committed by Ming Rui Zhang
Browse files

messagewebviewheader: clean code

+ Change name to ChatviewHeader as no webview
+ Avoid anchors hell and use a RowLayout

Change-Id: Iff4bbeabc70cfa496a7a208ee5da0c9ea1b6ff08
parent 2e67dc1b
No related branches found
No related tags found
No related merge requests found
......@@ -95,7 +95,7 @@
<file>src/mainview/components/SidePanel.qml</file>
<file>src/mainview/components/WelcomePage.qml</file>
<file>src/mainview/components/ChatView.qml</file>
<file>src/mainview/components/MessageWebViewHeader.qml</file>
<file>src/mainview/components/ChatViewHeader.qml</file>
<file>src/mainview/components/AccountComboBox.qml</file>
<file>src/mainview/components/CallStackView.qml</file>
<file>src/mainview/components/InitialCallPage.qml</file>
......
......@@ -272,8 +272,8 @@ Item {
// MessageWebView
property real chatViewHairLineSize: 1
property real messageWebViewHeaderPreferredHeight: 64
property real chatViewMaximumWidth: 900
property real chatViewHeaderPreferredHeight: 64
property real chatViewFooterPreferredHeight: 50
property real chatViewFooterMaximumHeight: 280
property real chatViewFooterRowSpacing: 1
......
......@@ -52,13 +52,13 @@ Rectangle {
spacing: 0
MessageWebViewHeader {
ChatViewHeader {
id: messageWebViewHeader
Layout.alignment: Qt.AlignHCenter
Layout.fillWidth: true
Layout.preferredHeight: JamiTheme.messageWebViewHeaderPreferredHeight
Layout.maximumHeight: JamiTheme.messageWebViewHeaderPreferredHeight
Layout.preferredHeight: JamiTheme.chatViewHeaderPreferredHeight
Layout.maximumHeight: JamiTheme.chatViewHeaderPreferredHeight
userAliasLabelText: headerUserAliasLabelText
userUserNameLabelText: headerUserUserNameLabelText
......
/*
* Copyright (C) 2020 by Savoir-faire Linux
* Author: Mingrui Zhang <mingrui.zhang@savoirfairelinux.com>
* Author: Sébastien Blin <sebastien.blin@savoirfairelinux.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
......@@ -82,9 +83,8 @@ Rectangle {
Layout.alignment: Qt.AlignLeft | Qt.AlignTop
// Width + margin.
Layout.preferredWidth: root.width
- backToWelcomeViewButton.width - buttonGroup.width - 45
Layout.fillHeight: true
Layout.fillWidth: true
Layout.topMargin: 7
Layout.bottomMargin: 7
Layout.leftMargin: 8
......@@ -130,12 +130,11 @@ Rectangle {
}
}
Item {
RowLayout {
id: buttonGroup
Layout.alignment: Qt.AlignRight | Qt.AlignVCenter
Layout.preferredWidth: childrenRect.width + 18
Layout.preferredHeight: childrenRect.height
Layout.fillWidth: true
Layout.rightMargin: 8
PushButton {
......@@ -143,10 +142,6 @@ Rectangle {
visible: interactionButtonsVisibility
anchors.right: startAVideoCallButton.left
anchors.rightMargin: 8
anchors.verticalCenter: buttonGroup.verticalCenter
source: JamiResources.place_audiocall_24dp_svg
toolTipText: JamiStrings.placeAudioCall
......@@ -161,13 +156,6 @@ Rectangle {
visible: interactionButtonsVisibility
anchors.right: selectPluginButton.visible ? selectPluginButton.left :
sendContactRequestButton.visible ?
sendContactRequestButton.left :
buttonGroup.right
anchors.rightMargin: 8
anchors.verticalCenter: buttonGroup.verticalCenter
source: JamiResources.videocam_24dp_svg
toolTipText: JamiStrings.placeVideoCall
......@@ -183,12 +171,6 @@ Rectangle {
visible: PluginAdapter.chatHandlersListCount &&
interactionButtonsVisibility
anchors.right: sendContactRequestButton.visible ?
sendContactRequestButton.left :
buttonGroup.right
anchors.rightMargin: sendContactRequestButton.visible ? 8 : 16
anchors.verticalCenter: buttonGroup.verticalCenter
source: JamiResources.plugins_24dp_svg
toolTipText: JamiStrings.showPlugins
......@@ -203,10 +185,6 @@ Rectangle {
visible: CurrentConversation.isTemporary
anchors.right: buttonGroup.right
anchors.rightMargin: 8
anchors.verticalCenter: buttonGroup.verticalCenter
source: JamiResources.add_people_24dp_svg
toolTipText: JamiStrings.addToConversations
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment