Skip to content

Commit 7dc87f8

Browse files
committed
frontend: Move media control dynamic properties to ui file
This moves the dynamic properties for the media control buttons from the cpp file to the ui file.
1 parent ecb0381 commit 7dc87f8

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

frontend/components/MediaControls.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,6 @@ void MediaControls::OBSMediaPrevious(void *data, calldata_t *)
4646
MediaControls::MediaControls(QWidget *parent) : QWidget(parent), ui(new Ui::MediaControls)
4747
{
4848
ui->setupUi(this);
49-
ui->playPauseButton->setProperty("class", "icon-media-play");
50-
ui->previousButton->setProperty("class", "icon-media-prev");
51-
ui->nextButton->setProperty("class", "icon-media-next");
52-
ui->stopButton->setProperty("class", "icon-media-stop");
5349
setFocusPolicy(Qt::StrongFocus);
5450

5551
connect(&mediaTimer, &QTimer::timeout, this, &MediaControls::SetSliderPosition);

frontend/forms/source-toolbar/media-controls.ui

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,9 @@
7474
<property name="flat">
7575
<bool>true</bool>
7676
</property>
77+
<property name="class" stdset="0">
78+
<string>icon-media-play</string>
79+
</property>
7780
</widget>
7881
</item>
7982
<item>
@@ -112,6 +115,9 @@
112115
<property name="flat">
113116
<bool>true</bool>
114117
</property>
118+
<property name="class" stdset="0">
119+
<string>icon-media-prev</string>
120+
</property>
115121
</widget>
116122
</item>
117123
<item>
@@ -150,6 +156,9 @@
150156
<property name="flat">
151157
<bool>true</bool>
152158
</property>
159+
<property name="class" stdset="0">
160+
<string>icon-media-stop</string>
161+
</property>
153162
</widget>
154163
</item>
155164
<item>
@@ -188,6 +197,9 @@
188197
<property name="flat">
189198
<bool>true</bool>
190199
</property>
200+
<property name="class" stdset="0">
201+
<string>icon-media-next</string>
202+
</property>
191203
</widget>
192204
</item>
193205
<item>

0 commit comments

Comments
 (0)