mirror of
https://github.com/obsproject/obs-studio.git
synced 2026-01-22 13:18:34 -05:00
UI: Fix transform shortcuts for audio only sources
The edit, copy, paste and reset transform shortcuts would still work for audio only sources, even though the menu was hidden for these.
This commit is contained in:
@@ -3311,9 +3311,24 @@ void OBSBasic::SourceToolBarActionsSetEnabled()
|
||||
RefreshToolBarStyling(ui->sourcesToolbar);
|
||||
}
|
||||
|
||||
void OBSBasic::UpdateTransformShortcuts()
|
||||
{
|
||||
OBSSource source = obs_sceneitem_get_source(GetCurrentSceneItem());
|
||||
uint32_t flags = obs_source_get_output_flags(source);
|
||||
bool audioOnly = (flags & OBS_SOURCE_VIDEO) == 0;
|
||||
|
||||
ui->actionEditTransform->setEnabled(!audioOnly);
|
||||
ui->actionCopyTransform->setEnabled(!audioOnly);
|
||||
ui->actionPasteTransform->setEnabled(audioOnly ? false
|
||||
: hasCopiedTransform);
|
||||
|
||||
ui->actionResetTransform->setEnabled(!audioOnly);
|
||||
}
|
||||
|
||||
void OBSBasic::UpdateContextBar(bool force)
|
||||
{
|
||||
SourceToolBarActionsSetEnabled();
|
||||
UpdateTransformShortcuts();
|
||||
|
||||
if (!ui->contextContainer->isVisible() && !force)
|
||||
return;
|
||||
|
||||
@@ -662,6 +662,8 @@ private:
|
||||
|
||||
bool restartingVCam = false;
|
||||
|
||||
void UpdateTransformShortcuts();
|
||||
|
||||
public slots:
|
||||
void DeferSaveBegin();
|
||||
void DeferSaveEnd();
|
||||
|
||||
Reference in New Issue
Block a user