Commit a1184fe1 authored by Ronan Abhamon's avatar Ronan Abhamon

feat(app): reuse last Window component in `MainWindow` AND USE A WORKAROUND TO...

feat(app): reuse last Window component in `MainWindow` AND USE A WORKAROUND TO DEAL WITH A FILE STYLE BULLSHIT on `Chat` component
parent e1d7b7bf
......@@ -303,7 +303,6 @@
<file>ui/views/App/Main/Contacts.qml</file>
<file>ui/views/App/Main/Conversation.qml</file>
<file>ui/views/App/Main/Home.qml</file>
<file>ui/views/App/Main/MainWindowMenuBar.qml</file>
<file>ui/views/App/Main/MainWindow.qml</file>
<file>ui/views/App/ManageAccounts.qml</file>
<file>ui/views/App/qmldir</file>
......
......@@ -12,6 +12,12 @@ import Utils 1.0
ColumnLayout {
property alias proxyModel: chat.model
// Unable to use it in style file at this moment.
// A `TypeError: Cannot read property 'XXX' of undefined` is launched for many properties
// in the style file otherwise.
// Seems related to: https://bugreports.qt.io/browse/QTBUG-58648
property color _backgroundColor: 'white'
property bool _bindToEnd: false
property var _contactObserver: SipAddressesModel.getContactObserver(proxyModel.sipAddress)
......@@ -25,7 +31,7 @@ ColumnLayout {
Rectangle {
anchors.fill: parent
color: ChatStyle.color
color: _backgroundColor
}
ScrollableListView {
......@@ -176,7 +182,7 @@ ColumnLayout {
ChatStyle.entry.message.extraContent.leftMargin +
ChatStyle.entry.message.outgoing.sendIconSize
}
color: ChatStyle.color
color: _backgroundColor
implicitHeight: layout.height + ChatStyle.entry.bottomMargin
// -----------------------------------------------------------------------
......
......@@ -6,8 +6,6 @@ import Common 1.0
// =============================================================================
QtObject {
property color color: Colors.k
property QtObject sectionHeading: QtObject {
property int padding: 5
property int bottomMargin: 20
......
......@@ -2,8 +2,6 @@ import QtQuick 2.7
import QtQuick.Controls 2.0
import QtQuick.Layouts 1.3
import QtQuick.Controls 1.4 as Controls1
import Common 1.0
import Linphone 1.0
import Utils 1.0
......@@ -12,7 +10,7 @@ import App.Styles 1.0
// =============================================================================
Controls1.ApplicationWindow {
ApplicationWindow {
id: window
property string _currentView: ''
......@@ -64,7 +62,7 @@ Controls1.ApplicationWindow {
}
function _setView (view, props) {
window.setVisible(true)
window.show()
window.requestActivate()
collapse.setCollapsed(true)
......@@ -86,24 +84,12 @@ Controls1.ApplicationWindow {
onActiveFocusItemChanged: activeFocusItem == null && smartSearchBar.hideMenu()
// ---------------------------------------------------------------------------
// Menu bar.
// ---------------------------------------------------------------------------
menuBar: MainWindowMenuBar {}
ColumnLayout {
anchors.fill: parent
spacing: 0
// -------------------------------------------------------------------------
// Toolbar properties.
// -------------------------------------------------------------------------
// ---------------------------------------------------------------------------
ToolBar {
header: ToolBar {
background: MainWindowStyle.toolBar.background
Layout.preferredHeight: MainWindowStyle.toolBar.height
Layout.fillWidth: true
height: MainWindowStyle.toolBar.height
RowLayout {
anchors {
......@@ -185,14 +171,12 @@ Controls1.ApplicationWindow {
}
}
// -------------------------------------------------------------------------
// ---------------------------------------------------------------------------
// Content.
// -------------------------------------------------------------------------
// ---------------------------------------------------------------------------
RowLayout {
Layout.fillHeight: true
Layout.fillWidth: true
anchors.fill: parent
spacing: 0
// Main menu.
......@@ -241,5 +225,4 @@ Controls1.ApplicationWindow {
Component.onCompleted: setView('Home')
}
}
}
}
import QtQuick.Controls 1.4
MenuBar {
Menu {
title: "File"
MenuItem { text: "Open..." }
MenuItem { text: "Close" }
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment