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

Enable button icons (as an enableable option)

This commit is contained in:
Joe R 2024-06-30 10:01:21 -04:00
parent 3cbcc8d214
commit a42b76d263
20 changed files with 66 additions and 8 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 592 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 592 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 226 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 567 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 807 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 412 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 270 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 155 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 215 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 597 B

View file

@ -3,7 +3,7 @@ msgstr ""
"Project-Id-Version: PySol 0.0.1\n" "Project-Id-Version: PySol 0.0.1\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-12-10 10:19-0500\n" "POT-Creation-Date: 2021-12-10 10:19-0500\n"
"PO-Revision-Date: 2024-06-22 12:14-0400\n" "PO-Revision-Date: 2024-06-30 10:00-0400\n"
"Last-Translator: H. Schaekel <Holger.Schaekel@web.de>\n" "Last-Translator: H. Schaekel <Holger.Schaekel@web.de>\n"
"Language-Team: German\n" "Language-Team: German\n"
"Language: de\n" "Language: de\n"
@ -5443,6 +5443,9 @@ msgid "Othe&r graphics"
msgstr "" msgstr ""
#: pysollib/ui/tktile/menubar.py:637 #: pysollib/ui/tktile/menubar.py:637
msgid "&Button icons"
msgstr ""
msgid "&Demo logo" msgid "&Demo logo"
msgstr "&Demo logo" msgstr "&Demo logo"

View file

@ -8,7 +8,7 @@ msgstr ""
"Project-Id-Version: 1.02\n" "Project-Id-Version: 1.02\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-12-10 10:19-0500\n" "POT-Creation-Date: 2021-12-10 10:19-0500\n"
"PO-Revision-Date: 2024-06-22 12:14-0400\n" "PO-Revision-Date: 2024-06-30 09:59-0400\n"
"Last-Translator: Eric Rausch <neelix570@gmail.com>\n" "Last-Translator: Eric Rausch <neelix570@gmail.com>\n"
"Language-Team: French\n" "Language-Team: French\n"
"Language: fr\n" "Language: fr\n"
@ -5489,6 +5489,9 @@ msgid "Othe&r graphics"
msgstr "" msgstr ""
#: pysollib/ui/tktile/menubar.py:637 #: pysollib/ui/tktile/menubar.py:637
msgid "&Button icons"
msgstr ""
msgid "&Demo logo" msgid "&Demo logo"
msgstr "Logo de &démo" msgstr "Logo de &démo"

View file

@ -12,7 +12,7 @@ msgstr ""
"Project-Id-Version: it_pysol\n" "Project-Id-Version: it_pysol\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-12-10 10:19-0500\n" "POT-Creation-Date: 2021-12-10 10:19-0500\n"
"PO-Revision-Date: 2024-06-22 12:14-0400\n" "PO-Revision-Date: 2024-06-30 09:59-0400\n"
"Last-Translator: Giuliano Colla <giuliano.colla@gmail.com>\n" "Last-Translator: Giuliano Colla <giuliano.colla@gmail.com>\n"
"Language-Team: Italiano <it@li.org>\n" "Language-Team: Italiano <it@li.org>\n"
"Language: it\n" "Language: it\n"
@ -5554,6 +5554,9 @@ msgid "Othe&r graphics"
msgstr "" msgstr ""
#: pysollib/ui/tktile/menubar.py:637 #: pysollib/ui/tktile/menubar.py:637
msgid "&Button icons"
msgstr ""
msgid "&Demo logo" msgid "&Demo logo"
msgstr "&Demo logo" msgstr "&Demo logo"

View file

@ -8,7 +8,7 @@ msgstr ""
"Project-Id-Version: PySolFC\n" "Project-Id-Version: PySolFC\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-12-10 10:19-0500\n" "POT-Creation-Date: 2021-12-10 10:19-0500\n"
"PO-Revision-Date: 2024-06-22 12:14-0400\n" "PO-Revision-Date: 2024-06-30 09:58-0400\n"
"Last-Translator: Jerzy Trzeciak <artusek@wp.pl>\n" "Last-Translator: Jerzy Trzeciak <artusek@wp.pl>\n"
"Language-Team: Polish <pl@li.org>\n" "Language-Team: Polish <pl@li.org>\n"
"Language: pl\n" "Language: pl\n"
@ -5505,6 +5505,9 @@ msgid "Othe&r graphics"
msgstr "" msgstr ""
#: pysollib/ui/tktile/menubar.py:637 #: pysollib/ui/tktile/menubar.py:637
msgid "&Button icons"
msgstr ""
msgid "&Demo logo" msgid "&Demo logo"
msgstr "&Demo logo" msgstr "&Demo logo"

