From a42b76d263fc8a6d000be00cd86933e388975f51 Mon Sep 17 00:00:00 2001 From: Joe R Date: Sun, 30 Jun 2024 10:01:21 -0400 Subject: [PATCH] Enable button icons (as an enableable option) --- data/images/buttons/bluecurve/back.png | Bin 0 -> 592 bytes data/images/buttons/bluecurve/cancel.gif | Bin 592 -> 0 bytes data/images/buttons/bluecurve/new.gif | Bin 226 -> 0 bytes data/images/buttons/bluecurve/ok.gif | Bin 567 -> 0 bytes data/images/buttons/bluecurve/reset.png | Bin 0 -> 807 bytes data/images/buttons/remix/back.png | Bin 0 -> 412 bytes data/images/buttons/remix/cancel.png | Bin 0 -> 270 bytes data/images/buttons/remix/new.png | Bin 0 -> 155 bytes data/images/buttons/remix/ok.png | Bin 0 -> 215 bytes data/images/buttons/remix/reset.png | Bin 0 -> 597 bytes po/de_pysol.po | 5 ++++- po/fr_pysol.po | 5 ++++- po/it_pysol.po | 5 ++++- po/pl_pysol.po | 5 ++++- po/pt_BR_pysol.po | 5 ++++- po/pysol.pot | 3 +++ po/ru_pysol.po | 5 ++++- pysollib/app.py | 11 +++++++-- pysollib/options.py | 3 +++ pysollib/ui/tktile/menubar.py | 27 +++++++++++++++++++++++ 20 files changed, 66 insertions(+), 8 deletions(-) create mode 100644 data/images/buttons/bluecurve/back.png delete mode 100644 data/images/buttons/bluecurve/cancel.gif delete mode 100644 data/images/buttons/bluecurve/new.gif delete mode 100644 data/images/buttons/bluecurve/ok.gif create mode 100644 data/images/buttons/bluecurve/reset.png create mode 100644 data/images/buttons/remix/back.png create mode 100644 data/images/buttons/remix/cancel.png create mode 100644 data/images/buttons/remix/new.png create mode 100644 data/images/buttons/remix/ok.png create mode 100644 data/images/buttons/remix/reset.png diff --git a/data/images/buttons/bluecurve/back.png b/data/images/buttons/bluecurve/back.png new file mode 100644 index 0000000000000000000000000000000000000000..8ba8bf3cd6ef8d20fda4630a17ce01a43fa3de8d GIT binary patch literal 592 zcmV-W0RZEL^TYQK$=P{Vl;vSeF9hfbTMP*AyB>mU=l z)FIj_>=4o^s)L?_E{Wax16x6abg&?3bVwx+x*#`*Wb4ninA^{EdphW345u-nQ=iMr z`|v&=-tY6i@SjcS2PW6o9TW1n9TIus7hrg&vSE+gA(>QACLi_)Fa`L4_N|(Xb?RdS z!H)3D=O?jFmq0Uu z*Sc{ikt-6o5o0Ev9R$X=5=KU@bOi={Z8)YuS*;%}tFPc4i;>LfuIiiCMh==kW)AIt zyNJbN#^JO9@Fo3&Y_WhrFerN}Qs5!)^mi(Z+)OK+;GoRX9%DIu|TpHAuk}{julKa7{E4&UBU6(QVc`W! z7Ay)4`Dkx<(9j^oQ2%jB;T>ZmS6-e+)>h9f%1H|Fmf^Y zFzA5X2#OO1_O%T@P0cN>ZS5VMUEMwH42(?7%`B`;oeXU39GqM}+&sK|{2c;h1J>>aEenm9hXoj5c>#$;`d`LmSL zr~F3(ia%KxxftXbbQpjDWG4e_`~&sAl+1YFynm2=WoK9UTRaG{fgWe@$5J^TeCf* Wk(5-e8iRCObBmvOcaM@HgEau0$Z7uo diff --git a/data/images/buttons/bluecurve/ok.gif b/data/images/buttons/bluecurve/ok.gif deleted file mode 100644 index 8438d93d83e6b40cd2fe5bfdef21f274659a8b25..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 567 zcmZ?wbhEHb6k!ly_{P9cQC(qbX1aU-ZdF~?>Uq@~ni@_nPF?G}CO(_M?ai5$n>Bgb zWFvc{y}$Nq?b8rlD#W6|ymsSSDQT(o_t$6L%M{usATW_Hr9Nfz&&_N{Sb6qva}{w) z%1iEfzsK~ZDeGw#wiZ?i8HujtxrQ&vP`qG`g>LSH7J{ZOwm?pYS9>#6o1onHlSU zte^OCqIS4;Yz3^kzmlZBCs!IeP=Duo z=xk?TWa?^TVrF6OZ)IcW;N+Ux#LdIY$1fl_M@U#iR8)*@Dwnu~q@&LY)w8p(cbF>3>L}sl>|(*G<)FY}(CEr@#p%R`g@+v*85pbqXtaPe diff --git a/data/images/buttons/bluecurve/reset.png b/data/images/buttons/bluecurve/reset.png new file mode 100644 index 0000000000000000000000000000000000000000..3aac5f6a7d35e907e90954190d428199757d9f6e GIT binary patch literal 807 zcmV+?1K9kDP)g zVg*4Sy``53(v&XINuf{z$q600HIGT7EeJBGIS6Ihbid6%ZNJU8!!}#C<>>qJ!VB;7 ze0ZMcecnf+I9UNl<{Sb1Mf&9hjT{Sc1&YO-DwdcqMTLWGj3qX zPypDV7-VKH%tR7eVh|_~d<{%obzfyGwZ+ffpQuMw#BGr-nil{MfLs9R-~P7kN@xiO z&`@G68J6p0R^ls!^)OmeV>7jhkOV9Nt9SqnpiqPW3xL&BZyN4?(T%CzL@*vCtcUro zeO0lQ({clSOp*Q_<-ldU zxVVOovAv}80$nH1oTSOrM2)cqn`*Ho{BlDI?Nhi4WQb*7P-^$tc^q+vsIFED!+( z0SC?a0AD^>ZiFtSU19$1JYQzN;2d%gH^%v){~%SCf~S--h8q{q4BRXX%xY4qma}8& zec9tOQQ@l)l2`h(MZ5?)5x}K`fbe_1wPR*OekKdv<$yd0`u=W{V%3g?0DTAsG9WV> lz}^3W<*JADZ|N!4;TJV45tB3Q?>PVf002ovPDHLkV1idvWm*6L literal 0 HcmV?d00001 diff --git a/data/images/buttons/remix/back.png b/data/images/buttons/remix/back.png new file mode 100644 index 0000000000000000000000000000000000000000..a3abfa0509e99fe3c3e345ecb83125f486463512 GIT binary patch literal 412 zcmV;N0b~A&P)o9e*FcT94;|Nbct69q7sb%7&eP8dTmO!L9b&)Oc)p$HvM$`d*#Bo>2mu;!;rDM=S7aBWgaa{Q^g2$&hk=1{HBjRgkwvdVVXh)8 z)?UVol`#GP-~Eq)$yI#O%RL~&u*M9bbaX#KfrIDY*Uyaq89GE3zplk;5D|gS@H$Qu z6gf|T$;6jzgZ?)#u)Mh^dWn(o|3Q(3Z!*a?=tZo!4m0Dw%MAbj7m6-^Gl49F{yQ+R zypJ%(3_ zauG<;Yi{lW21Z6uxG(_e9?{RAOL3(;oGwB#WCGb9!ZZObYG7t$Tp{xL^9`Z{o0JSa1Trlt-a%Fi03?lB U6K-)KO8@`>07*qoM6N<$f>5btbN~PV literal 0 HcmV?d00001 diff --git a/data/images/buttons/remix/new.png b/data/images/buttons/remix/new.png new file mode 100644 index 0000000000000000000000000000000000000000..cb7f59f9ea92a699fd449bfcfe6452e724b88ec4 GIT binary patch literal 155 zcmeAS@N?(olHy`uVBq!ia0vp^LLkh+1|-AI^@RheBu^K|5DWk0lm$WwOD0+Jd@=Ue z@?{U>iL2{(^Xfk+wsjQmoF0FR-{?W=@_CO}IP&l;Xh=;;dgspD{r|y%w1fl~&Nub{ z|A{HNGk7HgpH;}&Xe5>0@>%NYCXS6unGf!9D{p2{iLnvh#_Sgbw2i^j)z4*}Q$iB} D`q4I| literal 0 HcmV?d00001 diff --git a/data/images/buttons/remix/ok.png b/data/images/buttons/remix/ok.png new file mode 100644 index 0000000000000000000000000000000000000000..cd4f24f53efd8354625a5bbc2ea9cd6aae414a0b GIT binary patch literal 215 zcmeAS@N?(olHy`uVBq!ia0vp^LLkh+1|-AI^@Rhed7dtgAr}70DGP)WmQ1qbIebE4 z@?|x?bf5Dw4XnJ8amJR}m;V2^cV>KC&*nZOQAL`?yk%nIA<4(atr4*)Ri{E8ZMpeU zd`FVdbVY@)1>%i7KaYR;Z=IqP)ltR0^-42?)&?F-uL@{KZO7E;V6z1c!}>O zp9WAD5mbUn)>6XQa;>Z1;(CTa8qhI~`wCPgrs078)sx|wTaIOQm$&`voQwU{bZI{V zsxye;rs?gpGl+l=-Tc&X+_b$g zZjj}Muln@}XsO}PGJv-rG4JLIFUNsy2j1BMy}fRg+Pybg-tliD!b8c}x!T;d_y4k5 zBll<$to+7Hf#e@)%8S*k{ip{byHk2v{mo?e%Q)E5&gMKr^-2OuZ_9imr=-6fGITNswy6 z%@tq7F61AG-u^bZIj`LefmkR`Ns~Vzfr_!Nok<~Hb2!$KhM483F6%g?e+DM?ia@~*^aMjguj)&blM@}N3xCnZZ2IupV$\n" "Language-Team: German\n" "Language: de\n" @@ -5443,6 +5443,9 @@ msgid "Othe&r graphics" msgstr "" #: pysollib/ui/tktile/menubar.py:637 +msgid "&Button icons" +msgstr "" + msgid "&Demo logo" msgstr "&Demo logo" diff --git a/po/fr_pysol.po b/po/fr_pysol.po index b98d4c2c..00341c35 100644 --- a/po/fr_pysol.po +++ b/po/fr_pysol.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: 1.02\n" "Report-Msgid-Bugs-To: \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 \n" "Language-Team: French\n" "Language: fr\n" @@ -5489,6 +5489,9 @@ msgid "Othe&r graphics" msgstr "" #: pysollib/ui/tktile/menubar.py:637 +msgid "&Button icons" +msgstr "" + msgid "&Demo logo" msgstr "Logo de &démo" diff --git a/po/it_pysol.po b/po/it_pysol.po index 278da00b..27d38502 100644 --- a/po/it_pysol.po +++ b/po/it_pysol.po @@ -12,7 +12,7 @@ msgstr "" "Project-Id-Version: it_pysol\n" "Report-Msgid-Bugs-To: \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 \n" "Language-Team: Italiano \n" "Language: it\n" @@ -5554,6 +5554,9 @@ msgid "Othe&r graphics" msgstr "" #: pysollib/ui/tktile/menubar.py:637 +msgid "&Button icons" +msgstr "" + msgid "&Demo logo" msgstr "&Demo logo" diff --git a/po/pl_pysol.po b/po/pl_pysol.po index a0708daf..e5768ebd 100644 --- a/po/pl_pysol.po +++ b/po/pl_pysol.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: PySolFC\n" "Report-Msgid-Bugs-To: \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 \n" "Language-Team: Polish \n" "Language: pl\n" @@ -5505,6 +5505,9 @@ msgid "Othe&r graphics" msgstr "" #: pysollib/ui/tktile/menubar.py:637 +msgid "&Button icons" +msgstr "" + msgid "&Demo logo" msgstr "&Demo logo" diff --git a/po/pt_BR_pysol.po b/po/pt_BR_pysol.po index 39b61999..bbf8c9c3 100644 --- a/po/pt_BR_pysol.po +++ b/po/pt_BR_pysol.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \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 \n" "Language-Team: \n" "Language: pt_BR\n" @@ -5511,6 +5511,9 @@ msgid "Othe&r graphics" msgstr "" #: pysollib/ui/tktile/menubar.py:637 +msgid "&Button icons" +msgstr "" + msgid "&Demo logo" msgstr "&Logo da demo" diff --git a/po/pysol.pot b/po/pysol.pot index 85978441..9f527269 100644 --- a/po/pysol.pot +++ b/po/pysol.pot @@ -5237,6 +5237,9 @@ msgid "Othe&r graphics" msgstr "" #: pysollib/ui/tktile/menubar.py:637 +msgid "&Button icons" +msgstr "" + msgid "&Demo logo" msgstr "" diff --git a/po/ru_pysol.po b/po/ru_pysol.po index 6a182ed9..e58ec416 100644 --- a/po/ru_pysol.po +++ b/po/ru_pysol.po @@ -7,7 +7,7 @@ msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \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 \n" "Language-Team: Russian \n" "Language: ru\n" @@ -5579,6 +5579,9 @@ msgid "Othe&r graphics" msgstr "" #: pysollib/ui/tktile/menubar.py:637 +msgid "&Button icons" +msgstr "" + msgid "&Demo logo" msgstr "Д&емо лого" diff --git a/pysollib/app.py b/pysollib/app.py index faffeb44..aa64d3bd 100644 --- a/pysollib/app.py +++ b/pysollib/app.py @@ -524,12 +524,19 @@ class Application: MfxMessageDialog.img[f] = im # load button images - if 0 and TOOLKIT == 'tk': - dirname = os.path.join('images', 'buttons', 'bluecurve') + MfxDialog.button_img = {} + 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 ( (_('&OK'), 'ok'), + (_('&Select'), 'ok'), (_('&Cancel'), 'cancel'), + (_('&Close'), 'cancel'), (_('&New game'), 'new'), + (_('&Back to game'), 'back'), + (_('&Reset...'), 'reset'), + (_('&Restart'), 'reset'), ): fn = self.dataloader.findImage(f, dirname) im = loadImage(fn) diff --git a/pysollib/options.py b/pysollib/options.py index a7fe48ee..da6c94ee 100644 --- a/pysollib/options.py +++ b/pysollib/options.py @@ -100,6 +100,7 @@ pause_text_style = string redeal_icon_style = string dialog_icon_style = string tree_icon_style = string +button_icon_style = string tile_theme = string default_tile_theme = string toolbar = integer(0, 4) @@ -270,6 +271,7 @@ class Options: ('redeal_icon_style', 'str'), ('dialog_icon_style', 'str'), ('tree_icon_style', 'str'), + ('button_icon_style', 'str'), ('tile_theme', 'str'), ('default_tile_theme', 'str'), ('toolbar', 'int'), @@ -376,6 +378,7 @@ class Options: self.redeal_icon_style = 'modern' self.dialog_icon_style = 'remix' self.tree_icon_style = 'remix' + self.button_icon_style = 'none' self.tile_theme = 'default' self.default_tile_theme = 'default' self.toolbar = 1 # 0 == hide, 1,2,3,4 == top, bottom, left, right diff --git a/pysollib/ui/tktile/menubar.py b/pysollib/ui/tktile/menubar.py index bfa4b898..5a147259 100644 --- a/pysollib/ui/tktile/menubar.py +++ b/pysollib/ui/tktile/menubar.py @@ -88,6 +88,20 @@ def createStatusbarMenu(menubar, menu): def createOtherGraphicsMenu(menubar, menu): 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') submenu = MfxMenu(menu, label=n_('&Demo logo'), tearoff=tearoff) styledirs = os.listdir(data_dir) @@ -326,6 +340,7 @@ class PysolMenubarTkCommon: num_cards=tkinter.BooleanVar(), helpbar=tkinter.BooleanVar(), splashscreen=tkinter.BooleanVar(), + button_icon_style=tkinter.StringVar(), demo_logo=tkinter.BooleanVar(), demo_logo_style=tkinter.StringVar(), pause_text_style=tkinter.StringVar(), @@ -395,6 +410,7 @@ class PysolMenubarTkCommon: tkopt.statusbar.set(opt.statusbar) # tkopt.num_cards.set(opt.num_cards) # tkopt.helpbar.set(opt.helpbar) + tkopt.button_icon_style.set(opt.button_icon_style) tkopt.demo_logo.set(opt.demo_logo) if opt.demo_logo: tkopt.demo_logo_style.set(opt.demo_logo_style) @@ -1946,6 +1962,9 @@ Unsupported game for import. def mOptStatusbarConfig(self, w): 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): 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.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): if self._cancelDrag(break_pause=False): return