Skip to content

Commit

Permalink
Add --minimized CLI option
Browse files Browse the repository at this point in the history
  • Loading branch information
outfoxxed committed Jan 23, 2025
1 parent 4d7eae3 commit 3472057
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ int main(int argc, char** argv)
QCommandLineOption pwstdinOption("pw-stdin", QObject::tr("read password of the database from stdin"));
QCommandLineOption allowScreenCaptureOption("allow-screencapture",
QObject::tr("allow screenshots and app recording (Windows/macOS)"));
QCommandLineOption startMinimized("minimized", QObject::tr("start minimized to the system tray"));

QCommandLineOption helpOption = parser.addHelpOption();
QCommandLineOption versionOption = parser.addVersionOption();
Expand All @@ -95,6 +96,7 @@ int main(int argc, char** argv)
parser.addOption(pwstdinOption);
parser.addOption(debugInfoOption);
parser.addOption(allowScreenCaptureOption);
parser.addOption(startMinimized);

parser.process(app);

Expand Down Expand Up @@ -207,7 +209,7 @@ int main(int argc, char** argv)
}

// start minimized if configured
if (config()->get(Config::GUI_MinimizeOnStartup).toBool()) {
if (parser.isSet(startMinimized) || config()->get(Config::GUI_MinimizeOnStartup).toBool()) {
mainWindow.hideWindow();
} else {
mainWindow.bringToFront();
Expand Down

0 comments on commit 3472057

Please # to comment.