mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-07-26 16:25:23 -04:00
Remove GUI bootstraping from core/ (#5513)
This commit is contained in:
parent
fb87b1c794
commit
48d9fb3e79
12 changed files with 83 additions and 82 deletions
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
* Copyright (C) 2012 Tobias Tangemann
|
||||
* Copyright (C) 2012 Felix Geyer <debfx@fobos.de>
|
||||
* Copyright (C) 2017 KeePassXC Team <team@keepassxc.org>
|
||||
* Copyright (C) 2020 KeePassXC Team <team@keepassxc.org>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -20,9 +20,11 @@
|
|||
#include "Application.h"
|
||||
|
||||
#include "autotype/AutoType.h"
|
||||
#include "core/Bootstrap.h"
|
||||
#include "core/Config.h"
|
||||
#include "core/Global.h"
|
||||
#include "gui/MainWindow.h"
|
||||
#include "gui/MessageBox.h"
|
||||
#include "gui/osutils/OSUtils.h"
|
||||
#include "gui/styles/dark/DarkStyle.h"
|
||||
#include "gui/styles/light/LightStyle.h"
|
||||
|
@ -142,6 +144,30 @@ Application::~Application()
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Perform early application bootstrapping such as setting up search paths,
|
||||
* configuration OS security properties, and loading translators.
|
||||
* A QApplication object has to be instantiated before calling this function.
|
||||
*/
|
||||
void Application::bootstrap()
|
||||
{
|
||||
Bootstrap::bootstrap();
|
||||
|
||||
#ifdef Q_OS_WIN
|
||||
// Qt on Windows uses "MS Shell Dlg 2" as the default font for many widgets, which resolves
|
||||
// to Tahoma 8pt, whereas the correct font would be "Segoe UI" 9pt.
|
||||
// Apparently, some widgets are already using the correct font. Thanks, MuseScore for this neat fix!
|
||||
QApplication::setFont(QApplication::font("QMessageBox"));
|
||||
#endif
|
||||
|
||||
MessageBox::initializeButtonDefs();
|
||||
|
||||
#ifdef Q_OS_MACOS
|
||||
// Don't show menu icons on OSX
|
||||
QApplication::setAttribute(Qt::AA_DontShowIconsInMenus);
|
||||
#endif
|
||||
}
|
||||
|
||||
void Application::applyTheme()
|
||||
{
|
||||
auto appTheme = config()->get(Config::GUI_ApplicationTheme).toString();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue