After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 746163 - Custom register colors (table rows) not recognized from .gtkrc-2.0.gnucash file
Custom register colors (table rows) not recognized from .gtkrc-2.0.gnucash file
Status: RESOLVED FIXED
Product: GnuCash
Classification: Other
Component: Register
2.6.4
Other Linux
: Normal minor
: ---
Assigned To: gnucash-ui-maint
gnucash-ui-maint
Depends on:
Blocks:
 
 
Reported: 2015-03-13 15:37 UTC by Andreas Eibach
Modified: 2018-06-29 23:39 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Andreas Eibach 2015-03-13 15:37:20 UTC
As GnuCash 2.x is theme-based (unlike 1.x where it was possible to select 1st/2nd table row without much fuss), custom modifications to colors must be supplied via a .gtkrc-2.0.gnucash file in $HOME.

Been there, done that. But colors are obviously IGNORED.

This is the original line, nicked from
https://raw.githubusercontent.com/Gnucash/gnucash/master/doc/gtkrc-2.0.gnucash

(outdated??)

# The color of the first line/transaction in a register.
style "gnc-register-primary"
{
base[NORMAL] = "#DEB9BF"
base[SELECTED] = "#EF98FF"
}
# The color of the second line/transaction in a register.
style "gnc-register-secondary"
{
base[NORMAL] = "#FFDAF6"
base[SELECTED] = "#EF98FF"
}
widget "GncMainWindow.*.header_color"    style : highest "gnc-register-header"
widget "GncMainWindow.*.primary_color"   style : highest "gnc-register-primary"
widget "GncMainWindow.*.secondary_color" style : highest "gnc-register-secondary"
widget "GncMainWindow.*.split_color"     style : highest "gnc-register-split"

Now I replaced the #DE by #00 and did the same with #FF to witness some changes.
Nothing happened.
Same ugly poison-green, same ugly smudgy-yellowish-white.

HOWEVER: font change *was* respected and now uses a very small font, giving me a great overview which was 1,5 pagefuls before. Nice.
Just changes in the colors are not respected.
I suspect a possible mismatch in the widget... lines (old versions vs. new versions?)
Comment 1 Geert Janssens 2015-03-19 15:05:41 UTC
Thank you for your report.

I fixed several bugs with respect to the register colors for gnucash 2.6.4. In my testing I could change the colors successfully.

There is probably some confusion going on here. So let me give some background:

By default gnucash will use the green and yellow colors regardless of any other colors being defined either system wide or in a gtkrc file.

This can be overridden by enabling the following option:
Edit->Preferences->Register->Use system theme colors

If that option is enabled, gnucash will use whatever colors gtk dictates for the register. If set via a gtkrc file, those settings will be used. In the absence of a gtkrc file, the system theme colors will be used (which are different still from the gnucash default green/yellow).

(In reply to Andreas Eibach from comment #0)
> Same ugly poison-green, same ugly smudgy-yellowish-white.

That suggests you didn't enable the option mentioned above. Can you try that and report back ?
Comment 2 Andreas Eibach 2015-05-27 13:30:45 UTC
What sense would that make?

I simply _don't want_ system colors here. I'd like to use a 3rd set of colors, which has neither anything to do with my system/theme colors nor with gnucash's default colors.

That is the actual point of having a .gtkrc-2.0.gnucash config file: overriding system colors as well as gnucash's own colors, defining a custom set that is especially used for gnucash and not anywhere else.
Comment 3 Geert Janssens 2015-05-27 13:51:52 UTC
(In reply to Andreas Eibach from comment #2)
> What sense would that make?
> 
The only sense it makes is that is has been programmed that way. I was merely trying to help you solve your immediate problem, not questioning the original design decisions behind this code.

> I simply _don't want_ system colors here. I'd like to use a 3rd set of
> colors, which has neither anything to do with my system/theme colors nor
> with gnucash's default colors.
> 

Perhaps I wasn't clear: if you want to override *any* color you first have to tell gnucash to follow the system color scheme. *Then* gnucash will read whatever colors you specify in a .gtkrc-2.0.gnucash config file as well.

I couldn't read from your reply whether you actually tried this or not.

> That is the actual point of having a .gtkrc-2.0.gnucash config file:
> overriding system colors as well as gnucash's own colors, defining a custom
> set that is especially used for gnucash and not anywhere else.

Perhaps. It wasn't programmed this way however for reasons I don't know. Can you provide me with a reference that confirm this is the expected behaviour ? That would certainly make for a stronger case to changed this in gnucash.


What is it you want to achieve at this point ? Get your colors as you want them or make gnucash follow the .gtkrc-2.0.xyz override convention ?

The former should be possible with my recommendations. If not that's a bug.

If you're after the latter, then I'll reclassify this as an enhancement request. I don't expect this to get improved until the register gets a decent rewrite though.
Comment 4 Andreas Eibach 2015-05-28 11:38:29 UTC
>not questioning the original design decisions behind this code.
But this is what is about to become necessary, IMO. 

>Perhaps I wasn't clear: if you want to override *any* color you first have to tell gnucash to follow the system color scheme.

No, it's _not_ that you weren't clear. It's the GUI which is so doggone confusing.

How can a user know that he has to enable "use system colors" (meaning system _default_ colors, e. g. from Openbox theme) if he wants to use CUSTOM colors from this .gtkrc file?

The whole thing needs to be inverted in sense.

First attempt...
- i. e. renaming "Use system colors" in "Use system or custom colors" 

is weird and confusing as well.

BUT the second attempt may make more sense:
- get rid of the "system colors" for good!!
INSTEAD

Make it an option in the negative [x] Don't use GnuCash built-in colors

You get it?
When this option is enabled, it will stand for _either_ system or custom colors, depending on whether a .gtkrc is present or not.
Comment 5 Geert Janssens 2015-05-31 08:10:53 UTC
That's an excellent suggestion.

I have applied a patch to improve the preference's label
and tooltip to reduce the amount of confusion.

It will appear in the next stable release.

Thanks for your input.
Comment 6 Andreas Eibach 2015-06-01 06:05:07 UTC
I return the thanks for resolving this issue in the most effective way.

Besides, [x] Override GnuCash built-in colors would be a great wording as well. Just thought of it too late...
Comment 7 John Ralls 2018-06-29 23:39:22 UTC
GnuCash bug tracking has moved to a new Bugzilla host. This bug has been copied to https://bugs.gnucash.org/show_bug.cgi?id=746163. Please update any external references or bookmarks.