UI: Refresh edit menu on item select/deselect

This commit is contained in:
gxalpha 2022-02-19 15:39:00 +01:00 committed by Jim
parent 7a5bffc0a6
commit d5f2b7e496
3 changed files with 3 additions and 9 deletions

View File

@ -623,12 +623,14 @@ void SourceTreeItem::Select()
{ {
tree->SelectItem(sceneitem, true); tree->SelectItem(sceneitem, true);
OBSBasic::Get()->UpdateContextBarDeferred(); OBSBasic::Get()->UpdateContextBarDeferred();
OBSBasic::Get()->UpdateEditMenu();
} }
void SourceTreeItem::Deselect() void SourceTreeItem::Deselect()
{ {
tree->SelectItem(sceneitem, false); tree->SelectItem(sceneitem, false);
OBSBasic::Get()->UpdateContextBarDeferred(); OBSBasic::Get()->UpdateContextBarDeferred();
OBSBasic::Get()->UpdateEditMenu();
} }
/* ========================================================================= */ /* ========================================================================= */

View File

@ -1842,6 +1842,7 @@ void OBSBasic::OBSInit()
ui->contextContainer->setVisible(contextVisible); ui->contextContainer->setVisible(contextVisible);
if (contextVisible) if (contextVisible)
UpdateContextBar(true); UpdateContextBar(true);
UpdateEditMenu();
{ {
ProfileScope("OBSBasic::Load"); ProfileScope("OBSBasic::Load");
@ -5369,8 +5370,6 @@ ColorSelect::ColorSelect(QWidget *parent)
void OBSBasic::CreateSourcePopupMenu(int idx, bool preview) void OBSBasic::CreateSourcePopupMenu(int idx, bool preview)
{ {
UpdateEditMenu();
QMenu popup(this); QMenu popup(this);
delete previewProjectorSource; delete previewProjectorSource;
delete sourceProjector; delete sourceProjector;
@ -7825,11 +7824,6 @@ void OBSBasic::UpdateEditMenu()
ui->actionHorizontalCenter->setEnabled(canTransform); ui->actionHorizontalCenter->setEnabled(canTransform);
} }
void OBSBasic::on_menuBasic_MainMenu_Edit_aboutToShow()
{
UpdateEditMenu();
}
void OBSBasic::on_actionEditTransform_triggered() void OBSBasic::on_actionEditTransform_triggered()
{ {
if (transformWindow) if (transformWindow)

View File

@ -966,8 +966,6 @@ private slots:
void on_actionShowCrashLogs_triggered(); void on_actionShowCrashLogs_triggered();
void on_actionUploadLastCrashLog_triggered(); void on_actionUploadLastCrashLog_triggered();
void on_menuBasic_MainMenu_Edit_aboutToShow();
void on_actionEditTransform_triggered(); void on_actionEditTransform_triggered();
void on_actionCopyTransform_triggered(); void on_actionCopyTransform_triggered();
void on_actionPasteTransform_triggered(); void on_actionPasteTransform_triggered();