Commit b631f435 authored by Ronan Abhamon's avatar Ronan Abhamon

feat(ui/views/App/Main/MainWindow): hide menu bar when small view is displayed

parent 98f7f178
...@@ -15,6 +15,7 @@ Item { ...@@ -15,6 +15,7 @@ Item {
property var target property var target
property int targetHeight property int targetHeight
readonly property alias isCollapsed: collapse._collapsed
property bool _collapsed: false property bool _collapsed: false
property var _savedHeight property var _savedHeight
......
...@@ -16,7 +16,7 @@ import App.Styles 1.0 ...@@ -16,7 +16,7 @@ import App.Styles 1.0
Controls1.ApplicationWindow { Controls1.ApplicationWindow {
id: window id: window
property string _currentView: '' property string _currentView
property var _lockedInfo property var _lockedInfo
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
...@@ -84,15 +84,25 @@ Controls1.ApplicationWindow { ...@@ -84,15 +84,25 @@ Controls1.ApplicationWindow {
title: MainWindowStyle.title title: MainWindowStyle.title
visible: true visible: true
onActiveFocusItemChanged: activeFocusItem == null && smartSearchBar.hideMenu()
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
// Mernu bar. // Menu bar.
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
menuBar: MainWindowMenuBar {} menuBar: MainWindowMenuBar {
hide: !collapse.isCollapsed
}
// ---------------------------------------------------------------------------
Component.onCompleted: _setView('Home')
onActiveFocusItemChanged: activeFocusItem == null && smartSearchBar.hideMenu()
// ---------------------------------------------------------------------------
ColumnLayout { ColumnLayout {
id: container
anchors.fill: parent anchors.fill: parent
spacing: 0 spacing: 0
...@@ -149,12 +159,10 @@ Controls1.ApplicationWindow { ...@@ -149,12 +159,10 @@ Controls1.ApplicationWindow {
Text { Text {
clip: true clip: true
font { color: MainWindowStyle.autoAnswerStatus.text.color
pointSize: MainWindowStyle.autoAnswerStatus.text.fontSize font.pointSize: MainWindowStyle.autoAnswerStatus.text.fontSize
}
text: qsTr('autoAnswerStatus') text: qsTr('autoAnswerStatus')
width: parent.width width: parent.width
color: MainWindowStyle.autoAnswerStatus.text.color
} }
} }
...@@ -238,8 +246,6 @@ Controls1.ApplicationWindow { ...@@ -238,8 +246,6 @@ Controls1.ApplicationWindow {
Layout.fillHeight: true Layout.fillHeight: true
Layout.fillWidth: true Layout.fillWidth: true
Component.onCompleted: setView('Home')
} }
} }
} }
......
...@@ -9,6 +9,27 @@ import App.Styles 1.0 ...@@ -9,6 +9,27 @@ import App.Styles 1.0
// ============================================================================ // ============================================================================
MenuBar { MenuBar {
id: container
// --------------------------------------------------------------------------
property bool hide: false
// --------------------------------------------------------------------------
// Workaround to hide toolbar.
// Use private properties of MenuBar.
__contentItem.height: hide
? 0
: MainWindowMenuBarStyle.height
__contentItem.transform: Scale {
yScale: Number(!hide)
}
// --------------------------------------------------------------------------
style: MenuBarStyle { style: MenuBarStyle {
background: Rectangle { background: Rectangle {
color: MainWindowMenuBarStyle.color color: MainWindowMenuBarStyle.color
......
...@@ -7,6 +7,7 @@ import Common 1.0 ...@@ -7,6 +7,7 @@ import Common 1.0
QtObject { QtObject {
property color color: Colors.v property color color: Colors.v
property int height: 27
property QtObject menu: QtObject { property QtObject menu: QtObject {
property QtObject text: QtObject { property QtObject text: QtObject {
......
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