mirror of
https://gitlab.linphone.org/BC/public/linphone-desktop.git
synced 2026-02-07 15:08:24 +00:00
feat(ui/views/App/Main/MainWindow): remove isInitiallyIconified helper, set visibility directly with cpp
This commit is contained in:
parent
e34016033a
commit
363963959a
3 changed files with 19 additions and 23 deletions
|
|
@ -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()
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue