by OpenXTalkPaul » Sat Feb 03, 2024 6:32 pm
To Emulate OS UI Kits or Not To Emulate OS UI Kits, that is the question, I'm pondering before the rest of my weekend gets busy...
I was trying to emulate the appearance of macOS Sonoma pup up menu using an Popup menu 'classic' control and changing its properties, which I had to do dynamically due to limitations with what can be done with that type of control. You can get close to the way a native popup menu looks but be not close enough IMO. A widget could be set up that could probably come much closer to matching native controls, FFI could be used to use an actual native popup but then you should still need to write code to do approximation appearance, like a visual proxy for the 'native' look and feel to draw while you're in Edit mode or looking at the stack on another platform for which that 'native' widget is not native.
One of the things about darkMode on macOS is that
system colors are dynamic. Why I mean is the highlight color you pick for accent Color in the system menu, lets say you pick a florecent purple in darkMode, when the mode is toggled back to lightMode and you look at that color in the system prefs panel, it's now going to be a dark purple instead of a florescent purple. This color change is done automatically to maintain readability on the reversed color scheme.
So how do we know what colors our apps should be using if they're custom rendering controls (which OXT does) for things like a button's foreColor, textColor, hilitecolors, focus or accent color, etc.? I'm not sure if there's another way to get that dynamic color information from the system, but there is definately a way to get it using Objective C:
https://developer.apple.com/documentati ... guage=objc
I'll try to sneak in some time later to get ChatGPT to write the binding strings for us.
To Emulate OS UI Kits or Not To Emulate OS UI Kits, that is the question, I'm pondering before the rest of my weekend gets busy...
I was trying to emulate the appearance of macOS Sonoma pup up menu using an Popup menu 'classic' control and changing its properties, which I had to do dynamically due to limitations with what can be done with that type of control. You can get close to the way a native popup menu looks but be not close enough IMO. A widget could be set up that could probably come much closer to matching native controls, FFI could be used to use an actual native popup but then you should still need to write code to do approximation appearance, like a visual proxy for the 'native' look and feel to draw while you're in Edit mode or looking at the stack on another platform for which that 'native' widget is not native.
One of the things about darkMode on macOS is that [b]system[/b] colors are dynamic. Why I mean is the highlight color you pick for accent Color in the system menu, lets say you pick a florecent purple in darkMode, when the mode is toggled back to lightMode and you look at that color in the system prefs panel, it's now going to be a dark purple instead of a florescent purple. This color change is done automatically to maintain readability on the reversed color scheme.
So how do we know what colors our apps should be using if they're custom rendering controls (which OXT does) for things like a button's foreColor, textColor, hilitecolors, focus or accent color, etc.? I'm not sure if there's another way to get that dynamic color information from the system, but there is definately a way to get it using Objective C:
https://developer.apple.com/documentation/appkit/nscolor/ui_element_colors?language=objc
I'll try to sneak in some time later to get ChatGPT to write the binding strings for us.