View file

@ -8,7 +8,7 @@ msgstr ""
"Project-Id-Version: \n" "Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-12-10 10:19-0500\n" "POT-Creation-Date: 2021-12-10 10:19-0500\n"
"PO-Revision-Date: 2024-06-22 12:15-0400\n" "PO-Revision-Date: 2024-06-30 09:58-0400\n"
"Last-Translator: Matheus Knack <mtknack555@gmail.com>\n" "Last-Translator: Matheus Knack <mtknack555@gmail.com>\n"
"Language-Team: \n" "Language-Team: \n"
"Language: pt_BR\n" "Language: pt_BR\n"
@ -5511,6 +5511,9 @@ msgid "Othe&r graphics"
msgstr "" msgstr ""
#: pysollib/ui/tktile/menubar.py:637 #: pysollib/ui/tktile/menubar.py:637
msgid "&Button icons"
msgstr ""
msgid "&Demo logo" msgid "&Demo logo"
msgstr "&Logo da demo" msgstr "&Logo da demo"

View file

@ -5237,6 +5237,9 @@ msgid "Othe&r graphics"
msgstr "" msgstr ""
#: pysollib/ui/tktile/menubar.py:637 #: pysollib/ui/tktile/menubar.py:637
msgid "&Button icons"
msgstr ""
msgid "&Demo logo" msgid "&Demo logo"
msgstr "" msgstr ""

View file

@ -7,7 +7,7 @@ msgstr ""
"Project-Id-Version: \n" "Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-12-10 10:19-0500\n" "POT-Creation-Date: 2021-12-10 10:19-0500\n"
"PO-Revision-Date: 2024-06-22 12:16-0400\n" "PO-Revision-Date: 2024-06-30 09:58-0400\n"
"Last-Translator: Skomoroh <skomoroh@gmail.com>\n" "Last-Translator: Skomoroh <skomoroh@gmail.com>\n"
"Language-Team: Russian <ru@li.org>\n" "Language-Team: Russian <ru@li.org>\n"
"Language: ru\n" "Language: ru\n"
@ -5579,6 +5579,9 @@ msgid "Othe&r graphics"
msgstr "" msgstr ""
#: pysollib/ui/tktile/menubar.py:637 #: pysollib/ui/tktile/menubar.py:637
msgid "&Button icons"
msgstr ""
msgid "&Demo logo" msgid "&Demo logo"
msgstr "Д&емо лого" msgstr "Д&емо лого"

View file

@ -524,12 +524,19 @@ class Application:
MfxMessageDialog.img[f] = im MfxMessageDialog.img[f] = im
# load button images # load button images
if 0 and TOOLKIT == 'tk': MfxDialog.button_img = {}
dirname = os.path.join('images', 'buttons', 'bluecurve') if TOOLKIT == 'tk' and self.opt.button_icon_style != 'none':
dirname = os.path.join('images', 'buttons',
self.opt.button_icon_style)
for n, f in ( for n, f in (
(_('&OK'), 'ok'), (_('&OK'), 'ok'),
(_('&Select'), 'ok'),
(_('&Cancel'), 'cancel'), (_('&Cancel'), 'cancel'),
(_('&Close'), 'cancel'),
(_('&New game'), 'new'), (_('&New game'), 'new'),
(_('&Back to game'), 'back'),
(_('&Reset...'), 'reset'),
(_('&Restart'), 'reset'),
): ):
fn = self.dataloader.findImage(f, dirname) fn = self.dataloader.findImage(f, dirname)
im = loadImage(fn) im = loadImage(fn)

View file

@ -100,6 +100,7 @@ pause_text_style = string
redeal_icon_style = string redeal_icon_style = string
dialog_icon_style = string dialog_icon_style = string
tree_icon_style = string tree_icon_style = string
button_icon_style = string
tile_theme = string tile_theme = string
default_tile_theme = string default_tile_theme = string
toolbar = integer(0, 4) toolbar = integer(0, 4)
@ -270,6 +271,7 @@ class Options:
('redeal_icon_style', 'str'), ('redeal_icon_style', 'str'),
('dialog_icon_style', 'str'), ('dialog_icon_style', 'str'),
('tree_icon_style', 'str'), ('tree_icon_style', 'str'),
('button_icon_style', 'str'),
('tile_theme', 'str'), ('tile_theme', 'str'),
('default_tile_theme', 'str'), ('default_tile_theme', 'str'),
('toolbar', 'int'), ('toolbar', 'int'),
@ -376,6 +378,7 @@ class Options:
self.redeal_icon_style = 'modern' self.redeal_icon_style = 'modern'
self.dialog_icon_style = 'remix' self.dialog_icon_style = 'remix'
self.tree_icon_style = 'remix' self.tree_icon_style = 'remix'
self.button_icon_style = 'none'
self.tile_theme = 'default' self.tile_theme = 'default'
self.default_tile_theme = 'default' self.default_tile_theme = 'default'
self.toolbar = 1 # 0 == hide, 1,2,3,4 == top, bottom, left, right self.toolbar = 1 # 0 == hide, 1,2,3,4 == top, bottom, left, right

