mirror of https://gitlab.com/pamhyr/pamhyr2
Pamhyr: Add recursive window activation.
parent
83d53a46fb
commit
f0f6ad17e2
|
|
@ -573,9 +573,23 @@ class ApplicationWindow(QMainWindow, ListedSubWindow, WindowToolKit):
|
||||||
#############
|
#############
|
||||||
|
|
||||||
def _activate_window(self, window_hash):
|
def _activate_window(self, window_hash):
|
||||||
window = self.get_sub_win(window_hash)
|
self._try_activate_window_for_window(self, window_hash)
|
||||||
if window is not None:
|
|
||||||
window.activateWindow()
|
def _try_activate_window_for_window(self,
|
||||||
|
source_window,
|
||||||
|
window_hash):
|
||||||
|
try:
|
||||||
|
window = source_window.get_sub_win(window_hash)
|
||||||
|
if window is not None:
|
||||||
|
window.activateWindow()
|
||||||
|
else:
|
||||||
|
for _, win in source_window.sub_win_list:
|
||||||
|
self._try_activate_window_for_window(
|
||||||
|
win,
|
||||||
|
window_hash
|
||||||
|
)
|
||||||
|
except Exception:
|
||||||
|
return
|
||||||
|
|
||||||
def _update_window_list(self):
|
def _update_window_list(self):
|
||||||
self._propagation_keys.add("window_list")
|
self._propagation_keys.add("window_list")
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue