diff --git a/pysollib/actions.py b/pysollib/actions.py index 2c60dd18..79463f83 100644 --- a/pysollib/actions.py +++ b/pysollib/actions.py @@ -46,6 +46,8 @@ from pysollib.pysoltk import TimeoutsDialog from pysollib.pysoltk import create_find_card_dialog from pysollib.pysoltk import create_full_picture_dialog from pysollib.pysoltk import create_solver_dialog +from pysollib.pysoltk import raise_find_card_dialog +from pysollib.pysoltk import raise_full_picture_dialog from pysollib.settings import DEBUG from pysollib.settings import PACKAGE_URL, TITLE from pysollib.settings import TOP_SIZE @@ -534,10 +536,12 @@ class PysolMenubar(PysolMenubarTk): if self.game.canFindCard(): create_find_card_dialog(self.game.top, self.game, self.app.getFindCardImagesDir()) + raise_find_card_dialog() def mFullPicture(self, *args): if self.game.canShowFullPicture(): create_full_picture_dialog(self.game.top, self.game) + raise_full_picture_dialog() def mSolver(self, *args): create_solver_dialog(self.game.top, self.app) diff --git a/pysollib/app.py b/pysollib/app.py index 7f5dad95..acad747d 100644 --- a/pysollib/app.py +++ b/pysollib/app.py @@ -53,7 +53,10 @@ from pysollib.pysoltk import PysolStatusbar from pysollib.pysoltk import SelectCardsetDialogWithPreview from pysollib.pysoltk import SelectDialogTreeData from pysollib.pysoltk import destroy_find_card_dialog +from pysollib.pysoltk import destroy_full_picture_dialog from pysollib.pysoltk import loadImage, wm_withdraw +from pysollib.pysoltk import raise_find_card_dialog +from pysollib.pysoltk import raise_full_picture_dialog from pysollib.resource import CSI, CardsetManager from pysollib.resource import Music, MusicManager from pysollib.resource import Sample, SampleManager @@ -277,6 +280,7 @@ class Application: # destroy_help_html() destroy_find_card_dialog() + destroy_full_picture_dialog() destroy_solver_dialog() # update options self.opt.last_gameid = id_ @@ -509,6 +513,10 @@ class Application: def wm_toggle_fullscreen(self): self.opt.wm_fullscreen = not self.opt.wm_fullscreen self.top.attributes("-fullscreen", self.opt.wm_fullscreen) + # Topmost dialogs need to be reset when toggling fullscreen. + raise_find_card_dialog() + raise_full_picture_dialog() + self.top.attributes('-topmost', False) def loadImages1(self): # load dialog images diff --git a/pysollib/kivy/findcarddialog.py b/pysollib/kivy/findcarddialog.py index d3ff5611..074489bd 100644 --- a/pysollib/kivy/findcarddialog.py +++ b/pysollib/kivy/findcarddialog.py @@ -69,6 +69,10 @@ def connect_game_find_card_dialog(game): ''' +def raise_find_card_dialog(): + pass + + def destroy_find_card_dialog(): pass ''' diff --git a/pysollib/kivy/fullpicturedialog.py b/pysollib/kivy/fullpicturedialog.py index 83a323c7..88ec4ad0 100644 --- a/pysollib/kivy/fullpicturedialog.py +++ b/pysollib/kivy/fullpicturedialog.py @@ -108,6 +108,10 @@ def connect_game_full_picture_dialog(game): ''' +def raise_full_picture_dialog(): + pass + + def destroy_full_picture_dialog(): pass ''' diff --git a/pysollib/pysolgtk/findcarddialog.py b/pysollib/pysolgtk/findcarddialog.py index ee491fba..79b3451f 100644 --- a/pysollib/pysolgtk/findcarddialog.py +++ b/pysollib/pysolgtk/findcarddialog.py @@ -50,5 +50,9 @@ def connect_game_find_card_dialog(game): pass +def raise_find_card_dialog(): + pass + + def destroy_find_card_dialog(): pass diff --git a/pysollib/pysolgtk/fullpicturedialog.py b/pysollib/pysolgtk/fullpicturedialog.py index 541d2dd6..77588aed 100644 --- a/pysollib/pysolgtk/fullpicturedialog.py +++ b/pysollib/pysolgtk/fullpicturedialog.py @@ -50,5 +50,9 @@ def connect_game_full_picture_dialog(game): pass +def raise_find_card_dialog(): + pass + + def destroy_full_picture_dialog(): pass diff --git a/pysollib/ui/tktile/findcarddialog.py b/pysollib/ui/tktile/findcarddialog.py index 9bbfcd81..83bc492d 100644 --- a/pysollib/ui/tktile/findcarddialog.py +++ b/pysollib/ui/tktile/findcarddialog.py @@ -243,6 +243,14 @@ def connect_game_find_card_dialog(game): pass +def raise_find_card_dialog(): + try: + find_card_dialog.tkraise() + find_card_dialog.attributes("-topmost", True) + except Exception: + pass + + def destroy_find_card_dialog(): global find_card_dialog try: diff --git a/pysollib/ui/tktile/fullpicturedialog.py b/pysollib/ui/tktile/fullpicturedialog.py index 251a54c1..25c256b5 100644 --- a/pysollib/ui/tktile/fullpicturedialog.py +++ b/pysollib/ui/tktile/fullpicturedialog.py @@ -135,6 +135,14 @@ def connect_game_full_picture_dialog(game): pass +def raise_full_picture_dialog(): + try: + full_picture_dialog.tkraise() + full_picture_dialog.attributes("-topmost", True) + except Exception: + pass + + def destroy_full_picture_dialog(): global full_picture_dialog try: