Skip to content

Commit a2fd484

Browse files
committed
Current panel: fixes dockwidget visibility issue
1 parent 6496cd0 commit a2fd484

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

.vscode/launch.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"console": "integratedTerminal",
1313
"envFile": "${workspaceFolder}/.env",
1414
"python": "${config:python.defaultInterpreterPath}",
15-
"justMyCode": true,
15+
"justMyCode": false,
1616
"env": {
1717
// "DEBUG": "1",
1818
// "LANG": "fr",

cdl/core/gui/main.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -953,9 +953,10 @@ def get_current_panel(self) -> str:
953953
str: panel name (valid values: "signal", "image", "macro")
954954
"""
955955
panel = self.tabwidget.currentWidget()
956-
if panel is self.signalpanel:
956+
dock = self.docks[panel]
957+
if panel is self.signalpanel and dock.isVisible():
957958
return "signal"
958-
if panel is self.imagepanel:
959+
if panel is self.imagepanel and dock.isVisible():
959960
return "image"
960961
return "macro"
961962

@@ -969,6 +970,12 @@ def set_current_panel(self, panel: str) -> None:
969970
Raises:
970971
ValueError: unknown panel
971972
"""
973+
if self.get_current_panel() == panel:
974+
if panel in ("signal", "image"):
975+
# Force tab index changed event to be sure that the dock associated
976+
# to the current panel is raised
977+
self.__tab_index_changed(self.tabwidget.currentIndex())
978+
return
972979
if panel == "signal":
973980
self.tabwidget.setCurrentWidget(self.signalpanel)
974981
elif panel == "image":

0 commit comments

Comments
 (0)