From 14bd880822ef4162f950eada92bbe8afa967dec2 Mon Sep 17 00:00:00 2001 From: cg2121 Date: Fri, 9 Sep 2022 07:20:48 -0500 Subject: [PATCH] UI: Add filters button to scenes toolbar Makes it easier to access scene filters. --- UI/data/locale/en-US.ini | 1 + UI/data/themes/Acri.qss | 4 ++++ UI/data/themes/Dark.qss | 4 ++++ UI/data/themes/Grey.qss | 4 ++++ UI/data/themes/Light.qss | 4 ++++ UI/data/themes/Rachni.qss | 4 ++++ UI/data/themes/System.qss | 4 ++++ UI/data/themes/Yami.qss | 4 ++++ UI/forms/OBSBasic.ui | 17 +++++++++++++++++ UI/window-basic-main.cpp | 8 ++++++++ UI/window-basic-main.hpp | 1 + 11 files changed, 55 insertions(+) diff --git a/UI/data/locale/en-US.ini b/UI/data/locale/en-US.ini index 038a7bb1f..4d93e7ea8 100644 --- a/UI/data/locale/en-US.ini +++ b/UI/data/locale/en-US.ini @@ -113,6 +113,7 @@ MoveSourceDown="Move Source(s) Down" SourceProperties="Open Source Properties" SourceFilters="Open Source Filters" MixerToolbarMenu="Audio Mixer Menu" +SceneFilters="Open Scene Filters" # warning for plugin load failures PluginsFailedToLoad.Title="Plugin Load Error" diff --git a/UI/data/themes/Acri.qss b/UI/data/themes/Acri.qss index 6cea7bb77..5c7495bf1 100644 --- a/UI/data/themes/Acri.qss +++ b/UI/data/themes/Acri.qss @@ -524,6 +524,10 @@ QToolButton:pressed { qproperty-icon: url(./Dark/media-pause.svg); } +* [themeID="filtersIcon"] { + qproperty-icon: url(./Dark/filter.svg); +} + QToolBarExtension { background: palette(button); min-width: 12px; diff --git a/UI/data/themes/Dark.qss b/UI/data/themes/Dark.qss index cfb7faa0c..a94491226 100644 --- a/UI/data/themes/Dark.qss +++ b/UI/data/themes/Dark.qss @@ -328,6 +328,10 @@ QToolButton:pressed { qproperty-icon: url(./Dark/cogs.svg); } +* [themeID="filtersIcon"] { + qproperty-icon: url(./Dark/filter.svg); +} + /* Tab Widget */ QTabWidget::pane { /* The tab widget frame */ diff --git a/UI/data/themes/Grey.qss b/UI/data/themes/Grey.qss index d6a86d36d..2d2f188e1 100644 --- a/UI/data/themes/Grey.qss +++ b/UI/data/themes/Grey.qss @@ -522,6 +522,10 @@ QToolButton:pressed { qproperty-icon: url(./Dark/media-pause.svg); } +* [themeID="filtersIcon"] { + qproperty-icon: url(./Dark/filter.svg); +} + QToolBarExtension { background: palette(button); min-width: 12px; diff --git a/UI/data/themes/Light.qss b/UI/data/themes/Light.qss index 68c396af0..74249a9bd 100644 --- a/UI/data/themes/Light.qss +++ b/UI/data/themes/Light.qss @@ -522,6 +522,10 @@ QToolButton:pressed { qproperty-icon: url(./Light/media-pause.svg); } +* [themeID="filtersIcon"] { + qproperty-icon: url(./Light/filter.svg); +} + QToolBarExtension { background: palette(button); min-width: 12px; diff --git a/UI/data/themes/Rachni.qss b/UI/data/themes/Rachni.qss index 63a6b2372..7488b5050 100644 --- a/UI/data/themes/Rachni.qss +++ b/UI/data/themes/Rachni.qss @@ -530,6 +530,10 @@ QToolButton:pressed { qproperty-icon: url(./Dark/media-pause.svg); } +* [themeID="filtersIcon"] { + qproperty-icon: url(./Dark/filter.svg); +} + QToolBarExtension { background: palette(button); min-width: 12px; diff --git a/UI/data/themes/System.qss b/UI/data/themes/System.qss index f98752c77..aba01e7fa 100644 --- a/UI/data/themes/System.qss +++ b/UI/data/themes/System.qss @@ -58,6 +58,10 @@ OBSThemeMeta { qproperty-icon: url(:/res/images/cogs.svg); } +* [themeID="filtersIcon"] { + qproperty-icon: url(:/res/images/filter.svg); +} + MuteCheckBox { outline: none; } diff --git a/UI/data/themes/Yami.qss b/UI/data/themes/Yami.qss index 34d5860cf..5f16c322e 100644 --- a/UI/data/themes/Yami.qss +++ b/UI/data/themes/Yami.qss @@ -526,6 +526,10 @@ QToolButton:pressed { qproperty-icon: url(./Dark/media-pause.svg); } +* [themeID="filtersIcon"] { + qproperty-icon: url(./Dark/filter.svg); +} + QToolBarExtension { background: palette(button); min-width: 12px; diff --git a/UI/forms/OBSBasic.ui b/UI/forms/OBSBasic.ui index 8fd9ffaa2..ed0d09cf2 100644 --- a/UI/forms/OBSBasic.ui +++ b/UI/forms/OBSBasic.ui @@ -842,6 +842,8 @@ + + @@ -2349,6 +2351,21 @@ menuIconSmall + + + + :/res/images/filter.svg:/res/images/filter.svg + + + SceneFilters + + + SceneFilters + + + filtersIcon + + diff --git a/UI/window-basic-main.cpp b/UI/window-basic-main.cpp index 3c5e22fc2..af7e97b08 100644 --- a/UI/window-basic-main.cpp +++ b/UI/window-basic-main.cpp @@ -10197,6 +10197,14 @@ void OBSBasic::on_sourceFiltersButton_clicked() OpenFilters(); } +void OBSBasic::on_actionSceneFilters_triggered() +{ + OBSSource sceneSource = GetCurrentSceneSource(); + + if (sceneSource) + OpenFilters(sceneSource); +} + void OBSBasic::on_sourceInteractButton_clicked() { on_actionInteract_triggered(); diff --git a/UI/window-basic-main.hpp b/UI/window-basic-main.hpp index 4def5ed32..5b28a5fdc 100644 --- a/UI/window-basic-main.hpp +++ b/UI/window-basic-main.hpp @@ -1032,6 +1032,7 @@ private slots: void on_actionCenterToScreen_triggered(); void on_actionVerticalCenter_triggered(); void on_actionHorizontalCenter_triggered(); + void on_actionSceneFilters_triggered(); void on_OBSBasic_customContextMenuRequested(const QPoint &pos);