[GNC] Change text color

Adrien Monteleone adrien.monteleone at lusfiber.net
Mon Jul 30 18:04:30 EDT 2018


This is proving to be more difficult than it probably should be. Unfortunately, there is very little documentation on using GtkInspector, and it seems the tool was designed for people who are doing the coding of the app and are ‘inyoursleep’ familiar with the GUI elements and objects used.

However, I’ve managed something that might be useful.

Try:

#account_tree {
  color: *your-color-here*;
}

This should change the base color of the text for the entire tree, including the column headers.

You can use other common css rules here such as background-color, font-family, font-size, letter-spacing, padding, etc.

The account names themselves (and their related text in sibling columns) are likely either class “label” or “GtkLabel” (depending on Gtk version, 3.20 is the former, 3.18 the latter) but specifying this class instead of the ID for the entire tree doesn’t seem to do anything. (I’m on 3.18 using Ubuntu 16.04, but I tried both with no result) You might have better luck. Ideally, I’d rather style classes than IDs, especially since in this case, the ID includes the column headers.

An additional complication is that the tree-view has identical nodes for pretty much everything under it and the inspector doesn’t seem to let me select any particular account label with any specificity or figure out which node in the tree is which one I’m looking at on screen. (I understand specificity for the web, but building a unique selector seems a little different in GTK) I can only select the entire tree at once.

The above might also pose an issue because a selected account would need different background and font colors. The inspector is supposed to show a ’selected’ node that might be useful here, but since I can't figure out which child GtkLabel belongs to what, I’m not seeing that particular ’selected’ node.  I’ll keep trying and poking around though.

Hope that helps.

Regards,
Adrien

> On Jul 26, 2018, at 7:27 PM, GT-I9070 H <gti9070h at gmail.com> wrote:
> 
> One file for everything is better.
> 
> In my .ini file there is only one section and one line to change the text size of the accounts page because it was the only method I found and worked, the .css method for this fails. For everything else I use .css, I've customized the registry with .css.
> 
> For tabs I already got change color and font.
> 
> I had already done searches on the list and I was not lucky.
> 
> Of course we can wait, without problems, meanwhile I'll keep trying.
> 
> 
> Regards
> GTI
> 




More information about the gnucash-user mailing list