Page 3 of 12
Re: OXT Lite Moving Forward
Posted: Sun Nov 05, 2023 8:57 pm
by tperry2x
Haha, that's probably my Dad's influence. He's from Essex

I wasn't born there. I'm a norfolk boy. Blast me, he's a rumm'n.
Although, to be classed a local, at least 4 generations would have had to live here. So I'm a strange old mix I suppose.
Re: OXT Lite Moving Forward
Posted: Sun Nov 05, 2023 9:08 pm
by tperry2x
Oh yeah, that is weird. I'd expected your windows to be in dark mode, so I have no idea what's happening there.
This better explains where I'm at with Mac theming:

- theming.png (27.21 KiB) Viewed 3659 times
This is because I can't change the background colour on the popup menu button. It plain won't let me, which is most infuriating.
Re: OXT Lite Moving Forward
Posted: Sun Nov 05, 2023 9:13 pm
by richmond62
Neither a log out or a restart returned my menu bar to Light mode!
Sorry: 11 pm round these parts: off to have a bath.
Re: OXT Lite Moving Forward
Posted: Sun Nov 05, 2023 9:19 pm
by tperry2x
richmond62 wrote: ↑Sun Nov 05, 2023 9:13 pm
Neither a log out or a restart returned my menu bar to Light mode!
I've seen this before... [has a rummage around various notes]...
You could try these terminal commands:
Code: Select all
defaults write -g NSRequiresAquaSystemAppearance -bool No
then log out.
If that doesn't work, try:
Code: Select all
defaults delete -g NSRequiresAquaSystemAppearance
then log out.
Log back in and see if Dark mode will let you reapply it again.
Re: OXT Lite Moving Forward
Posted: Sun Nov 05, 2023 9:47 pm
by richmond62
That makes me feel like Napoleon: "Not tonight, Josephine."
As have to be up early tomorrow, get my Primary School smile set out of the fridge, and it's 'Hey-ho' for the joys of Conditional sentences.
However: having a longish lunch break tomorrow I will see what happens on MacOS 14 Sonoma.
Re: OXT Lite Moving Forward
Posted: Mon Nov 06, 2023 8:31 am
by richmond62
So: here I am in front of my 2018 Mac Mini running MacOS 14/2 beta something-or-other.
Lightmode still playing 'silly buggers' with the Men Bar staying Dark come what may.
BUT 0.93 IS switching into Dark Mode after about 30 seconds!
-

- SShot 2023-11-06 at 10.28.23.png (51.97 KiB) Viewed 3649 times
-
BUT this is problematic.
-

- SShot 2023-11-06 at 10.32.13.png (90.12 KiB) Viewed 3648 times
-
The drop-down is super.
Re: OXT Lite Moving Forward
Posted: Mon Nov 06, 2023 8:35 am
by richmond62
Richmond Fantasy Mode cranks up out of control:
PseudoCode:
Code: Select all
on openStack
if Mode is dark then
set the textColor of btn "Plonk" to black
end if
end openStack
Re: OXT Lite Moving Forward
Posted: Mon Nov 06, 2023 8:41 am
by richmond62
If this is true, then why is that card not hidden away?
-

