Skip to content

Commit

Permalink
Set full picture and find card dialogs to be always on top
Browse files Browse the repository at this point in the history
  • Loading branch information
joeraz committed Nov 7, 2024
1 parent b7569e7 commit 87a33b7
Show file tree
Hide file tree
Showing 8 changed files with 44 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pysollib/actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@
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
Expand Down Expand Up @@ -534,10 +536,12 @@ def mFindCard(self, *args):
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)
Expand Down
8 changes: 8 additions & 0 deletions pysollib/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,10 @@
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
Expand Down Expand Up @@ -277,6 +280,7 @@ def _main_loop(self):
#
destroy_help_html()
destroy_find_card_dialog()
destroy_full_picture_dialog()
destroy_solver_dialog()
# update options
self.opt.last_gameid = id_
Expand Down Expand Up @@ -509,6 +513,10 @@ def wm_withdraw(self):
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
Expand Down
4 changes: 4 additions & 0 deletions pysollib/kivy/findcarddialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,10 @@ def connect_game_find_card_dialog(game):
'''


def raise_find_card_dialog():
pass


def destroy_find_card_dialog():
pass
'''
Expand Down
4 changes: 4 additions & 0 deletions pysollib/kivy/fullpicturedialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,10 @@ def connect_game_full_picture_dialog(game):
'''


def raise_full_picture_dialog():
pass


def destroy_full_picture_dialog():
pass
'''
Expand Down
4 changes: 4 additions & 0 deletions pysollib/pysolgtk/findcarddialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,5 +50,9 @@ def connect_game_find_card_dialog(game):
pass


def raise_find_card_dialog():
pass


def destroy_find_card_dialog():
pass
4 changes: 4 additions & 0 deletions pysollib/pysolgtk/fullpicturedialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,5 +50,9 @@ def connect_game_full_picture_dialog(game):
pass


def raise_find_card_dialog():
pass


def destroy_full_picture_dialog():
pass
8 changes: 8 additions & 0 deletions pysollib/ui/tktile/findcarddialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
8 changes: 8 additions & 0 deletions pysollib/ui/tktile/fullpicturedialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 87a33b7

Please sign in to comment.