Organizing tasks to work on, New Features Ideas, Building LCS & LCB Libraries & Widgets, Redecorating and Modifying the IDE, Hacking / Editing Tools, Compiling the Engine from Source, etc.
Task 4 of a list of ideas for a helper stack published on this forum is :
4) Handler that can take a stack name or a list of controls / objects references, and then iterate through all the controls and the text of any controls that removes any color styling on any text fields and/or text chunks color settings, making the textColor, foreGroundColor, backGroundColor, etc. 'empty', but on 'button' controls it would set all to none except for the foreground to black. Such a handler would be very helpful for quickly making pre-existing stacks more macOS native-darkMode compatible.
I have written a stack that I hope is meeting half the requirement: I have not implemented the parsing of a list of controls yet but want to see if I am heading in the write direction. I will try and attach the stack and a dummy test stack to this post. The test stack contains sub-stacks and cards populated with colourful controls. Please try the stack and let me know of the changes that are needed.
The list of stacks is built using a handler in the main stack but other handlers are stored on the card.
What I meant by object list/text chunks list was the sort of list you' might get from checking the selectedObjects or the selectedChunks properties while multiple things are selected:
widget id 1903 of card id 1002 of stack "/Users/paul/Desktop/CommunityWidgets.oxtstack"
group id 2563 of card id 1002 of stack "/Users/paul/Desktop/CommunityWidgets.oxtstack"
-- chunk expression
line 1 to 3 of fld 2 of card id 1002 of stack "/Users/paul/Desktop/CommunityWidgets.oxtstack"
char 15 to 21 of field 3 of card id 1002 of stack "/Users/paul/Desktop/CommunityWidgets.oxtstack"
I'm not sure if chunk expression processing is really even needed, as this produces the desired effect.
Anyway I already have a handler that strips Styled Text RTGText and HTMLText from the selectedChunk of text to make 'Plain Text' default font / inherit ('Use Owner's..." in revMenuBar)
So I think you got it, it should probably ignore Styled Text within a field as it does. I tested on a few stacks I had that didn't look OK in macOS darkMode due to back/forground colors set on objects an this did the trick on them nicely.
Thanks!
Screen Shot 2024-08-14 at 3.06.24 AM.png (261.06 KiB) Viewed 5655 times
Screen Shot 2024-08-14 at 3.12.38 AM.png (278.18 KiB) Viewed 5655 times
I just wanted to 'bump' this thread, as a reminder, I want to add this functionality to the IDE text menu, because currently selecting 'Plain' for text style in the Text menu does not strip all formatting from text. Which I suppose is really a 'Bug'.
It can be particularly annoying when you paste in styled text that was copied from a Web page, in certain situations individual word chunks or lines of text will have a 'background fill color', the fills are of the text-chunks bounding rectangles, not the text field's rectangle, and that cannot be removed by simply selecting the text and then selecting 'Plain' from the IDE's text menu (which was the original reason why I started building my 'Text palette'). You have to instead re-paste the text but use 'Paste Unformatted' menu to paste.