xwhatsit util: fix code that handles minimum window size
authorPurdea Andrei <andrei@purdea.ro>
Sun, 26 Jul 2020 17:21:38 +0000 (20:21 +0300)
committerPurdea Andrei <andrei@purdea.ro>
Sun, 26 Jul 2020 17:24:03 +0000 (20:24 +0300)
keyboards/xwhatsit/util/util/monitorwindow.cpp
keyboards/xwhatsit/util/util/signal_level.cpp

index bcb7361..64f7169 100644 (file)
@@ -63,8 +63,7 @@ void MonitorWindow::setMinimumSizeUnits(unsigned int width_units_times_8, unsign
 {
     HORIZONTAL_MARGIN = ui->label_keyboardname->pos().x();
     VERTICAL_MARGIN = ui->label_keyboardname->pos().x();
-    this->setMinimumSize(std::max(ui->layoutSel->width() + ui->layoutSel->x() * 2,
-                                  static_cast<int>(width_units_times_8 * MIN_HORIZONTAL_SCALE / 8 + 2 * HORIZONTAL_MARGIN)),
+    this->setMinimumSize(static_cast<int>(width_units_times_8 * MIN_HORIZONTAL_SCALE / 8 + 2 * HORIZONTAL_MARGIN),
                          ui->last_label->geometry().y() + ui->last_label->geometry().height() +
                              static_cast<int>(height_units_times_8 * MIN_VERTICAL_SCALE / 8 + 2 * VERTICAL_MARGIN));
 }
index 58c1c03..25b643c 100644 (file)
@@ -62,8 +62,7 @@ void SignalLevelMonitorWindow::setMinimumSizeUnits(unsigned int width_units_time
 {
     HORIZONTAL_MARGIN = ui->label_keyboardname->pos().x();
     VERTICAL_MARGIN = ui->label_keyboardname->pos().x();
-    this->setMinimumSize(std::max(ui->layoutSel->width() + ui->layoutSel->x() * 2,
-                                  static_cast<int>(width_units_times_8 * MIN_HORIZONTAL_SCALE / 8 + 2 * HORIZONTAL_MARGIN)),
+    this->setMinimumSize(static_cast<int>(width_units_times_8 * MIN_HORIZONTAL_SCALE / 8 + 2 * HORIZONTAL_MARGIN),
                          ui->last_label->geometry().y() + ui->last_label->geometry().height() +
                              static_cast<int>(height_units_times_8 * MIN_VERTICAL_SCALE / 8 + 2 * VERTICAL_MARGIN));
 }