From 3ed6455c3166079d9b8fc1653b307b3c8349055d Mon Sep 17 00:00:00 2001 From: deva Date: Fri, 25 Nov 2005 21:52:29 +0000 Subject: *** empty log message *** --- src/messagebox.cc | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) (limited to 'src/messagebox.cc') diff --git a/src/messagebox.cc b/src/messagebox.cc index df0e813..fd812eb 100644 --- a/src/messagebox.cc +++ b/src/messagebox.cc @@ -27,6 +27,10 @@ #include #ifdef USE_GUI #include "messagebox.h" +#include "miav_config.h" + +// For button sizes! +#include "mainwindow.h" //////////////////////////////////////////////////////////////////////////////////////// /* If the cpr input by the user is not valid, this dialog @@ -41,6 +45,11 @@ MessageBox::MessageBox(QWidget* parent, msg_icon icon) : QDialog(parent, name, TRUE) { + int resolution_w = config->readInt("pixel_width"); + //int resolution_h = config->readInt("pixel_height"); + unit = ((float)resolution_w / config->readFloat("screensize")) / INCH_IN_CM; + + setCaption(name); QFrame *topf = new QFrame(this); topf->setFrameStyle(QFrame::Box | QFrame::Raised); @@ -99,7 +108,12 @@ MessageBox::MessageBox(QWidget* parent, QLabel *lbl_text = new QLabel(topf); lbl_text->setText(text); - lbl_text->setFont(QFont("Arial", 18)); + lbl_text->setFont( QFont( "Sans Serif", + //(height>1)?(int)(unit * height / 2):(int)(unit * height / 2), + (int)(unit * 0.7 * BUTTON_HEIGHT / 2), + QFont::Normal ) ); + lbl_text->setFixedHeight((int)(unit * BUTTON_HEIGHT)); + // lbl_text->setFont(QFont("Arial", 18)); QFrame *f = new QFrame(topf); QVBoxLayout *blayout = new QVBoxLayout(topf, 20, 20); @@ -198,8 +212,8 @@ QPushButton *MessageBox::createButton(QWidget *parent, const char *text) { QPushButton *q = new QPushButton(parent); q->setText(text); - q->setFont(QFont("Arial", 18)); - q->setFixedSize(200, 75); + q->setFont( QFont( "Sans Serif", (int)(unit * 0.7 * BUTTON_HEIGHT / 2 ), QFont::Normal ) ); + q->setFixedSize((int)(BUTTON_WIDTH * unit), (int)(BUTTON_HEIGHT * unit)); return q; } -- cgit v1.2.3