Skip to content
Snippets Groups Projects
Commit cab0ccc7 authored by Sébastien Blin's avatar Sébastien Blin
Browse files

mainapplication: fix --minimized option

remove useless isFullscreen (visibility already stores this and
it's not possible to go from fullscreen to minimized anyway).
Also --minimized was ignored

GitLab: #413
Change-Id: I610f17ce7ae5b2852aae5b40dc504174fa657c2d
parent 6a7a8d0b
No related branches found
No related tags found
No related merge requests found
...@@ -47,10 +47,13 @@ ApplicationWindow { ...@@ -47,10 +47,13 @@ ApplicationWindow {
} }
property ApplicationWindow appWindow : root property ApplicationWindow appWindow : root
property bool isFullScreen: false
function toggleFullScreen() { function toggleFullScreen() {
isFullScreen = !isFullScreen if (visibility !== Window.FullScreen) {
showFullScreen()
} else {
showNormal()
}
} }
function checkLoadedSource() { function checkLoadedSource() {
...@@ -86,11 +89,6 @@ ApplicationWindow { ...@@ -86,11 +89,6 @@ ApplicationWindow {
hide() hide()
} }
visibility: !visible ?
Window.Hidden : (isFullScreen ?
Window.FullScreen :
Window.Windowed)
title: JamiStrings.appTitle title: JamiStrings.appTitle
width: { width: {
...@@ -150,6 +148,9 @@ ApplicationWindow { ...@@ -150,6 +148,9 @@ ApplicationWindow {
} }
onLoaded: { onLoaded: {
if (UtilsAdapter.getAppValue(Settings.StartMinimized)) {
showMinimized()
}
// Quiet check for updates on start if set to. // Quiet check for updates on start if set to.
if (UtilsAdapter.getAppValue(Settings.AutoUpdate)) { if (UtilsAdapter.getAppValue(Settings.AutoUpdate)) {
UpdateManager.checkForUpdates(true) UpdateManager.checkForUpdates(true)
...@@ -163,21 +164,16 @@ ApplicationWindow { ...@@ -163,21 +164,16 @@ ApplicationWindow {
function onRestoreAppRequested() { function onRestoreAppRequested() {
requestActivate() requestActivate()
if (isFullScreen) if (visibility === Window.Hidden || visibility === Window.Minimized) {
showFullScreen()
else
showNormal() showNormal()
}
} }
function onNotificationClicked() { function onNotificationClicked() {
requestActivate() requestActivate()
raise() raise()
if (visibility === Window.Hidden || if (visibility === Window.Hidden || visibility === Window.Minimized) {
visibility === Window.Minimized) { showNormal()
if (isFullScreen)
showFullScreen()
else
showNormal()
} }
} }
} }
......
...@@ -43,6 +43,7 @@ const QString defaultDownloadPath = QStandardPaths::writableLocation( ...@@ -43,6 +43,7 @@ const QString defaultDownloadPath = QStandardPaths::writableLocation(
X(DisplayHyperlinkPreviews, true) \ X(DisplayHyperlinkPreviews, true) \
X(EnableDarkTheme, false) \ X(EnableDarkTheme, false) \
X(AutoUpdate, true) \ X(AutoUpdate, true) \
X(StartMinimized, false) \
X(NeverShowMeAgain, false) X(NeverShowMeAgain, false)
/* /*
......
...@@ -247,6 +247,9 @@ MainApplication::init() ...@@ -247,6 +247,9 @@ MainApplication::init()
lrcInstance_->accountModel().autoTransferSizeThreshold = acceptTransferBelow; lrcInstance_->accountModel().autoTransferSizeThreshold = acceptTransferBelow;
initQmlLayer(); initQmlLayer();
settingsManager_->setValue(Settings::Key::StartMinimized, results[opts::STARTMINIMIZED].toBool());
initSystray(); initSystray();
return true; return true;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment