Commit 36396395 authored by Ronan Abhamon's avatar Ronan Abhamon

feat(ui/views/App/Main/MainWindow): remove `isInitiallyIconified` helper, set...

feat(ui/views/App/Main/MainWindow): remove `isInitiallyIconified` helper, set visibility directly with cpp
parent e3401603
......@@ -146,13 +146,11 @@ void App::initContentApp () {
#endif // ifndef __APPLE__
if (m_parser.isSet("selftest")) {
QTimer::singleShot(300, this, &App::quit);
}
}
if (!m_parser.isSet("iconified"))
getMainWindow()->setVisible(true);
bool App::isInitiallyIconified () const {
return m_parser.isSet("iconified");
if (m_parser.isSet("selftest"))
QTimer::singleShot(300, this, &App::quit);
}
// -----------------------------------------------------------------------------
......@@ -163,9 +161,9 @@ void App::parseArgs () {
m_parser.addVersionOption();
m_parser.addOptions({
{ "config", tr("commandLineOptionConfig"), "file" },
#ifndef __APPLE__
{ "iconified", tr("commandLineOptionIconified") },
#endif // __APPLE__
#ifndef __APPLE__
{ "iconified", tr("commandLineOptionIconified") },
#endif // __APPLE__
{ "selftest", tr("commandLineOptionSelftest") },
{ { "V", "verbose" }, tr("commandLineOptionVerbose") }
});
......
......@@ -54,11 +54,9 @@ public:
bool hasFocus () const;
Q_INVOKABLE QQuickWindow *getSettingsWindow () const;
void initContentApp ();
Q_INVOKABLE bool isInitiallyIconified () const;
Q_INVOKABLE QQuickWindow *getSettingsWindow () const;
Q_INVOKABLE QString locale () const {
return m_locale;
......
......@@ -65,6 +65,14 @@ Controls1.ApplicationWindow {
}
}
function _forceView (view, props) {
collapse.setCollapsed(true)
_updateSelectedEntry(view, props)
_currentView = view
contentLoader.setSource(view + '.qml', props || {})
}
function _setView (view, props) {
if (window.visibility === Window.Minimized) {
window.visibility = Window.AutomaticVisibility
......@@ -72,12 +80,7 @@ Controls1.ApplicationWindow {
window.setVisible(true)
}
window.requestActivate()
collapse.setCollapsed(true)
_updateSelectedEntry(view, props)
_currentView = view
contentLoader.setSource(view + '.qml', props || {})
_forceView()
}
// ---------------------------------------------------------------------------
......@@ -91,7 +94,7 @@ Controls1.ApplicationWindow {
width: MainWindowStyle.width
title: MainWindowStyle.title
visible: true
visible: false
// ---------------------------------------------------------------------------
// Menu bar.
......@@ -104,10 +107,7 @@ Controls1.ApplicationWindow {
// ---------------------------------------------------------------------------
Component.onCompleted: Utils.setTimeout(window, 0, function () {
_setView('Home')
if (App.isInitiallyIconified()) {
window.hide()
}
_forceView('Home')
})
onActiveFocusItemChanged: activeFocusItem == null && smartSearchBar.hideMenu()
......
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