GNOME Bugzilla – Bug 570939
Changing GtkSourceStyle properties
Last modified: 2021-07-05 10:59:58 UTC
At the moment GtkSourceStyle properties are construct only, which makes it impossible to override styles with user configurable settings. Am I correct in understanding that at the moment there is no way of changing a style (or style scheme for that matter) programmatically?
Yes, they are made construct only intentionally. Moreover, they are actually broken so you can't really use them at all, even for construction.
So how can this problem be resolved. I need a way to alter styles programmatically.
if gtksourcestyle are immutables the right place to programmatically change the style looks like gtksourcestylescheme... I guess we need a way to set a style on a stylescheme and maybe even one to introspect the current styles set on a scheme
To me it doesn't make much sense to 'set' a style, wouldn't this involve creating a whole new object, setting all the properties, and calling some API on the scheme to apply this new style? If these GtkSourceStyle objects are already broken, shouldn't we fix them? What exactly is the problem here...
you have to think of a style as "blue" or "green" (well, only slightly more complicated becuse it can be "blue+bold+whitebackground" etc): you cannot change blue into green, but you can say that a particular context should be "blue" or "green", that's what I meant by saying that we miss an api to set the style that shuould be associated to a context.
Ok, that might be useful for some things, but it is not what I want. What you describe is more about changing the language file imho, and not about changing the style scheme.
After some more thinking, such an API would allow me to solve the issue I'm having now, but I do think that we should be able to do both.
Jesse what about this?
I don't know. I don't know enough about the issue of GtkSourceStyle to tell what will be a good solution. I still think we should make it such that we can dynamically alter a style object without any problems.
GNOME is going to shut down bugzilla.gnome.org in favor of gitlab.gnome.org. As part of that, we are mass-closing older open tickets in bugzilla.gnome.org which have not seen updates for a longer time (resources are unfortunately quite limited so not every ticket can get handled). If you can still reproduce the situation described in this ticket in a recent and supported software version, then please follow https://wiki.gnome.org/GettingInTouch/BugReportingGuidelines and create a new ticket at https://gitlab.gnome.org/GNOME/gtksourceview/-/issues/ Thank you for your understanding and your help.