Fix default foreground colour in list views for dark themes

Issue #7749.
This commit is contained in:
Nick Hall 2017-12-18 23:39:36 +00:00
parent fe289da983
commit 84e76de2b1
11 changed files with 19 additions and 17 deletions

View File

@ -67,7 +67,7 @@ from ..dialog import QuestionDialog, QuestionDialog2, ErrorDialog
from ..editors import FilterEditor
from ..ddtargets import DdTargets
from ..plug.quick import create_quickreport_menu, create_web_connect_menu
from ..utils import is_right_click
from ..utils import is_right_click, rgb_to_hex
from ..widgets.interactivesearchbox import InteractiveSearchBox
#----------------------------------------------------------------
@ -281,11 +281,12 @@ class ListView(NavigationView):
function because we don't want to set the color of untagged rows.
'''
fg_color = model.get_value(iter_, model.color_column())
#for color errors, typically color column is badly set
if fg_color:
if not fg_color:
context = self.list.get_style_context()
color = context.get_color(Gtk.StateFlags.ACTIVE)
fg_color = rgb_to_hex((color.red, color.green, color.blue))
renderer.set_property('foreground', fg_color)
else:
LOG.debug('Bad color set: ' + str(fg_color))
def set_active(self):
"""

View File

@ -139,7 +139,7 @@ class CitationBaseModel:
tag_handle = data[0]
cached, tag_color = self.get_cached_value(tag_handle, "TAG_COLOR")
if not cached:
tag_color = "#000000000000"
tag_color = ""
tag_priority = None
for handle in data[COLUMN_TAGS]:
tag = self.db.get_tag_from_handle(handle)
@ -300,7 +300,7 @@ class CitationBaseModel:
tag_handle = data[0]
cached, tag_color = self.get_cached_value(tag_handle, "TAG_COLOR")
if not cached:
tag_color = "#000000000000"
tag_color = ""
tag_priority = None
for handle in data[COLUMN2_TAGS]:
tag = self.db.get_tag_from_handle(handle)

View File

@ -208,7 +208,7 @@ class EventModel(FlatBaseModel):
tag_handle = data[0]
cached, tag_color = self.get_cached_value(tag_handle, "TAG_COLOR")
if not cached:
tag_color = "#000000000000"
tag_color = ""
tag_priority = None
for handle in data[COLUMN_TAGS]:
tag = self.db.get_tag_from_handle(handle)

View File

@ -220,7 +220,7 @@ class FamilyModel(FlatBaseModel):
tag_handle = data[0]
cached, tag_color = self.get_cached_value(tag_handle, "TAG_COLOR")
if not cached:
tag_color = "#000000000000"
tag_color = ""
tag_priority = None
for handle in data[13]:
tag = self.db.get_tag_from_handle(handle)

View File

@ -171,7 +171,7 @@ class MediaModel(FlatBaseModel):
tag_handle = data[0]
cached, tag_color = self.get_cached_value(tag_handle, "TAG_COLOR")
if not cached:
tag_color = "#000000000000"
tag_color = ""
tag_priority = None
for handle in data[11]:
tag = self.db.get_tag_from_handle(handle)

View File

@ -148,7 +148,7 @@ class NoteModel(FlatBaseModel):
tag_handle = data[0]
cached, value = self.get_cached_value(tag_handle, "TAG_COLOR")
if not cached:
tag_color = "#000000000000"
tag_color = ""
tag_priority = None
for handle in data[Note.POS_TAGS]:
tag = self.db.get_tag_from_handle(handle)

View File

@ -538,7 +538,7 @@ class PeopleBaseModel(BaseModel):
tag_handle = data[0]
cached, value = self.get_cached_value(tag_handle, "TAG_COLOR")
if not cached:
tag_color = "#000000000000"
tag_color = ""
tag_priority = None
for handle in data[COLUMN_TAGS]:
tag = self.db.get_tag_from_handle(handle)

View File

@ -201,7 +201,7 @@ class PlaceBaseModel:
tag_handle = data[0]
cached, value = self.get_cached_value(tag_handle, "TAG_COLOR")
if not cached:
tag_color = "#000000000000"
tag_color = ""
tag_priority = None
for handle in data[16]:
tag = self.db.get_tag_from_handle(handle)

View File

@ -253,7 +253,7 @@ class RepositoryModel(FlatBaseModel):
tag_handle = data[0]
cached, tag_color = self.get_cached_value(tag_handle, "TAG_COLOR")
if not cached:
tag_color = "#000000000000"
tag_color = ""
tag_priority = None
for handle in data[8]:
tag = self.db.get_tag_from_handle(handle)

View File

@ -143,7 +143,7 @@ class SourceModel(FlatBaseModel):
tag_handle = data[0]
cached, value = self.get_cached_value(tag_handle, "TAG_COLOR")
if not cached:
tag_color = "#000000000000"
tag_color = ""
tag_priority = None
for handle in data[11]:
tag = self.db.get_tag_from_handle(handle)

View File

@ -898,7 +898,8 @@ class TreeBaseModel(GObject.GObject, Gtk.TreeModel, BaseModel):
if node.handle is None:
# Header rows dont get the foreground color set
if col == self.color_column():
return "#000000000000"
#color must not be utf-8
return ""
# Return the node name for the first column
if col == 0: