summaryrefslogtreecommitdiff
path: root/src/messagebox.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/messagebox.cc')
-rw-r--r--src/messagebox.cc20
1 files changed, 17 insertions, 3 deletions
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 <config.h>
#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;
}