30 :
31 QDialog(parent),
32 ui(
new Ui::KisDlgCustomTabletResolution)
33{
35 KGuiItem::assign(
ui->btnBox->button(QDialogButtonBox::Ok), KStandardGuiItem::ok());
36 KGuiItem::assign(
ui->btnBox->button(QDialogButtonBox::Cancel), KStandardGuiItem::cancel());
37 connect(
ui->btnBox, SIGNAL(rejected()),
this, SLOT(reject()));
39
40 connect(
ui->radioCustomMapping, SIGNAL(toggled(
bool)),
ui->lblXOffset, SLOT(setEnabled(
bool)));
41 connect(
ui->radioCustomMapping, SIGNAL(toggled(
bool)),
ui->lblYOffset, SLOT(setEnabled(
bool)));
42 connect(
ui->radioCustomMapping, SIGNAL(toggled(
bool)),
ui->lblWidth, SLOT(setEnabled(
bool)));
43 connect(
ui->radioCustomMapping, SIGNAL(toggled(
bool)),
ui->lblHeight, SLOT(setEnabled(
bool)));
44
45 connect(
ui->radioCustomMapping, SIGNAL(toggled(
bool)),
ui->intXOffset, SLOT(setEnabled(
bool)));
46 connect(
ui->radioCustomMapping, SIGNAL(toggled(
bool)),
ui->intYOffset, SLOT(setEnabled(
bool)));
47 connect(
ui->radioCustomMapping, SIGNAL(toggled(
bool)),
ui->intWidth, SLOT(setEnabled(
bool)));
48 connect(
ui->radioCustomMapping, SIGNAL(toggled(
bool)),
ui->intHeight, SLOT(setEnabled(
bool)));
49
51
52 ui->radioMapToEntireScreen->setText(i18nc(
"@option:radio",
"Map to entire virtual screen (%1)", rectToString(virtualScreenRect)));
53
54 QRect nativeScreenRect;
55 QPlatformScreen *screen = qGuiApp->primaryScreen()->handle();
56 Q_FOREACH (QPlatformScreen *scr, screen->virtualSiblings()) {
57 nativeScreenRect |= scr->geometry();
58 }
59
60 QRect customScreenRect = virtualScreenRect;
62
64 ui->radioCustomMapping->setChecked(
true);
66 ui->radioMapToEntireScreen->setChecked(
true);
67 } else {
68 ui->radioMapAsWintab->setChecked(
true);
69 }
70
71 ui->intXOffset->setValue(customScreenRect.x());
72 ui->intYOffset->setValue(customScreenRect.y());
73 ui->intWidth->setValue(customScreenRect.width());
74 ui->intHeight->setValue(customScreenRect.height());
75}
connect(this, SIGNAL(optionsChanged()), this, SLOT(saveOptions()))
static Mode getTabletMode(QRect *customRect)
Ui::KisDlgCustomTabletResolution * ui
static QRect calcNativeScreenRect()