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