From 148b1dacce539121cc212b48a251f3c866adfdfc Mon Sep 17 00:00:00 2001 From: leetthewire Date: Sat, 26 Jun 2021 23:09:48 +0000 Subject: [PATCH] fixed UI for linux Signed-off-by: leetthewire --- client/3rd/QRCodeGenerator/QRCodeGenerator.cpp | 1 + client/ui/Controls/SlidingStackedWidget.cpp | 2 +- client/ui/framelesswindow.h | 2 +- client/ui/mainwindow.cpp | 12 ++++++------ client/ui/qautostart.cpp | 2 +- 5 files changed, 10 insertions(+), 9 deletions(-) diff --git a/client/3rd/QRCodeGenerator/QRCodeGenerator.cpp b/client/3rd/QRCodeGenerator/QRCodeGenerator.cpp index 4ae08955..1360099b 100644 --- a/client/3rd/QRCodeGenerator/QRCodeGenerator.cpp +++ b/client/3rd/QRCodeGenerator/QRCodeGenerator.cpp @@ -2,6 +2,7 @@ #include #include +#include //for strlen on linux #ifdef _DEBUG #define new DEBUG_NEW diff --git a/client/ui/Controls/SlidingStackedWidget.cpp b/client/ui/Controls/SlidingStackedWidget.cpp index dd64197d..f0ee14cd 100644 --- a/client/ui/Controls/SlidingStackedWidget.cpp +++ b/client/ui/Controls/SlidingStackedWidget.cpp @@ -95,7 +95,7 @@ void SlidingStackedWidget::slideInWidget(QWidget *widget, SlidingStackedWidget:: slideInIdx(idx, direction); #endif -#ifdef Q_OS_MAC +#if defined Q_OS_MAC || defined Q_OS_LINUX setCurrentWidget(widget); #endif } diff --git a/client/ui/framelesswindow.h b/client/ui/framelesswindow.h index ca8a69f6..ac560231 100644 --- a/client/ui/framelesswindow.h +++ b/client/ui/framelesswindow.h @@ -69,7 +69,7 @@ private: bool m_bResizeable; }; -#elif defined Q_OS_MAC +#elif defined Q_OS_MAC || defined Q_OS_LINUX #include #include #include diff --git a/client/ui/mainwindow.cpp b/client/ui/mainwindow.cpp index b0e61e89..e4d5b2b3 100644 --- a/client/ui/mainwindow.cpp +++ b/client/ui/mainwindow.cpp @@ -40,7 +40,7 @@ #include "ui/server_widget.h" #include "ui_server_widget.h" -#ifdef Q_OS_MAC +#if defined Q_OS_MAC || defined Q_OS_LINUX #include "ui/macos_util.h" #endif @@ -91,7 +91,7 @@ MainWindow::MainWindow(QWidget *parent) : needToHideCustomTitlebar = true; } -#ifdef Q_OS_MAC +#if defined Q_OS_MAC fixWidget(this); needToHideCustomTitlebar = true; #endif @@ -178,7 +178,7 @@ void MainWindow::showOnStartup() { if (! m_settings.isStartMinimized()) show(); else { -#ifdef Q_OS_MACX +#if defined Q_OS_MACX setDockIconVisible(false); #endif } @@ -411,7 +411,7 @@ void MainWindow::closeEvent(QCloseEvent *event) void MainWindow::showEvent(QShowEvent *event) { -#ifdef Q_OS_MACX +#if defined Q_OS_MACX if (!event->spontaneous()) { setDockIconVisible(true); } @@ -425,7 +425,7 @@ void MainWindow::showEvent(QShowEvent *event) void MainWindow::hideEvent(QHideEvent *event) { -#ifdef Q_OS_MACX +#if defined Q_OS_MACX if (!event->spontaneous()) { setDockIconVisible(false); } @@ -1754,7 +1754,7 @@ void MainWindow::setTrayState(VpnProtocol::ConnectionState state) void MainWindow::onTrayActivated(QSystemTrayIcon::ActivationReason reason) { -#ifndef Q_OS_MAC +#if defined Q_OS_MACX || defined Q_OS_LINUX if(reason == QSystemTrayIcon::DoubleClick || reason == QSystemTrayIcon::Trigger) { show(); raise(); diff --git a/client/ui/qautostart.cpp b/client/ui/qautostart.cpp index fa93bb77..58b90f85 100644 --- a/client/ui/qautostart.cpp +++ b/client/ui/qautostart.cpp @@ -58,7 +58,7 @@ QString Autostart::appPath() { return QCoreApplication::applicationFilePath() + " --autostart"; } -#elif defined (Q_OS_MAC) +#elif defined Q_OS_MAC || defined Q_OS_LINUX bool Autostart::isAutostart() { QProcess process;