mirror of
https://github.com/obsproject/obs-studio.git
synced 2024-07-19 17:49:14 +00:00
UI: Fix source toolbar shifting when nothing is selected
#5125 added icons to the source toolbar but no icon is displayed when nothing is selected. This adds a spacer on the right side of the label that gets toggled inversely to the source icon, to maintain the same width
This commit is contained in:
parent
6e566f9b23
commit
2f637ede0f
|
@ -308,6 +308,31 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="contextSourceIconSpacer">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>22</width>
|
||||
<height>22</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>22</width>
|
||||
<height>22</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="Line" name="line_3">
|
||||
<property name="orientation">
|
||||
|
|
|
@ -3140,6 +3140,7 @@ void OBSBasic::UpdateContextBar(bool force)
|
|||
|
||||
QPixmap pixmap = icon.pixmap(QSize(16, 16));
|
||||
ui->contextSourceIcon->setPixmap(pixmap);
|
||||
ui->contextSourceIconSpacer->hide();
|
||||
ui->contextSourceIcon->show();
|
||||
|
||||
const char *name = obs_source_get_name(source);
|
||||
|
@ -3150,6 +3151,7 @@ void OBSBasic::UpdateContextBar(bool force)
|
|||
obs_source_configurable(source));
|
||||
} else {
|
||||
ui->contextSourceIcon->hide();
|
||||
ui->contextSourceIconSpacer->show();
|
||||
ui->contextSourceLabel->setText(
|
||||
QTStr("ContextBar.NoSelectedSource"));
|
||||
|
||||
|
|
Loading…
Reference in a new issue