UI: Move setupAppStyle() back to main.cpp

This commit is contained in:
Nodir Temirkhodjaev 2021-04-07 11:43:13 +03:00
parent 2679c82275
commit 33a33029de
3 changed files with 11 additions and 14 deletions

View File

@ -6,8 +6,6 @@
#include <QMessageBox>
#include <QMouseEvent>
#include <QProcess>
#include <QStyle>
#include <QStyleFactory>
#include <QSystemTrayIcon>
#include <QThreadPool>
#include <QTimer>
@ -112,8 +110,6 @@ void FortManager::initialize()
m_connListModel = new ConnListModel(m_statManager, this);
}
setupAppStyle();
setupTranslationManager();
setupThreadPool();
@ -745,14 +741,6 @@ void FortManager::saveTrayFlags()
saveConf(conf(), true);
}
void FortManager::setupAppStyle()
{
// Style & Palette
const auto fusionStyle = QStyleFactory::create("Fusion");
QApplication::setStyle(fusionStyle);
QApplication::setPalette(fusionStyle->standardPalette());
}
void FortManager::saveProgWindowState()
{
settings()->setProgWindowGeometry(m_progWindowState->geometry());

View File

@ -131,8 +131,6 @@ private slots:
void saveTrayFlags();
private:
void setupAppStyle();
void setupTranslationManager();
void setupThreadPool();

View File

@ -1,5 +1,7 @@
#include <QApplication>
#include <QMessageBox>
#include <QStyle>
#include <QStyleFactory>
#ifdef USE_VISUAL_LEAK_DETECTOR
# include <vld.h>
@ -19,6 +21,13 @@
#define FORT_ERROR_INSTANCE 1
#define FORT_ERROR_CONTROL 2
static void setupAppStyle()
{
const auto fusionStyle = QStyleFactory::create("Fusion");
QApplication::setStyle(fusionStyle);
QApplication::setPalette(fusionStyle->standardPalette());
}
int main(int argc, char *argv[])
{
// Uninstall: Unregister booted provider, startup entries and exit
@ -67,6 +76,8 @@ int main(int argc, char *argv[])
if (settings.isService()) {
ServiceManager::runService();
} else {
setupAppStyle(); // Style & Palette
fortManager.show();
}