Skip to content

Commit

Permalink
frontend: Move media control dynamic properties to ui file
Browse files Browse the repository at this point in the history
This moves the dynamic properties for the media control buttons
from the cpp file to the ui file.
  • Loading branch information
cg2121 authored and Warchamp7 committed Jan 27, 2025
1 parent 9f4e0c5 commit 449755e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
4 changes: 0 additions & 4 deletions frontend/components/MediaControls.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,6 @@ void MediaControls::OBSMediaPrevious(void *data, calldata_t *)
MediaControls::MediaControls(QWidget *parent) : QWidget(parent), ui(new Ui::MediaControls)
{
ui->setupUi(this);
ui->playPauseButton->setProperty("class", "icon-media-play");
ui->previousButton->setProperty("class", "icon-media-prev");
ui->nextButton->setProperty("class", "icon-media-next");
ui->stopButton->setProperty("class", "icon-media-stop");
setFocusPolicy(Qt::StrongFocus);

connect(&mediaTimer, &QTimer::timeout, this, &MediaControls::SetSliderPosition);
Expand Down
12 changes: 12 additions & 0 deletions frontend/forms/source-toolbar/media-controls.ui
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@
<property name="flat">
<bool>true</bool>
</property>
<property name="class" stdset="0">
<string>icon-media-play</string>
</property>
</widget>
</item>
<item>
Expand Down Expand Up @@ -112,6 +115,9 @@
<property name="flat">
<bool>true</bool>
</property>
<property name="class" stdset="0">
<string>icon-media-prev</string>
</property>
</widget>
</item>
<item>
Expand Down Expand Up @@ -150,6 +156,9 @@
<property name="flat">
<bool>true</bool>
</property>
<property name="class" stdset="0">
<string>icon-media-stop</string>
</property>
</widget>
</item>
<item>
Expand Down Expand Up @@ -188,6 +197,9 @@
<property name="flat">
<bool>true</bool>
</property>
<property name="class" stdset="0">
<string>icon-media-next</string>
</property>
</widget>
</item>
<item>
Expand Down

0 comments on commit 449755e

Please sign in to comment.