summaryrefslogtreecommitdiff
path: root/client/mainwindow.cc
diff options
context:
space:
mode:
authordeva <deva>2006-03-16 16:31:09 +0000
committerdeva <deva>2006-03-16 16:31:09 +0000
commit9553f7078a275b7c9aa1c9b7a8a0f1f4d38eea9d (patch)
tree25a572f4c6ba62eebf81c7ba633a7ef6e1ce74a5 /client/mainwindow.cc
parente8be1dfe0b9eb6fd69431184b94f82fc605388e4 (diff)
*** empty log message ***
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