- SShot 2023-11-06 at 10.40.40.png (100.82 KiB) Viewed 3648 times
Re: OXT Lite Moving Forward
Posted: Mon Nov 06, 2023 11:14 am
by tperry2x
richmond62 wrote: ↑Mon Nov 06, 2023 8:41 am
If this is true, then why is that card not hidden away?
I'm only going by what was there before, so I just removed line 2 of that dialog which mentioned buying livecode, and then made the text font larger. I also took away the link, so clicking the banner doesn't go to their purchase page.
I know for certainty there was a period where Apple wouldn't allow anything on their app store that hadn't been produced from any other source than via xCode.
I'm not sure if that's still true, but then LC 9.6.3 doesn't seem to have build targets for anything past iOS8. It would be lovely to get this updated so it's aware of iPadOS / iPhone OS (or iOS 11 at least).
I'd also like to keep the iOS standalone settings intact for another reason: I'm interested to know how iOS standalones will run on the desktop ARM version of MacOS, as they can be double-clicked like any normal Mac desktop app. This would prove a useful route into building apps for Arm macs in the future.
Re: OXT Lite Moving Forward
Posted: Mon Nov 06, 2023 11:20 am
by tperry2x
richmond62 wrote: ↑Mon Nov 06, 2023 8:35 am
Code: Select all
on openStack
if Mode is dark then
set the textColor of btn "Plonk" to black
end if
end openStack
You can detect if the OS is in light or dark mode with:
Code: Select all
send tDarkLightCheck to stack "revMenuBar" in 1 tick
It then applies Paul's
IDEToDarkMode or
IDEToLightMode
as taken from: /Toolset/libraries/revideextensionlibrary.livecodescript
as appropriate.
It then looks in/Toolset/home.livecodescript and performs manual colour overrides if needed (much like your sudocode)
Code: Select all
on IDEToLightMode
lock screen
if the platform contains "linux" then tApplyTheme_Linux_Light
if the platform contains "mac" then tApplyTheme_Mac_Light
if the platform contains "win" then tApplyTheme_Win_Light
unlock screen
end IDEToLightMode
on IDEToDarkMode
lock screen
if the platform contains "linux" then tApplyTheme_Linux_Dark
if the platform contains "mac" then tApplyTheme_Mac_Dark
if the platform contains "win" then tApplyTheme_Win_Dark
unlock screen
end IDEToDarkMode
BUT: because linux doesn't need any special theming, it actually just removes all custom colour properties on everything. It will run
tApplyTheme_nullify for Linux.
If the platform turns out to be Mac, then it runs the handler setAppToDarkMode in
/Toolchain/modules/lci/org.openxtalk.library.macosnativeapptools.lci, which is where Paul's
org.openxtalk.library.macosnativeapptools/macOStools.lcb comes in.
Anyway, the short version is, you can manually try toggling between all of this by using:
Code: Select all
send IDEToDarkMode to stack "home"
or
Code: Select all
send IDEToLightMode to stack "home"
You can indeed set colour properties manually, but it should really pick up on this automatically without having to mess around with foreground and background colour settings.
Also, you can set that behaviour on a normal button. You can't set it on the "option menu" object, which is what I'm banging on about here
https://www.openxtalk.org/forum/viewtop ... 4461#p4461
Please feel free to have a dabble with my appearance stack and see what results you get. Thanks for testing!
Turning the sudocode into script, it's something like:
Code: Select all
lock screen
-- you can force colour overrides with
put 255,255,255 into tNewForegroundCol -- white
put 31,31,31 into tNewBackgroundCol -- dark grey
-- set to all windows
put the mainstacks & return & the openstacks into tStackList
put 0 into tcount
repeat the number of lines in tStackList
add 1 to tcount
if there is a stack (line tcount of tStackList) then
set the backgroundColor of stack (line tcount of tStackList) to tNewBackgroundCol
set the foregroundColor of stack (line tcount of tStackList) to tNewForegroundCol
end if
end repeat
put "" into tStackList
-- anything else specifically? (specify in this format!) -- this is ugly, but it works
put "set the backgroundColor of card " & QUOTE & "main" & QUOTE & " of stack " & QUOTE & "revSETemplate" & QUOTE & " of stack " & QUOTE & "revNewScriptEditor" & QUOTE & " to tNewBackgroundCol" into line (the number of lines in tStackList +1) of tStackList
put "set the foregroundColor of card " & QUOTE & "main" & QUOTE & " of stack " & QUOTE & "revSETemplate" & QUOTE & " of stack " & QUOTE & "revNewScriptEditor" & QUOTE & " to tNewForegroundCol" into line (the number of lines in tStackList +1) of tStackList
set the cAppearanceBackgroundCol of stack "revPreferences" to tNewBackgroundCol
set the cAppearanceForegroundCol of stack "revPreferences" to tNewForegroundCol
filter lines of tStackList without empty
do tStackList
unlock screen
Which is also in that appearance stack I've just attached.
Re: OXT Lite Moving Forward
Posted: Mon Nov 06, 2023 3:45 pm
by richmond62
Thanks for testing.
Busy testing my patience at the moment: tomorrow morning!
-

- bread_And_Cheese.jpg (189.67 KiB) Viewed 3622 times
Re: OXT Lite Moving Forward
Posted: Mon Nov 06, 2023 8:12 pm
by tperry2x
Okay, one thing that's just occurred to me.
Can you also download the new prefs stack here, and replace the existing one in your build.
viewtopic.php?p=4470#p4470
The reason is that as well as containing the bug fix, it gets rid of any manually set colour the stack previously had.
Re: OXT Lite Moving Forward
Posted: Tue Nov 07, 2023 8:30 am
by richmond62
Well, as a real sadist, as it is 8.30 in England: here's something to make you sputter your coffee all over the place:
-

- SShot 2023-11-07 at 10.28.35.png (182.79 KiB) Viewed 3598 times
-

- SShot 2023-11-07 at 10.27.55.png (207.74 KiB) Viewed 3597 times
-
Those buttons . . .
Re: OXT Lite Moving Forward
Posted: Tue Nov 07, 2023 8:39 am
by richmond62
Something wrong with inheritance, methinks:
Code: Select all
on mouseUp
set the backGroundColor of this stack to 50,50,50
set the foreGroundColor of this stack to 217,217,217
end mouseUp
-

