popup layot

- center position
- resizable
This commit is contained in:
stojce 2013-09-09 23:27:03 +02:00
parent 29c62d366f
commit a081f081f8
2 changed files with 15 additions and 2 deletions

View file

@ -1,4 +1,5 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<div style="width: 780px; margin: 0 auto;">
<input type="hidden" id="version" value="1" />
<svg width="780px" height="754px" viewBox="0 0 780 754" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:sketch="http://www.bohemiancoding.com/sketch/ns">
<title>Welcome to Interface</title>
@ -135,3 +136,4 @@
</g>
</g>
</svg>
<div>

View file

@ -12,6 +12,7 @@
#include <QtWebKitWidgets/QWebFrame>
#include <QtWebKit/QWebElement>
#include <QDesktopWidget>
#define VIEW_FIXED_WIDTH 808
#define SETTINGS_KEY_VERSION "info-version"
@ -52,8 +53,18 @@ void InfoView::loaded(bool ok)
settings->setValue(SETTINGS_KEY_VERSION, version);
}
this->setWindowModality(Qt::WindowModal);
this->setFixedSize(VIEW_FIXED_WIDTH, this->height());
QDesktopWidget* desktop = Application::getInstance()->desktop();
int h = desktop->height();
this->resize(VIEW_FIXED_WIDTH, h * 0.8);
int w = desktop->width();
int mw = this->size().width();
int mh = this->size().height();
int cw = (w/2) - (mw/2);
int ch = (h/2) - (mh/2);
this->move(cw, ch);
this->setWindowTitle(this->title());
this->show();
}