mirror of
https://github.com/obsproject/obs-studio.git
synced 2026-07-27 07:36:15 -04:00
UI: Disable toolbar buttons when no source is selected
When no source is selected, disable the toolbar buttons so the user knows the buttons can't be clicked. They would just do nothing before.
This commit is contained in:
@@ -3077,13 +3077,26 @@ void OBSBasic::UpdateContextBarDeferred(bool force)
|
||||
Qt::QueuedConnection, Q_ARG(bool, force));
|
||||
}
|
||||
|
||||
void OBSBasic::SourceToolBarActionsSetEnabled(bool enable)
|
||||
{
|
||||
ui->actionRemoveSource->setEnabled(enable);
|
||||
ui->actionSourceProperties->setEnabled(enable);
|
||||
ui->actionSourceUp->setEnabled(enable);
|
||||
ui->actionSourceDown->setEnabled(enable);
|
||||
|
||||
RefreshToolBarStyling(ui->sourcesToolbar);
|
||||
}
|
||||
|
||||
void OBSBasic::UpdateContextBar(bool force)
|
||||
{
|
||||
OBSSceneItem item = GetCurrentSceneItem();
|
||||
bool enable = item != nullptr;
|
||||
|
||||
SourceToolBarActionsSetEnabled(enable);
|
||||
|
||||
if (!ui->contextContainer->isVisible() && !force)
|
||||
return;
|
||||
|
||||
OBSSceneItem item = GetCurrentSceneItem();
|
||||
|
||||
if (item) {
|
||||
obs_source_t *source = obs_sceneitem_get_source(item);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user