Closed gcasa closed 11 months ago
I think that this might give some clue as to how to do this in the backend. I am not sure that shadows necessarily need layers to work. https://stackoverflow.com/questions/30630280/how-do-i-create-a-circular-shadow-effect-with-cairo
Also of interest MIGHT be... https://github.com/rcairo/rcairo/blob/master/lib/cairo/context/blur.rb
I know these examples are in different languages, but they are both using cairo, so I wanted to note them here.
It seems as though the keys being used are these...
[heron@nomad Base.lproj] % strings MainMenu.nib | grep -i shadow [0]
NSShadowHoriz
IBNSShadowedSymbolConfiguration
NSShadowVert
NSViewShadow
NSShadowBlurRadius
NSShadowColor
NSShadow_Test
NSShadow_Test
Quit NSShadow_Test
Quit NSShadow_Test
About NSShadow_Test
About NSShadow_Test
NSShadow_Test Help
NSShadow_Test Help
Hide NSShadow_Test
Hide NSShadow_Test
NSShadow_Test
NSShadow_Test
NSShadow
The new NIBArchive format is proving to be a menace at analyzing nib files for keys... but since we can read xib files it is not a problem, but it is a format we might want to consider looking at in the future. GC
Yet more info about blur... https://discourse.gnome.org/t/cairo-gaussian-blur-for-shadows/2174
Okay, so now I have got everything decoding for the NSShadow from the XIB properly. I am going to work on the backend now. Some changes might be needed in libs-gui, but I doubt it.
Let me try to explain this once more:
[NSShadow set]
. After that you just need to implement that method or rather the actual handling of the shadow while drawing in the Cairo graphics context in the backend.I would suggest to merge this PR here separately and not wait until you have the complete implementation in place.
Okay. Thank you for the great input. I will change this PR to ready and if you find it suitable, then please approve.
I will open another PR for the shadow work in GSGraphicsContext.
@fredkiefer please approve if it's okay to merge. I am in the process of looking at what is involved on the backend.
https://github.com/gnustep/libs-gui/pull/232 PR for set method on libs-gui
Looks mostly OK, but the RETAIN issue needs to be resolved. You could also use the setter instead.
I added both retains, I think using the setter is cleaner. I am going to go ahead and make that change. Give me a moment.
I changed the code to use the setter, thanks. :). Merging.
Forgot to add the NSView.m file to the commit... I will correct it on master. Sorry.
Oh... it got them. :). Nevermind.
Please see the bug here: https://github.com/gnustep/libs-gui/issues/217