- SShot 2023-11-07 at 10.38.24.png (28.99 KiB) Viewed 3595 times
Re: OXT Lite Moving Forward
Posted: Tue Nov 07, 2023 8:59 am
by richmond62
And HERE is why you got 'things' wrong:
Nifty thing here:
https://htmlcolorcodes.com/
-

- SShot 2023-11-07 at 11.00.31.png (33.17 KiB) Viewed 3593 times
-
Code: Select all
on mouseUp
set the backGroundColor of this stack to empty
set the foreGroundColor of this stack to empty
set the backGroundColor of this stack to 42,117,16
set the foreGroundColor of this stack to 42,117,16
end mouseUp
NOW I shall HACK YOUR STACK

Re: OXT Lite Moving Forward
Posted: Tue Nov 07, 2023 9:12 am
by richmond62
Ouch: does somethings successfully, but hoses 2 of your buttons:
-

- SShot 2023-11-07 at 11.05.01.png (32.02 KiB) Viewed 3593 times
-
OK:
Code: Select all
if tAppearanceMode contains "dark" then
-- dark mode
put "0,0,0" into tNewBackgroundCol
put "255,255,255" into tNewForegroundCol
Makes your 'bottom' buttons lose their texts.
Code: Select all
if tAppearanceMode contains "dark" then
-- dark mode
put "0,0,0" into tNewBackgroundCol
put "0,0,0" into tNewForegroundCol
Makes your 'bottom' buttons readable, but makes you 2 top buttons vanish.
Told you, you'd choke on your coffee.
This WAS BECAUSE your 2 top buttons had '3D' turned off:
-

- SShot 2023-11-07 at 11.19.43.png (34.54 KiB) Viewed 3590 times
-
The only shag about this is if the end user decides they don't like 3D buttons.

Re: OXT Lite Moving Forward
Posted: Tue Nov 07, 2023 11:11 am
by richmond62
This is, also, a load of old cobblers (resulting from my hack):
-

- SShot 2023-11-07 at 13.10.15.png (59.52 KiB) Viewed 3583 times
-
I cannot work out how to set the backGroundColor and the textColor of either fields or buttons globally.
Re: OXT Lite Moving Forward
Posted: Tue Nov 07, 2023 8:45 pm
by tperry2x
Hi Richmond.
Sorry, been out 'of it' today - it's exams time at the school, only mocks, but means I'm really busy and don't have much time to spend on Oxt for a while.
Thanks for your testing. To really fry your noggin, try with adding a popup menu. (Which can't be themed).
Buttons and fields also change when Paul's dark mode plugin loads, but not by much.
It's like the MacOS theme doesn't agree with Livecode's behaviour. It does change the buttons significantly between MacOS versions (see in MacOs 10.9 for comparison), but still not correct.
Makes me want to use 'sudo buttons' - pngs which match the system theme. And just drop those in instead depending on MacOS version
Re: OXT Lite Moving Forward
Posted: Wed Nov 08, 2023 8:35 am
by richmond62
I do not envy you: being my own boss, and running a private language school (i.e. EFL to children between 6 and 17), I have no official exams to fuss about (90% of those who last 10 years go onto take the Cambridge Advanced test of English, which they all pass).
The INHERITANCE problem is a very real problem, and I have brought it up several times: the latest of which is here:
https://forums.livecode.com/viewtopic.php?f=7&t=38670
Fields and Buttons generally do NOT inherit the backGroundColor from the stack or the card!
So Theming has to be effected in some other way if one wants to transform the whole IDE rather than just the MenuBar and the Tools.
The problem is that while LiveCode and following is object-based it is not object-oriented, so strict inheritance is not present, and I do not think there is a way to enforce it.
And, after a "fool about" (It being Wednesday, my non-teaching day, Hip, Hip, Hooray), I found that a field will have what it termed its '
effective backGroundColor' inherited from the stack or the card, but 'effective' is singularly ineffective as the flaming field stays white!
textColor IS inherited.
Re: OXT Lite Moving Forward
Posted: Wed Nov 08, 2023 9:01 am
by richmond62
Re
Buttons:
textColor and
backGroundColor ARE inherited IF the buttons do NOT have 3D set to true!
However, if one really wants:
-

- Screenshot 2023-11-08 at 11.00.19.png (114.17 KiB) Viewed 3560 times
-
Button "Cheese" has its 3D set to true!
HOWEVER ("and there's the rub"), I wonder how one can set up code to set the
backGroundColor of
ALL OBJECTS (present or potential) to their
effective backGroundColor(s) . . .
Of course at this point one might want to go in search of a
template button and a
template field: alternatively one might choose to go down to the "Why Not?" and sink several jars of heavy beer.
-

- WhyNot.jpg (7.35 KiB) Viewed 3553 times