Skip to content

Commit

Permalink
Refactor code
Browse files Browse the repository at this point in the history
  • Loading branch information
cg2121 committed Jun 7, 2024
1 parent 53a06ee commit 317de30
Show file tree
Hide file tree
Showing 12 changed files with 661 additions and 540 deletions.
6 changes: 3 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,11 @@ target_sources(
src/slider-absoluteset-style.hpp
src/slider-ignorewheel.cpp
src/slider-ignorewheel.hpp
src/sound-edit.cpp
src/sound-edit.hpp
src/media-edit.cpp
src/media-edit.hpp
src/soundboard.cpp
src/soundboard.hpp
src/Soundboard.ui
src/SoundEdit.ui)
src/MediaEdit.ui)

set_target_properties_plugin(${CMAKE_PROJECT_NAME} PROPERTIES OUTPUT_NAME ${_name})
2 changes: 1 addition & 1 deletion buildspec.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"bundleId": "com.obs-plugin.obs-soundboard"
}
},
"name": "obs-plugintemplate",
"name": "obs-soundboard",
"displayName": "OBS Soundboard",
"version": "1.1.1",
"author": "cg2121",
Expand Down
15 changes: 9 additions & 6 deletions src/SoundEdit.ui → src/MediaEdit.ui
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>SoundEdit</class>
<widget class="QDialog" name="SoundEdit">
<class>MediaEdit</class>
<widget class="QDialog" name="MediaEdit">
<property name="geometry">
<rect>
<x>0</x>
Expand Down Expand Up @@ -56,14 +56,14 @@
<number>0</number>
</property>
<item row="0" column="0">
<widget class="QLabel" name="nameLabel">
<widget class="QLabel" name="label_3">
<property name="text">
<string>Name</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLineEdit" name="nameEdit">
<widget class="QLineEdit" name="name">
<property name="minimumSize">
<size>
<width>0</width>
Expand All @@ -79,7 +79,7 @@
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="fileLabel">
<widget class="QLabel" name="label_2">
<property name="text">
<string>File</string>
</property>
Expand All @@ -91,7 +91,7 @@
<enum>QLayout::SetFixedSize</enum>
</property>
<item>
<widget class="QLineEdit" name="fileEdit">
<widget class="QLineEdit" name="path">
<property name="minimumSize">
<size>
<width>0</width>
Expand All @@ -104,6 +104,9 @@
<height>16777215</height>
</size>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
<item>
Expand Down
133 changes: 80 additions & 53 deletions src/Soundboard.ui
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,10 @@
<property name="frameShadow">
<enum>QFrame::Sunken</enum>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<layout class="QVBoxLayout" name="verticalLayout">
<property name="spacing">
<number>2</number>
</property>
<property name="leftMargin">
<number>0</number>
</property>
Expand All @@ -48,98 +51,122 @@
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<property name="spacing">
<number>0</number>
<number>4</number>
</property>
<item row="0" column="0">
<layout class="QVBoxLayout" name="mainLayout">
<property name="spacing">
<number>0</number>
<item>
<widget class="SceneTree" name="list">
<property name="contextMenuPolicy">
<enum>Qt::CustomContextMenu</enum>
</property>
<property name="horizontalScrollBarPolicy">
<enum>Qt::ScrollBarAlwaysOff</enum>
</property>
</widget>
</item>
<item>
<widget class="QToolBar" name="toolbar">
<property name="styleSheet">
<string notr="true">QToolBar { background: transparent; }</string>
</property>
<property name="movable">
<bool>false</bool>
</property>
<property name="iconSize">
<size>
<width>16</width>
<height>16</height>
</size>
</property>
<property name="floatable">
<bool>false</bool>
</property>
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="SceneTree" name="soundList">
<property name="contextMenuPolicy">
<enum>Qt::CustomContextMenu</enum>
</property>
<property name="horizontalScrollBarPolicy">
<enum>Qt::ScrollBarAlwaysOff</enum>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="MediaControls" name="mediaControls" native="true"/>
</item>
<item>
<widget class="QToolBar" name="soundboardToolbar">
<property name="styleSheet">
<string notr="true">QToolBar { background: transparent; }</string>
</property>
<property name="movable">
<bool>false</bool>
</property>
<property name="iconSize">
<size>
<width>16</width>
<height>16</height>
</size>
</property>
<property name="floatable">
<bool>false</bool>
</property>
<addaction name="actionAddSound"/>
<addaction name="actionRemoveSound"/>
<addaction name="separator"/>
<addaction name="actionEditSound"/>
</widget>
</item>
</layout>
<addaction name="actionAdd"/>
<addaction name="actionRemove"/>
<addaction name="separator"/>
<addaction name="actionEdit"/>
</widget>
</item>
<item>
<widget class="MediaControls" name="mediaControls" native="true"/>
</item>
</layout>
</widget>
</item>
</layout>
<action name="actionAddSound">
<action name="actionAdd">
<property name="icon">
<iconset>
<normaloff>:/res/images/plus.svg</normaloff>:/res/images/plus.svg</iconset>
</property>
<property name="text">
<string>Add</string>
</property>
<property name="iconVisibleInMenu">
<bool>false</bool>
</property>
<property name="themeID" stdset="0">
<string notr="true">addIconSmall</string>
</property>
</action>
<action name="actionRemoveSound">
<action name="actionRemove">
<property name="enabled">
<bool>false</bool>
</property>
<property name="icon">
<iconset>
<normaloff>:/res/images/minus.svg</normaloff>:/res/images/minus.svg</iconset>
</property>
<property name="text">
<string>Remove</string>
</property>
<property name="iconVisibleInMenu">
<bool>false</bool>
</property>
<property name="themeID" stdset="0">
<string notr="true">removeIconSmall</string>
</property>
</action>
<action name="actionEditSound">
<action name="actionEdit">
<property name="enabled">
<bool>false</bool>
</property>
<property name="icon">
<iconset>
<normaloff>:/settings/images/settings/general.svg</normaloff>:/settings/images/settings/general.svg</iconset>
</property>
<property name="text">
<string>Edit</string>
</property>
<property name="iconVisibleInMenu">
<bool>false</bool>
</property>
<property name="themeID" stdset="0">
<string notr="true">configIconSmall</string>
</property>
</action>
<action name="actionDuplicate">
<property name="text">
<string>Duplicate</string>
</property>
</action>
<action name="actionFilters">
<property name="text">
<string>Filters</string>
</property>
</action>
<action name="actionListMode">
<property name="text">
<string>ListMode</string>
</property>
</action>
<action name="actionGridMode">
<property name="checkable">
<bool>true</bool>
</property>
<property name="text">
<string>GridMode</string>
</property>
</action>
</widget>
<customwidgets>
<customwidget>
Expand Down
Loading

0 comments on commit 317de30

Please sign in to comment.