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 {
property var target
property int targetHeight
readonly property alias isCollapsed: collapse._collapsed
property bool _collapsed: false
property var _savedHeight
......
......@@ -16,7 +16,7 @@ import App.Styles 1.0
Controls1.ApplicationWindow {
id: window
property string _currentView: ''
property string _currentView
property var _lockedInfo
// ---------------------------------------------------------------------------
......@@ -84,15 +84,25 @@ Controls1.ApplicationWindow {
title: MainWindowStyle.title
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 {
id: container
anchors.fill: parent
spacing: 0
......@@ -149,12 +159,10 @@ Controls1.ApplicationWindow {
Text {
clip: true
font {
pointSize: MainWindowStyle.autoAnswerStatus.text.fontSize
}
color: MainWindowStyle.autoAnswerStatus.text.color
font.pointSize: MainWindowStyle.autoAnswerStatus.text.fontSize
text: qsTr('autoAnswerStatus')
width: parent.width
color: MainWindowStyle.autoAnswerStatus.text.color
}
}
......@@ -238,8 +246,6 @@ Controls1.ApplicationWindow {
Layout.fillHeight: true
Layout.fillWidth: true
Component.onCompleted: setView('Home')
}
}
}
......
......@@ -9,6 +9,27 @@ import App.Styles 1.0
// ============================================================================
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 {
background: Rectangle {
color: MainWindowMenuBarStyle.color
......
......@@ -7,6 +7,7 @@ import Common 1.0
QtObject {
property color color: Colors.v
property int height: 27
property QtObject menu: 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