Skip to content

Commit

Permalink
Looking glass: Fix log text colors.
Browse files Browse the repository at this point in the history
Use theme-coordinated colors instead of hardcoding.

Fixes #11791.
  • Loading branch information
mtwebster committed Jul 26, 2023
1 parent 5198900 commit 36ba660
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions files/usr/share/cinnamon/cinnamon-looking-glass/page_log.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/python3

import datetime
from gi.repository import Gtk
from gi.repository import Gtk, Pango
import pageutils

class LogEntry:
Expand Down Expand Up @@ -32,22 +32,23 @@ def __init__(self, proxy):
self.added_messages = 0
self.first_message_time = None

context = self.get_style_context()

self.enabled_types = {'info': True, 'warning': True, 'error': True, 'trace': False}
self.type_tags = {
'info': self.textbuffer.create_tag("info",
foreground="#1a6f18",
invisible=not self.enabled_types["info"],
invisible_set=True),
'warning': self.textbuffer.create_tag("warning",
foreground="#c8bf33",
foreground_rgba=context.lookup_color("warning_color")[1],
invisible=not self.enabled_types["warning"],
invisible_set=True),
'error': self.textbuffer.create_tag("error",
foreground="#9f1313",
foreground_rgba=context.lookup_color("error_color")[1],
invisible=not self.enabled_types["error"],
invisible_set=True),
'trace': self.textbuffer.create_tag("trace",
foreground="#18186f",
weight=Pango.Weight.SEMIBOLD,
invisible=not self.enabled_types["trace"],
invisible_set=True)
}
Expand Down

0 comments on commit 36ba660

Please sign in to comment.