Bug 792809 Add a register foreground CSS class

With the current setup when a dark theme is used with existing register
colours the text is hard to read as the dark theme may of changed the
text colour to white so with these changes the text is always black
unless they choose not to use the built in colours.
This commit is contained in:
Robert Fewell 2018-01-30 15:28:51 +00:00 committed by Geert Janssens
parent 3c13f565d3
commit 84a1e81016
5 changed files with 31 additions and 9 deletions

View File

@ -37,6 +37,11 @@
@define-color register_secondary_bg_color #F6FFDA;
@define-color register_split_bg_color #EDE7D3;
@define-color register_cursor_bg_color #FFEF98;
@define-color register_fg_color black;
*.register-foreground {
color: @register_fg_color;
}
*.register-header {
background-color: @register_header_bg_color;
@ -74,6 +79,15 @@
background-color: mix (@register_cursor_bg_color, grey, 0.2);
}
/* Change font color by mixing with grey */
.lighter-grey-mix {
color: mix (currentColor, grey, 0.8);
}
.darker-grey-mix {
color: mix (currentColor, grey, 0.2);
}
/* Some tweaks for the about dialog */
dialog#GnuCash > box > box > label
{

View File

@ -28,6 +28,11 @@ cursor button {
@define-color register_secondary_bg_color #F6FFDA;
@define-color register_split_bg_color #EDE7D3;
@define-color register_cursor_bg_color #FFEF98;
@define-color register_fg_color black;
*.register-foreground {
color: @register_fg_color;
}
*.register-header {
background-color: @register_header_bg_color;
@ -65,6 +70,15 @@ cursor button {
background-color: mix (@register_cursor_bg_color, grey, 0.2);
}
/* Change font color by mixing with grey */
.lighter-grey-mix {
color: mix (currentColor, grey, 0.8);
}
.darker-grey-mix {
color: mix (currentColor, grey, 0.2);
}
/* Some tweaks for the about dialog */
dialog#GnuCash > box > box > label
{

View File

@ -36,15 +36,6 @@
@define-color default-color currentColor;
@define-color negative-numbers rgb(75%, 0%, 0%);
/* Change font color by mixing with grey */
.lighter-grey-mix {
color: mix (currentColor, grey, 0.8);
}
.darker-grey-mix {
color: mix (currentColor, grey, 0.2);
}
/* Register2 grid lines color */
.register2_grid_lines {
border-color: black;

View File

@ -827,6 +827,7 @@ gnc_item_edit_new (GnucashSheet *sheet)
// Get the CSS space settings for the entry
stylectxt = gtk_widget_get_style_context (GTK_WIDGET(item_edit->editor));
gtk_style_context_add_class (stylectxt, "register-foreground");
gtk_style_context_get_padding (stylectxt, GTK_STATE_FLAG_NORMAL, &padding);
gtk_style_context_get_margin (stylectxt, GTK_STATE_FLAG_NORMAL, &margin);
gtk_style_context_get_border (stylectxt, GTK_STATE_FLAG_NORMAL, &border);

View File

@ -2451,6 +2451,8 @@ gnucash_get_style_classes (GnucashSheet *sheet, GtkStyleContext *stylectxt,
gtk_style_context_add_class (stylectxt, "negative-numbers");
field_type -= COLOR_NEGATIVE;
}
else
gtk_style_context_add_class (stylectxt, "register-foreground");
switch (field_type)
{