Merge pull request #22 from amnezia-vpn/linux_ui_fix
fixed UI for linux
This commit is contained in:
commit
e45c7507f9
5 changed files with 10 additions and 9 deletions
|
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
#include <string.h> //for strlen on linux
|
||||||
|
|
||||||
#ifdef _DEBUG
|
#ifdef _DEBUG
|
||||||
#define new DEBUG_NEW
|
#define new DEBUG_NEW
|
||||||
|
|
|
||||||
|
|
@ -95,7 +95,7 @@ void SlidingStackedWidget::slideInWidget(QWidget *widget, SlidingStackedWidget::
|
||||||
slideInIdx(idx, direction);
|
slideInIdx(idx, direction);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef Q_OS_MAC
|
#if defined Q_OS_MAC || defined Q_OS_LINUX
|
||||||
setCurrentWidget(widget);
|
setCurrentWidget(widget);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -69,7 +69,7 @@ private:
|
||||||
bool m_bResizeable;
|
bool m_bResizeable;
|
||||||
};
|
};
|
||||||
|
|
||||||
#elif defined Q_OS_MAC
|
#elif defined Q_OS_MAC || defined Q_OS_LINUX
|
||||||
#include <QMouseEvent>
|
#include <QMouseEvent>
|
||||||
#include <QResizeEvent>
|
#include <QResizeEvent>
|
||||||
#include <QPoint>
|
#include <QPoint>
|
||||||
|
|
|
||||||
|
|
@ -40,7 +40,7 @@
|
||||||
#include "ui/server_widget.h"
|
#include "ui/server_widget.h"
|
||||||
#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"
|
#include "ui/macos_util.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
@ -91,7 +91,7 @@ MainWindow::MainWindow(QWidget *parent) :
|
||||||
needToHideCustomTitlebar = true;
|
needToHideCustomTitlebar = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef Q_OS_MAC
|
#if defined Q_OS_MAC
|
||||||
fixWidget(this);
|
fixWidget(this);
|
||||||
needToHideCustomTitlebar = true;
|
needToHideCustomTitlebar = true;
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -178,7 +178,7 @@ void MainWindow::showOnStartup()
|
||||||
{
|
{
|
||||||
if (! m_settings.isStartMinimized()) show();
|
if (! m_settings.isStartMinimized()) show();
|
||||||
else {
|
else {
|
||||||
#ifdef Q_OS_MACX
|
#if defined Q_OS_MACX
|
||||||
setDockIconVisible(false);
|
setDockIconVisible(false);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
@ -411,7 +411,7 @@ void MainWindow::closeEvent(QCloseEvent *event)
|
||||||
|
|
||||||
void MainWindow::showEvent(QShowEvent *event)
|
void MainWindow::showEvent(QShowEvent *event)
|
||||||
{
|
{
|
||||||
#ifdef Q_OS_MACX
|
#if defined Q_OS_MACX
|
||||||
if (!event->spontaneous()) {
|
if (!event->spontaneous()) {
|
||||||
setDockIconVisible(true);
|
setDockIconVisible(true);
|
||||||
}
|
}
|
||||||
|
|
@ -425,7 +425,7 @@ void MainWindow::showEvent(QShowEvent *event)
|
||||||
|
|
||||||
void MainWindow::hideEvent(QHideEvent *event)
|
void MainWindow::hideEvent(QHideEvent *event)
|
||||||
{
|
{
|
||||||
#ifdef Q_OS_MACX
|
#if defined Q_OS_MACX
|
||||||
if (!event->spontaneous()) {
|
if (!event->spontaneous()) {
|
||||||
setDockIconVisible(false);
|
setDockIconVisible(false);
|
||||||
}
|
}
|
||||||
|
|
@ -1754,7 +1754,7 @@ void MainWindow::setTrayState(VpnProtocol::ConnectionState state)
|
||||||
|
|
||||||
void MainWindow::onTrayActivated(QSystemTrayIcon::ActivationReason reason)
|
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) {
|
if(reason == QSystemTrayIcon::DoubleClick || reason == QSystemTrayIcon::Trigger) {
|
||||||
show();
|
show();
|
||||||
raise();
|
raise();
|
||||||
|
|
|
||||||
|
|
@ -58,7 +58,7 @@ QString Autostart::appPath() {
|
||||||
return QCoreApplication::applicationFilePath() + " --autostart";
|
return QCoreApplication::applicationFilePath() + " --autostart";
|
||||||
}
|
}
|
||||||
|
|
||||||
#elif defined (Q_OS_MAC)
|
#elif defined Q_OS_MAC || defined Q_OS_LINUX
|
||||||
|
|
||||||
bool Autostart::isAutostart() {
|
bool Autostart::isAutostart() {
|
||||||
QProcess process;
|
QProcess process;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue