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
......@@ -47,10 +47,13 @@ ApplicationWindow {
}
property ApplicationWindow appWindow : root
property bool isFullScreen: false
function toggleFullScreen() {
isFullScreen = !isFullScreen
if (visibility !== Window.FullScreen) {
showFullScreen()
} else {
showNormal()
}
}
function checkLoadedSource() {
......@@ -86,11 +89,6 @@ ApplicationWindow {
hide()
}
visibility: !visible ?
Window.Hidden : (isFullScreen ?
Window.FullScreen :
Window.Windowed)
title: JamiStrings.appTitle
width: {
......@@ -150,6 +148,9 @@ ApplicationWindow {
}
onLoaded: {
if (UtilsAdapter.getAppValue(Settings.StartMinimized)) {
showMinimized()
}
// Quiet check for updates on start if set to.
if (UtilsAdapter.getAppValue(Settings.AutoUpdate)) {
UpdateManager.checkForUpdates(true)
......@@ -163,21 +164,16 @@ ApplicationWindow {
function onRestoreAppRequested() {
requestActivate()
if (isFullScreen)
showFullScreen()
else
if (visibility === Window.Hidden || visibility === Window.Minimized) {
showNormal()
}
}
function onNotificationClicked() {
requestActivate()
raise()
if (visibility === Window.Hidden ||
visibility === Window.Minimized) {
if (isFullScreen)
showFullScreen()
else
showNormal()
if (visibility === Window.Hidden || visibility === Window.Minimized) {
showNormal()
}
}
}
......
......@@ -43,6 +43,7 @@ const QString defaultDownloadPath = QStandardPaths::writableLocation(
X(DisplayHyperlinkPreviews, true) \
X(EnableDarkTheme, false) \
X(AutoUpdate, true) \
X(StartMinimized, false) \
X(NeverShowMeAgain, false)
/*
......
......@@ -247,6 +247,9 @@ MainApplication::init()
lrcInstance_->accountModel().autoTransferSizeThreshold = acceptTransferBelow;
initQmlLayer();
settingsManager_->setValue(Settings::Key::StartMinimized, results[opts::STARTMINIMIZED].toBool());
initSystray();
return true;
......
Supports Markdown
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