diff --git a/frontend/cmake/ui-components.cmake b/frontend/cmake/ui-components.cmake index 98c2bba4d..ad0506a08 100644 --- a/frontend/cmake/ui-components.cmake +++ b/frontend/cmake/ui-components.cmake @@ -81,22 +81,4 @@ target_sources( components/VolumeSlider.hpp components/WindowCaptureToolbar.cpp components/WindowCaptureToolbar.hpp - components/idian/OBSActionRow.cpp - components/idian/OBSActionRow.hpp - components/idian/OBSCheckBox.cpp - components/idian/OBSCheckBox.hpp - components/idian/OBSComboBox.cpp - components/idian/OBSComboBox.hpp - components/idian/OBSDoubleSpinBox.cpp - components/idian/OBSDoubleSpinBox.hpp - components/idian/OBSGroupBox.cpp - components/idian/OBSGroupBox.hpp - components/idian/OBSIdianWidget.hpp - components/idian/OBSPropertiesList.cpp - components/idian/OBSPropertiesList.hpp - components/idian/OBSSpinBox.cpp - components/idian/OBSSpinBox.hpp - components/idian/OBSToggleSwitch.cpp - components/idian/OBSToggleSwitch.hpp - components/idian/obs-widgets.hpp ) diff --git a/frontend/cmake/ui-dialogs.cmake b/frontend/cmake/ui-dialogs.cmake index de490a383..ec1c96c44 100644 --- a/frontend/cmake/ui-dialogs.cmake +++ b/frontend/cmake/ui-dialogs.cmake @@ -1,3 +1,9 @@ +if(NOT TARGET OBS::idian) + add_subdirectory("${CMAKE_SOURCE_DIR}/shared/qt/idian" "${CMAKE_BINARY_DIR}/shared/qt/idian") +endif() + +target_link_libraries(obs-studio PRIVATE OBS::idian) + if(NOT TARGET OBS::properties-view) add_subdirectory("${CMAKE_SOURCE_DIR}/shared/properties-view" "${CMAKE_BINARY_DIR}/shared/properties-view") endif() diff --git a/frontend/dialogs/OBSIdianPlayground.cpp b/frontend/dialogs/OBSIdianPlayground.cpp index 05228062a..d2e6b0bdc 100644 --- a/frontend/dialogs/OBSIdianPlayground.cpp +++ b/frontend/dialogs/OBSIdianPlayground.cpp @@ -17,7 +17,7 @@ #include "OBSIdianPlayground.hpp" -#include "components/idian/obs-widgets.hpp" +#include #include diff --git a/frontend/dialogs/OBSIdianPlayground.hpp b/frontend/dialogs/OBSIdianPlayground.hpp index da69ff28d..2cc69121e 100644 --- a/frontend/dialogs/OBSIdianPlayground.hpp +++ b/frontend/dialogs/OBSIdianPlayground.hpp @@ -17,8 +17,6 @@ #pragma once -#include "components/idian/obs-widgets.hpp" - #include #include diff --git a/shared/qt/idian/CMakeLists.txt b/shared/qt/idian/CMakeLists.txt new file mode 100644 index 000000000..7b8e888ce --- /dev/null +++ b/shared/qt/idian/CMakeLists.txt @@ -0,0 +1,35 @@ +cmake_minimum_required(VERSION 3.28...3.30) + +find_package(Qt6 REQUIRED Core Widgets Svg) + +add_library(idian STATIC) +add_library(OBS::idian ALIAS idian) + +target_sources( + idian + PRIVATE + OBSActionRow.cpp + OBSActionRow.hpp + OBSCheckBox.cpp + OBSCheckBox.hpp + OBSComboBox.cpp + OBSComboBox.hpp + OBSDoubleSpinBox.cpp + OBSDoubleSpinBox.hpp + OBSIdianWidget.hpp + OBSGroupBox.cpp + OBSGroupBox.hpp + OBSPropertiesList.cpp + OBSPropertiesList.hpp + OBSSpinBox.cpp + OBSSpinBox.hpp + OBSToggleSwitch.cpp + OBSToggleSwitch.hpp +) +target_sources(idian PUBLIC include/Idian/obs-widgets.hpp) + +set_target_properties(idian PROPERTIES AUTOMOC ON FOLDER "frontend") + +target_include_directories(idian PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/include") + +target_link_libraries(idian PUBLIC Qt::Core Qt::Widgets Qt::Svg) diff --git a/frontend/components/idian/OBSActionRow.cpp b/shared/qt/idian/OBSActionRow.cpp similarity index 98% rename from frontend/components/idian/OBSActionRow.cpp rename to shared/qt/idian/OBSActionRow.cpp index 2944f6fe8..ae6c1278c 100644 --- a/frontend/components/idian/OBSActionRow.cpp +++ b/shared/qt/idian/OBSActionRow.cpp @@ -20,7 +20,6 @@ #include #include "OBSActionRow.hpp" -#include #include OBSActionRowWidget::OBSActionRowWidget(QWidget *parent) : OBSActionRow(parent) @@ -240,10 +239,8 @@ OBSActionRowExpandButton::OBSActionRowExpandButton(QWidget *parent) : QAbstractB setCheckable(true); } -void OBSActionRowExpandButton::paintEvent(QPaintEvent *event) +void OBSActionRowExpandButton::paintEvent(QPaintEvent *) { - UNUSED_PARAMETER(event); - QStyleOptionButton opt; opt.initFrom(this); QPainter p(this); diff --git a/frontend/components/idian/OBSActionRow.hpp b/shared/qt/idian/OBSActionRow.hpp similarity index 100% rename from frontend/components/idian/OBSActionRow.hpp rename to shared/qt/idian/OBSActionRow.hpp diff --git a/frontend/components/idian/OBSCheckBox.cpp b/shared/qt/idian/OBSCheckBox.cpp similarity index 100% rename from frontend/components/idian/OBSCheckBox.cpp rename to shared/qt/idian/OBSCheckBox.cpp diff --git a/frontend/components/idian/OBSCheckBox.hpp b/shared/qt/idian/OBSCheckBox.hpp similarity index 100% rename from frontend/components/idian/OBSCheckBox.hpp rename to shared/qt/idian/OBSCheckBox.hpp diff --git a/frontend/components/idian/OBSComboBox.cpp b/shared/qt/idian/OBSComboBox.cpp similarity index 94% rename from frontend/components/idian/OBSComboBox.cpp rename to shared/qt/idian/OBSComboBox.cpp index 224bea572..e031e8da0 100644 --- a/frontend/components/idian/OBSComboBox.cpp +++ b/shared/qt/idian/OBSComboBox.cpp @@ -18,9 +18,6 @@ #include "OBSActionRow.hpp" #include "OBSComboBox.hpp" #include -#include - -#define UNUSED_PARAMETER(param) (void)param OBSComboBox::OBSComboBox(QWidget *parent) : QComboBox(parent), OBSIdianUtils(this) {} @@ -51,7 +48,6 @@ void OBSComboBox::hidePopup() void OBSComboBox::mousePressEvent(QMouseEvent *event) { - blog(LOG_INFO, "OBSComboBox::mousePressEvent"); QComboBox::mousePressEvent(event); } diff --git a/frontend/components/idian/OBSComboBox.hpp b/shared/qt/idian/OBSComboBox.hpp similarity index 100% rename from frontend/components/idian/OBSComboBox.hpp rename to shared/qt/idian/OBSComboBox.hpp diff --git a/frontend/components/idian/OBSDoubleSpinBox.cpp b/shared/qt/idian/OBSDoubleSpinBox.cpp similarity index 100% rename from frontend/components/idian/OBSDoubleSpinBox.cpp rename to shared/qt/idian/OBSDoubleSpinBox.cpp diff --git a/frontend/components/idian/OBSDoubleSpinBox.hpp b/shared/qt/idian/OBSDoubleSpinBox.hpp similarity index 100% rename from frontend/components/idian/OBSDoubleSpinBox.hpp rename to shared/qt/idian/OBSDoubleSpinBox.hpp diff --git a/frontend/components/idian/OBSGroupBox.cpp b/shared/qt/idian/OBSGroupBox.cpp similarity index 100% rename from frontend/components/idian/OBSGroupBox.cpp rename to shared/qt/idian/OBSGroupBox.cpp diff --git a/frontend/components/idian/OBSGroupBox.hpp b/shared/qt/idian/OBSGroupBox.hpp similarity index 100% rename from frontend/components/idian/OBSGroupBox.hpp rename to shared/qt/idian/OBSGroupBox.hpp diff --git a/frontend/components/idian/OBSIdianWidget.hpp b/shared/qt/idian/OBSIdianWidget.hpp similarity index 100% rename from frontend/components/idian/OBSIdianWidget.hpp rename to shared/qt/idian/OBSIdianWidget.hpp diff --git a/frontend/components/idian/OBSPropertiesList.cpp b/shared/qt/idian/OBSPropertiesList.cpp similarity index 100% rename from frontend/components/idian/OBSPropertiesList.cpp rename to shared/qt/idian/OBSPropertiesList.cpp diff --git a/frontend/components/idian/OBSPropertiesList.hpp b/shared/qt/idian/OBSPropertiesList.hpp similarity index 100% rename from frontend/components/idian/OBSPropertiesList.hpp rename to shared/qt/idian/OBSPropertiesList.hpp diff --git a/frontend/components/idian/OBSSpinBox.cpp b/shared/qt/idian/OBSSpinBox.cpp similarity index 100% rename from frontend/components/idian/OBSSpinBox.cpp rename to shared/qt/idian/OBSSpinBox.cpp diff --git a/frontend/components/idian/OBSSpinBox.hpp b/shared/qt/idian/OBSSpinBox.hpp similarity index 100% rename from frontend/components/idian/OBSSpinBox.hpp rename to shared/qt/idian/OBSSpinBox.hpp diff --git a/frontend/components/idian/OBSToggleSwitch.cpp b/shared/qt/idian/OBSToggleSwitch.cpp similarity index 97% rename from frontend/components/idian/OBSToggleSwitch.cpp rename to shared/qt/idian/OBSToggleSwitch.cpp index 10fbd5fd9..606a36cd1 100644 --- a/frontend/components/idian/OBSToggleSwitch.cpp +++ b/shared/qt/idian/OBSToggleSwitch.cpp @@ -16,9 +16,6 @@ ******************************************************************************/ #include "OBSToggleSwitch.hpp" -#include - -#define UNUSED_PARAMETER(param) (void)param static QColor blendColors(const QColor &color1, const QColor &color2, float ratio) { @@ -100,10 +97,8 @@ void OBSToggleSwitch::changeEvent(QEvent *event) } } -void OBSToggleSwitch::paintEvent(QPaintEvent *e) +void OBSToggleSwitch::paintEvent(QPaintEvent *) { - UNUSED_PARAMETER(e); - QStyleOptionButton opt; opt.initFrom(this); QPainter p(this); diff --git a/frontend/components/idian/OBSToggleSwitch.hpp b/shared/qt/idian/OBSToggleSwitch.hpp similarity index 100% rename from frontend/components/idian/OBSToggleSwitch.hpp rename to shared/qt/idian/OBSToggleSwitch.hpp diff --git a/frontend/components/idian/obs-widgets.hpp b/shared/qt/idian/include/Idian/obs-widgets.hpp similarity index 82% rename from frontend/components/idian/obs-widgets.hpp rename to shared/qt/idian/include/Idian/obs-widgets.hpp index 61bc13432..a9aa034f0 100644 --- a/frontend/components/idian/obs-widgets.hpp +++ b/shared/qt/idian/include/Idian/obs-widgets.hpp @@ -21,14 +21,14 @@ // // (OBS Idian, get it?) -#include "OBSActionRow.hpp" -#include "OBSCheckBox.hpp" -#include "OBSComboBox.hpp" -#include "OBSDoubleSpinBox.hpp" -#include "OBSGroupBox.hpp" -#include "OBSPropertiesList.hpp" -#include "OBSSpinBox.hpp" -#include "OBSToggleSwitch.hpp" +#include "../../OBSActionRow.hpp" +#include "../../OBSCheckBox.hpp" +#include "../../OBSComboBox.hpp" +#include "../../OBSDoubleSpinBox.hpp" +#include "../../OBSGroupBox.hpp" +#include "../../OBSPropertiesList.hpp" +#include "../../OBSSpinBox.hpp" +#include "../../OBSToggleSwitch.hpp" /// Note: This file serves as an all-in-one include for custom OBS widgets. /// It is not intended to define any widgets by itself.