summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--client/Dialog.cpp8
-rw-r--r--client/Dialog.h3
-rw-r--r--client/ProxyClientApp.cpp7
3 files changed, 11 insertions, 7 deletions
diff --git a/client/Dialog.cpp b/client/Dialog.cpp
index c9b9956..e996add 100644
--- a/client/Dialog.cpp
+++ b/client/Dialog.cpp
@@ -118,6 +118,14 @@ ProxyDialog::ProxyDialog(QWidget *parent): QDialog(parent, Qt::Popup)
setLayout(mainLayout);
}
+void ProxyDialog::resizeEvent(QResizeEvent* event)
+{
+ QRect availScreenRect = QApplication::desktop()->availableGeometry();
+ this->move(availScreenRect.width() - this->frameSize().width(),
+ availScreenRect.height() - this->frameSize().height());
+}
+
+
void ProxyDialog::Closed(int i)
{
Logger::Trace("Dialog closed\n");
diff --git a/client/Dialog.h b/client/Dialog.h
index 78d273b..2c07747 100644
--- a/client/Dialog.h
+++ b/client/Dialog.h
@@ -25,6 +25,9 @@ public:
*/
ProxyDialog(QWidget *parent = 0);
+protected:
+ void resizeEvent(QResizeEvent* event);
+
private slots:
void Closed(int i);
void ProxyToggled(bool on);
diff --git a/client/ProxyClientApp.cpp b/client/ProxyClientApp.cpp
index b55c33c..0ba813c 100644
--- a/client/ProxyClientApp.cpp
+++ b/client/ProxyClientApp.cpp
@@ -81,15 +81,8 @@ void ProxyClientApp::trayActivated(QSystemTrayIcon::ActivationReason reason)
void ProxyClientApp::showProxyDialog()
{
Logger::Trace("Creating proxy dialog.\n");
- QDesktopWidget* screen = QApplication::desktop();
- QRect availScreenRect = screen->availableGeometry();
-
- Logger::Debug("Available screen size WxH = %d x %d\n", availScreenRect.width(), availScreenRect.height());
-
ProxyDialog *dialog = new ProxyDialog();
dialog->show();
- dialog->move(availScreenRect.width() - dialog->frameSize().width(),
- availScreenRect.height() - dialog->frameSize().height());
}
void ProxyClientApp::configUpdated()