From 0feb657e293c5a4fe8ec8f8900fe6e8068614d1b Mon Sep 17 00:00:00 2001 From: twinaphex Date: Sun, 14 Apr 2019 17:54:00 +0200 Subject: [PATCH] (UI/QT) More dehardcoding --- setting_list.c | 1 + ui/drivers/qt/options/throttle.cpp | 22 ++++++++++------------ ui/drivers/qt/settingswidgets.h | 4 ++-- 3 files changed, 13 insertions(+), 14 deletions(-) diff --git a/setting_list.c b/setting_list.c index 49c57e1847..2154558ab0 100644 --- a/setting_list.c +++ b/setting_list.c @@ -1921,6 +1921,7 @@ bool CONFIG_SIZE( if (!(settings_list_append(list, list_info))) return false; (*list)[list_info->index++] = value; + (*list)[list_info->index - 1].ui_type = ST_UI_TYPE_SIZE_SPINBOX; #ifdef HAVE_MENU menu_settings_list_current_add_enum_idx(list, list_info, name_enum_idx); diff --git a/ui/drivers/qt/options/throttle.cpp b/ui/drivers/qt/options/throttle.cpp index a59260c30d..a9cf82c72e 100644 --- a/ui/drivers/qt/options/throttle.cpp +++ b/ui/drivers/qt/options/throttle.cpp @@ -25,14 +25,13 @@ FrameThrottlePage::FrameThrottlePage(QObject *parent) : QWidget *FrameThrottlePage::widget() { - QWidget *widget = new QWidget; - + QWidget *widget = new QWidget; FormLayout *layout = new FormLayout; - layout->addFloatSpinBox(MENU_ENUM_LABEL_FASTFORWARD_RATIO); - layout->addFloatSpinBox(MENU_ENUM_LABEL_SLOWMOTION_RATIO); - layout->addCheckBox(MENU_ENUM_LABEL_VRR_RUNLOOP_ENABLE); - layout->addCheckBox(MENU_ENUM_LABEL_MENU_THROTTLE_FRAMERATE); + layout->add(MENU_ENUM_LABEL_FASTFORWARD_RATIO); + layout->add(MENU_ENUM_LABEL_SLOWMOTION_RATIO); + layout->add(MENU_ENUM_LABEL_VRR_RUNLOOP_ENABLE); + layout->add(MENU_ENUM_LABEL_MENU_THROTTLE_FRAMERATE); widget->setLayout(layout); @@ -47,14 +46,13 @@ RewindPage::RewindPage(QObject *parent) : QWidget *RewindPage::widget() { - QWidget *widget = new QWidget; - + QWidget *widget = new QWidget; FormLayout *layout = new FormLayout; - layout->addCheckBox(MENU_ENUM_LABEL_REWIND_ENABLE); - layout->addUIntSpinBox(MENU_ENUM_LABEL_REWIND_GRANULARITY); - layout->addSizeSpinBox(MENU_ENUM_LABEL_REWIND_BUFFER_SIZE); - layout->addUIntSpinBox(MENU_ENUM_LABEL_REWIND_BUFFER_SIZE_STEP); + layout->add(MENU_ENUM_LABEL_REWIND_ENABLE); + layout->add(MENU_ENUM_LABEL_REWIND_GRANULARITY); + layout->add(MENU_ENUM_LABEL_REWIND_BUFFER_SIZE); + layout->add(MENU_ENUM_LABEL_REWIND_BUFFER_SIZE_STEP); widget->setLayout(layout); diff --git a/ui/drivers/qt/settingswidgets.h b/ui/drivers/qt/settingswidgets.h index 563e113ee5..7f24203389 100644 --- a/ui/drivers/qt/settingswidgets.h +++ b/ui/drivers/qt/settingswidgets.h @@ -87,7 +87,7 @@ public: this->addFloatSliderAndSpinBox(enum_idx); break; case ST_UI_TYPE_SIZE_SPINBOX: - /* TODO/FIXME */ + this->addSizeSpinBox(enum_idx); break; case ST_UI_TYPE_BIND_BUTTON: return this->addBindButton(enum_idx); @@ -181,7 +181,7 @@ public: this->addFloatSliderAndSpinBox(enum_idx); break; case ST_UI_TYPE_SIZE_SPINBOX: - /* TODO/FIXME */ + this->addSizeSpinBox(enum_idx); break; case ST_UI_TYPE_BIND_BUTTON: /* TODO/FIXME - Why is the returntype void here and bool