1
0
Fork 0
mirror of https://github.com/shlomif/PySolFC.git synced 2025-04-05 00:02:29 -04:00

Set full picture and find card dialogs to be always on top

This commit is contained in:
Joe R 2024-11-06 20:50:15 -05:00
parent b7569e79c2
commit 87a33b72b1
8 changed files with 44 additions and 0 deletions

View file

@ -46,6 +46,8 @@ from pysollib.pysoltk import TimeoutsDialog
from pysollib.pysoltk import create_find_card_dialog from pysollib.pysoltk import create_find_card_dialog
from pysollib.pysoltk import create_full_picture_dialog from pysollib.pysoltk import create_full_picture_dialog
from pysollib.pysoltk import create_solver_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 DEBUG
from pysollib.settings import PACKAGE_URL, TITLE from pysollib.settings import PACKAGE_URL, TITLE
from pysollib.settings import TOP_SIZE from pysollib.settings import TOP_SIZE
@ -534,10 +536,12 @@ class PysolMenubar(PysolMenubarTk):
if self.game.canFindCard(): if self.game.canFindCard():
create_find_card_dialog(self.game.top, self.game, create_find_card_dialog(self.game.top, self.game,
self.app.getFindCardImagesDir()) self.app.getFindCardImagesDir())
raise_find_card_dialog()
def mFullPicture(self, *args): def mFullPicture(self, *args):
if self.game.canShowFullPicture(): if self.game.canShowFullPicture():
create_full_picture_dialog(self.game.top, self.game) create_full_picture_dialog(self.game.top, self.game)
raise_full_picture_dialog()
def mSolver(self, *args): def mSolver(self, *args):
create_solver_dialog(self.game.top, self.app) create_solver_dialog(self.game.top, self.app)

View file

@ -53,7 +53,10 @@ from pysollib.pysoltk import PysolStatusbar
from pysollib.pysoltk import SelectCardsetDialogWithPreview from pysollib.pysoltk import SelectCardsetDialogWithPreview
from pysollib.pysoltk import SelectDialogTreeData from pysollib.pysoltk import SelectDialogTreeData
from pysollib.pysoltk import destroy_find_card_dialog 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 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 CSI, CardsetManager
from pysollib.resource import Music, MusicManager from pysollib.resource import Music, MusicManager
from pysollib.resource import Sample, SampleManager from pysollib.resource import Sample, SampleManager
@ -277,6 +280,7 @@ class Application:
# #
destroy_help_html() destroy_help_html()
destroy_find_card_dialog() destroy_find_card_dialog()
destroy_full_picture_dialog()
destroy_solver_dialog() destroy_solver_dialog()
# update options # update options
self.opt.last_gameid = id_ self.opt.last_gameid = id_
@ -509,6 +513,10 @@ class Application:
def wm_toggle_fullscreen(self): def wm_toggle_fullscreen(self):
self.opt.wm_fullscreen = not self.opt.wm_fullscreen self.opt.wm_fullscreen = not self.opt.wm_fullscreen
self.top.attributes("-fullscreen", 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): def loadImages1(self):
# load dialog images # load dialog images

View file

@ -69,6 +69,10 @@ def connect_game_find_card_dialog(game):
''' '''
def raise_find_card_dialog():
pass
def destroy_find_card_dialog(): def destroy_find_card_dialog():
pass pass
''' '''

View file

@ -108,6 +108,10 @@ def connect_game_full_picture_dialog(game):
''' '''
def raise_full_picture_dialog():
pass
def destroy_full_picture_dialog(): def destroy_full_picture_dialog():
pass pass
''' '''

View file

@ -50,5 +50,9 @@ def connect_game_find_card_dialog(game):
pass pass
def raise_find_card_dialog():
pass
def destroy_find_card_dialog(): def destroy_find_card_dialog():
pass pass

View file

@ -50,5 +50,9 @@ def connect_game_full_picture_dialog(game):
pass pass
def raise_find_card_dialog():
pass
def destroy_full_picture_dialog(): def destroy_full_picture_dialog():
pass pass

View file

@ -243,6 +243,14 @@ def connect_game_find_card_dialog(game):
pass 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(): def destroy_find_card_dialog():
global find_card_dialog global find_card_dialog
try: try:

View file

@ -135,6 +135,14 @@ def connect_game_full_picture_dialog(game):
pass 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(): def destroy_full_picture_dialog():
global full_picture_dialog global full_picture_dialog
try: try: