summaryrefslogtreecommitdiff
path: root/client/mainwindow.cc
diff options
context:
space:
mode:
Diffstat (limited to 'client/mainwindow.cc')
-rw-r--r--client/mainwindow.cc14
1 files changed, 9 insertions, 5 deletions
diff --git a/client/mainwindow.cc b/client/mainwindow.cc
index 08d68f9..57f1929 100644
--- a/client/mainwindow.cc
+++ b/client/mainwindow.cc
@@ -32,18 +32,22 @@
#include <QGridLayout>
-#include "videowidget.h"
#include "historywidget.h"
-// Macro for creating buttons
-static QPushButton *createButton(char* icon)
+#include <QX11Info>
+
+QPushButton *MainWindow::createButton(char* icon)
{
QPixmap pixmap(icon);
+ int w = (int)((double)x11Info().appDpiX() / 1.5);
+ int h = (int)((double)x11Info().appDpiY() / 1.5);
+
Qt::AspectRatioMode aspect = pixmap.width()<pixmap.height()?
Qt::KeepAspectRatio:Qt::KeepAspectRatioByExpanding;
- pixmap = pixmap.scaled(50, 50, aspect, Qt::SmoothTransformation);
+ pixmap = pixmap.scaled(w,h, aspect, Qt::SmoothTransformation);
+
QPushButton *btn = new QPushButton();
btn->setIconSize(pixmap.size());
btn->setIcon(pixmap);
@@ -71,7 +75,7 @@ MainWindow::MainWindow(): QWidget()
setLayout(layout);
// Create the videoarea
- VideoWidget *video = new VideoWidget();
+ video = new VideoWidget();
layout->addWidget(video, 0,0, 1,4);
// Create the control buttons