From e8409669688e2c4566ae07545ba6127bd1d377e9 Mon Sep 17 00:00:00 2001 From: gxalpha Date: Sun, 27 Mar 2022 03:48:29 +0200 Subject: [PATCH] UI: Remove old ComboBoxIgnoreScroll --- UI/CMakeLists.txt | 2 -- UI/combobox-ignorewheel.cpp | 14 -------------- UI/combobox-ignorewheel.hpp | 15 --------------- UI/frontend-plugins/aja-output-ui/CMakeLists.txt | 2 -- .../decklink-output-ui/CMakeLists.txt | 2 -- UI/frontend-plugins/frontend-tools/CMakeLists.txt | 2 -- UI/properties-view.cpp | 9 ++++----- 7 files changed, 4 insertions(+), 42 deletions(-) delete mode 100644 UI/combobox-ignorewheel.cpp delete mode 100644 UI/combobox-ignorewheel.hpp diff --git a/UI/CMakeLists.txt b/UI/CMakeLists.txt index 9f17a6e27..d61b44631 100644 --- a/UI/CMakeLists.txt +++ b/UI/CMakeLists.txt @@ -160,8 +160,6 @@ target_sources( audio-encoders.cpp audio-encoders.hpp balance-slider.hpp - combobox-ignorewheel.cpp - combobox-ignorewheel.hpp clickable-label.hpp double-slider.cpp double-slider.hpp diff --git a/UI/combobox-ignorewheel.cpp b/UI/combobox-ignorewheel.cpp deleted file mode 100644 index c7c24eb43..000000000 --- a/UI/combobox-ignorewheel.cpp +++ /dev/null @@ -1,14 +0,0 @@ -#include "combobox-ignorewheel.hpp" - -ComboBoxIgnoreScroll::ComboBoxIgnoreScroll(QWidget *parent) : QComboBox(parent) -{ - setFocusPolicy(Qt::StrongFocus); -} - -void ComboBoxIgnoreScroll::wheelEvent(QWheelEvent *event) -{ - if (!hasFocus()) - event->ignore(); - else - QComboBox::wheelEvent(event); -} diff --git a/UI/combobox-ignorewheel.hpp b/UI/combobox-ignorewheel.hpp deleted file mode 100644 index 479e1bb85..000000000 --- a/UI/combobox-ignorewheel.hpp +++ /dev/null @@ -1,15 +0,0 @@ -#pragma once - -#include -#include -#include - -class ComboBoxIgnoreScroll : public QComboBox { - Q_OBJECT - -public: - ComboBoxIgnoreScroll(QWidget *parent = nullptr); - -protected: - virtual void wheelEvent(QWheelEvent *event) override; -}; diff --git a/UI/frontend-plugins/aja-output-ui/CMakeLists.txt b/UI/frontend-plugins/aja-output-ui/CMakeLists.txt index fb6bb0b1c..c3c14c7b3 100644 --- a/UI/frontend-plugins/aja-output-ui/CMakeLists.txt +++ b/UI/frontend-plugins/aja-output-ui/CMakeLists.txt @@ -42,8 +42,6 @@ target_sources( ${CMAKE_SOURCE_DIR}/plugins/aja/aja-vpid-data.hpp ${CMAKE_SOURCE_DIR}/plugins/aja/aja-widget-io.cpp ${CMAKE_SOURCE_DIR}/plugins/aja/aja-widget-io.hpp - ${CMAKE_SOURCE_DIR}/UI/combobox-ignorewheel.cpp - ${CMAKE_SOURCE_DIR}/UI/combobox-ignorewheel.hpp ${CMAKE_SOURCE_DIR}/UI/double-slider.cpp ${CMAKE_SOURCE_DIR}/UI/double-slider.hpp ${CMAKE_SOURCE_DIR}/UI/properties-view.hpp diff --git a/UI/frontend-plugins/decklink-output-ui/CMakeLists.txt b/UI/frontend-plugins/decklink-output-ui/CMakeLists.txt index d83542ef0..cfc929bb2 100644 --- a/UI/frontend-plugins/decklink-output-ui/CMakeLists.txt +++ b/UI/frontend-plugins/decklink-output-ui/CMakeLists.txt @@ -27,8 +27,6 @@ target_sources( DecklinkOutputUI.h decklink-ui-main.cpp decklink-ui-main.h - ${CMAKE_SOURCE_DIR}/UI/combobox-ignorewheel.cpp - ${CMAKE_SOURCE_DIR}/UI/combobox-ignorewheel.hpp ${CMAKE_SOURCE_DIR}/UI/double-slider.cpp ${CMAKE_SOURCE_DIR}/UI/double-slider.hpp ${CMAKE_SOURCE_DIR}/UI/properties-view.hpp diff --git a/UI/frontend-plugins/frontend-tools/CMakeLists.txt b/UI/frontend-plugins/frontend-tools/CMakeLists.txt index aac98f90f..e7d78558d 100644 --- a/UI/frontend-plugins/frontend-tools/CMakeLists.txt +++ b/UI/frontend-plugins/frontend-tools/CMakeLists.txt @@ -27,8 +27,6 @@ target_sources( output-timer.hpp tool-helpers.hpp output-timer.cpp - ${CMAKE_SOURCE_DIR}/UI/combobox-ignorewheel.cpp - ${CMAKE_SOURCE_DIR}/UI/combobox-ignorewheel.hpp ${CMAKE_SOURCE_DIR}/UI/double-slider.cpp ${CMAKE_SOURCE_DIR}/UI/double-slider.hpp ${CMAKE_SOURCE_DIR}/UI/horizontal-scroll-area.cpp diff --git a/UI/properties-view.cpp b/UI/properties-view.cpp index 3030f9e14..27487b612 100644 --- a/UI/properties-view.cpp +++ b/UI/properties-view.cpp @@ -26,7 +26,6 @@ #include "double-slider.hpp" #include "slider-ignorewheel.hpp" #include "spinbox-ignorewheel.hpp" -#include "combobox-ignorewheel.hpp" #include "qt-wrappers.hpp" #include "properties-view.hpp" #include "properties-view.moc.hpp" @@ -532,7 +531,7 @@ static string from_obs_data_autoselect(obs_data_t *data, const char *name, QWidget *OBSPropertiesView::AddList(obs_property_t *prop, bool &warning) { const char *name = obs_property_name(prop); - QComboBox *combo = new ComboBoxIgnoreScroll(); + QComboBox *combo = new QComboBox(); obs_combo_type type = obs_property_list_type(prop); obs_combo_format format = obs_property_list_format(prop); size_t count = obs_property_list_item_count(prop); @@ -972,7 +971,7 @@ CreateSimpleFPSValues(OBSFrameRatePropertyWidget *fpsProps, bool &selected, auto items = vector{}; items.reserve(sizeof(common_fps) / sizeof(common_frame_rate)); - auto combo = fpsProps->simpleFPS = new ComboBoxIgnoreScroll{}; + auto combo = fpsProps->simpleFPS = new QComboBox(); combo->addItem("", QVariant::fromValue(make_fps(0, 0))); for (const auto &fps : common_fps) { @@ -1054,7 +1053,7 @@ static QWidget *CreateRationalFPS(OBSFrameRatePropertyWidget *fpsProps, auto str = QTStr("Basic.PropertiesView.FPS.ValidFPSRanges"); auto rlabel = new QLabel{str}; - auto combo = fpsProps->fpsRange = new ComboBoxIgnoreScroll{}; + auto combo = fpsProps->fpsRange = new QComboBox(); auto convert_fps = media_frames_per_second_to_fps; //auto convert_fi = media_frames_per_second_to_frame_interval; @@ -1105,7 +1104,7 @@ CreateFrameRateWidget(obs_property_t *prop, bool &warning, const char *option, swap(widget->fps_ranges, fps_ranges); - auto combo = widget->modeSelect = new ComboBoxIgnoreScroll{}; + auto combo = widget->modeSelect = new QComboBox(); combo->addItem(QTStr("Basic.PropertiesView.FPS.Simple"), QVariant::fromValue(frame_rate_tag::simple())); combo->addItem(QTStr("Basic.PropertiesView.FPS.Rational"),