Set margin values on ui controls

This commit is contained in:
michal.szwaj 2018-03-14 17:45:03 +01:00
parent d483040d76
commit 3c1e65792f
2 changed files with 14 additions and 0 deletions

View File

@ -73,6 +73,10 @@ void SettingsWindow::onSave()
configuration_->setScreenDPI(static_cast<size_t>(ui_->horizontalSliderScreenDPI->value())); configuration_->setScreenDPI(static_cast<size_t>(ui_->horizontalSliderScreenDPI->value()));
configuration_->setOMXLayerIndex(ui_->spinBoxOmxLayerIndex->value()); configuration_->setOMXLayerIndex(ui_->spinBoxOmxLayerIndex->value());
QRect videoMargins(0, 0, ui_->spinBoxVideoMarginWidth->value(), ui_->spinBoxVideoMarginHeight->value());
configuration_->setVideoMargins(std::move(videoMargins));
configuration_->setTouchscreenEnabled(ui_->checkBoxEnableTouchscreen->isChecked()); configuration_->setTouchscreenEnabled(ui_->checkBoxEnableTouchscreen->isChecked());
this->saveButtonCheckBoxes(); this->saveButtonCheckBoxes();
@ -130,6 +134,10 @@ void SettingsWindow::load()
ui_->horizontalSliderScreenDPI->setValue(static_cast<int>(configuration_->getScreenDPI())); ui_->horizontalSliderScreenDPI->setValue(static_cast<int>(configuration_->getScreenDPI()));
ui_->spinBoxOmxLayerIndex->setValue(configuration_->getOMXLayerIndex()); ui_->spinBoxOmxLayerIndex->setValue(configuration_->getOMXLayerIndex());
const auto& videoMargins = configuration_->getVideoMargins();
ui_->spinBoxVideoMarginWidth->setValue(videoMargins.width());
ui_->spinBoxVideoMarginHeight->setValue(videoMargins.height());
ui_->checkBoxEnableTouchscreen->setChecked(configuration_->getTouchscreenEnabled()); ui_->checkBoxEnableTouchscreen->setChecked(configuration_->getTouchscreenEnabled());
this->loadButtonCheckBoxes(); this->loadButtonCheckBoxes();

View File

@ -343,6 +343,9 @@ color: rgb(238, 238, 236);</string>
<height>41</height> <height>41</height>
</rect> </rect>
</property> </property>
<property name="maximum">
<number>99999</number>
</property>
</widget> </widget>
<widget class="QLabel" name="labelVideoMarginHeight"> <widget class="QLabel" name="labelVideoMarginHeight">
<property name="geometry"> <property name="geometry">
@ -366,6 +369,9 @@ color: rgb(238, 238, 236);</string>
<height>41</height> <height>41</height>
</rect> </rect>
</property> </property>
<property name="maximum">
<number>99999</number>
</property>
</widget> </widget>
</widget> </widget>
<widget class="QGroupBox" name="groupBoxScreenDPI"> <widget class="QGroupBox" name="groupBoxScreenDPI">