View file

@ -88,6 +88,20 @@ def createStatusbarMenu(menubar, menu):
def createOtherGraphicsMenu(menubar, menu): def createOtherGraphicsMenu(menubar, menu):
tearoff = menu.cget('tearoff') tearoff = menu.cget('tearoff')
data_dir = os.path.join(menubar.app.dataloader.dir, 'images', 'buttons')
submenu = MfxMenu(menu, label=n_('&Button icons'), tearoff=tearoff)
styledirs = os.listdir(data_dir)
styledirs.append("none")
styledirs.sort()
for f in styledirs:
d = os.path.join(data_dir, f)
if (os.path.isdir(d) and os.path.exists(os.path.join(d))) \
or f == "none":
name = f.replace('_', ' ').capitalize()
submenu.add_radiobutton(
label=name,
variable=menubar.tkopt.button_icon_style,
value=f, command=menubar.mOptButtonIconStyle)
data_dir = os.path.join(menubar.app.dataloader.dir, 'images', 'demo') data_dir = os.path.join(menubar.app.dataloader.dir, 'images', 'demo')
submenu = MfxMenu(menu, label=n_('&Demo logo'), tearoff=tearoff) submenu = MfxMenu(menu, label=n_('&Demo logo'), tearoff=tearoff)
styledirs = os.listdir(data_dir) styledirs = os.listdir(data_dir)
@ -326,6 +340,7 @@ class PysolMenubarTkCommon:
num_cards=tkinter.BooleanVar(), num_cards=tkinter.BooleanVar(),
helpbar=tkinter.BooleanVar(), helpbar=tkinter.BooleanVar(),
splashscreen=tkinter.BooleanVar(), splashscreen=tkinter.BooleanVar(),
button_icon_style=tkinter.StringVar(),
demo_logo=tkinter.BooleanVar(), demo_logo=tkinter.BooleanVar(),
demo_logo_style=tkinter.StringVar(), demo_logo_style=tkinter.StringVar(),
pause_text_style=tkinter.StringVar(), pause_text_style=tkinter.StringVar(),
@ -395,6 +410,7 @@ class PysolMenubarTkCommon:
tkopt.statusbar.set(opt.statusbar) tkopt.statusbar.set(opt.statusbar)
# tkopt.num_cards.set(opt.num_cards) # tkopt.num_cards.set(opt.num_cards)
# tkopt.helpbar.set(opt.helpbar) # tkopt.helpbar.set(opt.helpbar)
tkopt.button_icon_style.set(opt.button_icon_style)
tkopt.demo_logo.set(opt.demo_logo) tkopt.demo_logo.set(opt.demo_logo)
if opt.demo_logo: if opt.demo_logo:
tkopt.demo_logo_style.set(opt.demo_logo_style) tkopt.demo_logo_style.set(opt.demo_logo_style)
@ -1946,6 +1962,9 @@ Unsupported game for import.
def mOptStatusbarConfig(self, w): def mOptStatusbarConfig(self, w):
self.statusbarConfig(w, self.tkopt.statusbar_vars[w].get()) self.statusbarConfig(w, self.tkopt.statusbar_vars[w].get())
def mOptButtonIconStyle(self, *event):
self.setButtonIconStyle(self.tkopt.button_icon_style.get())
def mOptDemoLogoStyle(self, *event): def mOptDemoLogoStyle(self, *event):
self.setDemoLogoStyle(self.tkopt.demo_logo_style.get()) self.setDemoLogoStyle(self.tkopt.demo_logo_style.get())
@ -2048,6 +2067,14 @@ Unsupported game for import.
self.game.updateStatus(player=self.app.opt.player) self.game.updateStatus(player=self.app.opt.player)
self.top.update_idletasks() self.top.update_idletasks()
def setButtonIconStyle(self, style):
if self._cancelDrag(break_pause=False):
return
self.app.opt.button_icon_style = style
self.tkopt.button_icon_style.set(style) # update radiobutton
self.app.loadImages1()
self.app.loadImages4()
def setDemoLogoStyle(self, style): def setDemoLogoStyle(self, style):
if self._cancelDrag(break_pause=False): if self._cancelDrag(break_pause=False):
return return