diff --git a/client/main.cpp b/client/main.cpp index 342d568c..b489b6b1 100644 --- a/client/main.cpp +++ b/client/main.cpp @@ -80,8 +80,13 @@ int main(int argc, char *argv[]) app.setQuitOnLastWindowClosed(false); MainWindow mainWindow; + +#ifdef Q_OS_WIN if (parser.isSet("a")) mainWindow.showOnStartup(); else mainWindow.show(); +#else + mainWindow.showOnStartup(); +#endif if (app.isPrimary()) { QObject::connect(&app, &SingleApplication::instanceStarted, &mainWindow, [&](){ diff --git a/client/ui/mainwindow.cpp b/client/ui/mainwindow.cpp index cf97e5a7..75785bcf 100644 --- a/client/ui/mainwindow.cpp +++ b/client/ui/mainwindow.cpp @@ -71,7 +71,6 @@ MainWindow::MainWindow(QWidget *parent) : ui->stackedWidget_main->setSpeed(200); ui->stackedWidget_main->setAnimation(QEasingCurve::Linear); - bool needToHideCustomTitlebar = false; if (QOperatingSystemVersion::current() <= QOperatingSystemVersion::Windows7) { needToHideCustomTitlebar = true; } @@ -83,7 +82,7 @@ MainWindow::MainWindow(QWidget *parent) : if (needToHideCustomTitlebar) { ui->widget_tittlebar->hide(); - resize(width(), height() - ui->stackedWidget_main->y()); + resize(width(), 640); ui->stackedWidget_main->move(0,0); } @@ -164,11 +163,16 @@ MainWindow::~MainWindow() void MainWindow::showOnStartup() { if (! m_settings.isStartMinimized()) show(); + else { +#ifdef Q_OS_MACX + setDockIconVisible(false); +#endif + } } void MainWindow::goToPage(Page page, bool reset, bool slide) { - qDebug() << "goToPage" << page; + //qDebug() << "goToPage" << page; if (reset) { if (page == Page::ServerSettings) { updateServerPage(); @@ -356,6 +360,11 @@ void MainWindow::showEvent(QShowEvent *event) if (!event->spontaneous()) { setDockIconVisible(true); } + if (needToHideCustomTitlebar) { + ui->widget_tittlebar->hide(); + resize(width(), 640); + ui->stackedWidget_main->move(0,0); + } #endif } diff --git a/client/ui/mainwindow.h b/client/ui/mainwindow.h index 7b32aa9a..9f683499 100644 --- a/client/ui/mainwindow.h +++ b/client/ui/mainwindow.h @@ -141,6 +141,8 @@ private: bool canMove = false; QPoint offset; + bool needToHideCustomTitlebar = false; + bool eventFilter(QObject *obj, QEvent *event) override; void keyPressEvent(QKeyEvent* event) override; void closeEvent(QCloseEvent *event) override;