From d5da69b6ed984df4c60c3a7abfa8119db34eab2b Mon Sep 17 00:00:00 2001 From: deva Date: Tue, 2 May 2006 20:19:39 +0000 Subject: *** empty log message *** --- client/mainwindow.cc | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'client') diff --git a/client/mainwindow.cc b/client/mainwindow.cc index 982388b..645fef4 100644 --- a/client/mainwindow.cc +++ b/client/mainwindow.cc @@ -43,23 +43,25 @@ #include #include "svgloader.h" -#define CAIRO_SVG +//#define CAIRO_SVG QPixmap MainWindow::loadIcon(char* fname) { QSvgRenderer svgrenderer; QPainter painter; - int w = (int)((double)x11Info().appDpiX() / 1.5); - int h = (int)((double)x11Info().appDpiY() / 1.5); + int dpix = x11Info().appDpiX(); + int dpiy = x11Info().appDpiY(); + + printf("DpiX: %d DpiY: %d\n", dpix, dpiy); #ifdef CAIRO_SVG QPixmap pixmap; - SVGLoader cairo; + SVGLoader svg; QString filename = fname; filename.append(".svg"); - w = h; - pixmap = QPixmap::fromImage(cairo.load(filename, 0, 0, 0.1, 0.1)); + double dpi = (double)(dpix + dpiy) / 2.0; + pixmap = QPixmap::fromImage(svg.load(filename, 0, 0, 12.0 / dpi, 12.0 / dpi)); return pixmap; #else/*CAIRO_SVG*/ #ifdef QT_SVG @@ -72,10 +74,12 @@ QPixmap MainWindow::loadIcon(char* fname) return pixmap; #else/*QT_SVG*/ // Load as png - QPixmap pixmap(fname".png"); + QString filename = fname; + filename.append(".png"); + QPixmap pixmap(filename); Qt::AspectRatioMode aspect = pixmap.width()