Skip to content

Commit dea34ee

Browse files
committed
annotations: Set the title font color to black
In dark mode, the title is white, which clashes with the default annotation color: yellow. PDF documents are almost always black on white anyway, no matter whether we're in dark mode or not, annotations colors (yellow by default) which work well are almost always bright. Fixes linuxmint/mint22.2-beta#7
1 parent d16d6b3 commit dea34ee

1 file changed

Lines changed: 10 additions & 3 deletions

File tree

libview/ev-annotation-window.c

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -144,9 +144,10 @@ ev_annotation_window_label_changed (EvAnnotationMarkup *annot,
144144
EvAnnotationWindow *window)
145145
{
146146
const gchar *label = ev_annotation_markup_get_label (annot);
147-
147+
gchar *markup_text = g_strdup_printf ("<span foreground='black'>%s</span>", label);
148148
gtk_window_set_title (GTK_WINDOW (window), label);
149-
gtk_label_set_text (GTK_LABEL (window->title), label);
149+
gtk_label_set_markup (GTK_LABEL (window->title), markup_text);
150+
g_free (markup_text);
150151
}
151152

152153
static void
@@ -379,6 +380,7 @@ ev_annotation_window_constructor (GType type,
379380
GdkRGBA color;
380381
EvRectangle *rect;
381382
gdouble scale;
383+
gchar *markup_text;
382384

383385
object = G_OBJECT_CLASS (ev_annotation_window_parent_class)->constructor (type,
384386
n_construct_properties,
@@ -406,7 +408,12 @@ ev_annotation_window_constructor (GType type,
406408
ev_annotation_window_set_color (window, &color);
407409
gtk_widget_set_name (GTK_WIDGET (window), ev_annotation_get_name (annot));
408410
gtk_window_set_title (GTK_WINDOW (window), label);
409-
gtk_label_set_text (GTK_LABEL (window->title), label);
411+
412+
markup_text = g_strdup_printf ("<span foreground='black'>%s</span>", label);
413+
414+
gtk_label_set_markup (GTK_LABEL (window->title), markup_text);
415+
416+
g_free (markup_text);
410417

411418
contents = ev_annotation_get_contents (annot);
412419
if (contents) {

0 commit comments

Comments
 (0)