Skip to content

Commit

Permalink
dock: Add a close menu item
Browse files Browse the repository at this point in the history
When the dock is locked, the close button at the top right won't appear.
Reported in the issue #72.
  • Loading branch information
norihiro committed Mar 22, 2023
1 parent dda570c commit d71ca6b
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions data/locale/en-US.ini
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ dock.menu.show.histogram="Show &Histogram"
dock.menu.show.zebra="Show &Zebra"
dock.menu.show.falsecolor="Show &False Color"
dock.menu.properties="Properties..."
dock.menu.close="Close (&X)"
dock.dialog.title="Dock Title"
dock.dialog.note="Other sources can be selected from the property after creating the dock."

Expand Down
1 change: 1 addition & 0 deletions data/locale/ja-JP.ini
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ dock.menu.show.histogram="&ヒストグラムを表示 (&H)"
dock.menu.show.falsecolor="&偽色を表示 (&F)"
dock.menu.show.zebra="ゼブラを表示 (&Z)"
dock.menu.properties="プロパティ..."
dock.menu.close="閉じる (&X)"
dock.dialog.title="ドックのタイトル"

# src-obsstudio
Expand Down
1 change: 1 addition & 0 deletions data/locale/pt-BR.ini
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ dock.menu.show.histogram="Mostrar &Histogram"
dock.menu.show.zebra="Mostrar &Zebra"
dock.menu.show.falsecolor="Mostrar &False Color"
dock.menu.properties="Propriedades..."
dock.menu.close="Fechar (&X)"
dock.dialog.title="Título do painel"
dock.dialog.note="Outras fontes poderão ser selecionadas nas propriedades depois de criar o painel."

Expand Down
6 changes: 6 additions & 0 deletions src/scope-widget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -511,6 +511,12 @@ bool ScopeWidget::openMenu(QMouseEvent *)
connect(act, &QAction::triggered, this, &ScopeWidget::createProperties);
popup.addAction(act);

act = new QAction(obs_module_text("dock.menu.close"), this);
connect(act, &QAction::triggered, this, [&]() {
QMetaObject::invokeMethod(parentWidget(), "close", Qt::QueuedConnection);
});
popup.addAction(act);

popup.exec(QCursor::pos());
return true;
}
Expand Down

0 comments on commit d71ca6b

Please sign in to comment.