summaryrefslogtreecommitdiff
path: root/src/book-view.vala
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff.email>2022-03-19 18:05:05 +0100
committerJörg Frings-Fürst <debian@jff.email>2022-03-19 18:05:05 +0100
commit8ac2508eb094459c062d0c31b6367da393b4fa6e (patch)
treea3dd69ae2a2f90e59914e9ede6acdc94e3a6712d /src/book-view.vala
parent05315c3da6d3761ba95f1ae96b852768dd651c25 (diff)
New upstream version 42.0upstream/42.0
Diffstat (limited to 'src/book-view.vala')
-rw-r--r--src/book-view.vala13
1 files changed, 4 insertions, 9 deletions
diff --git a/src/book-view.vala b/src/book-view.vala
index 59e2469..df2beb4 100644
--- a/src/book-view.vala
+++ b/src/book-view.vala
@@ -189,14 +189,7 @@ public class BookView : Gtk.Box
private void add_cb (Book book, Page page)
{
- Gdk.RGBA page_ruler_color;
- if (!get_style_context ().lookup_color ("theme_fg_color", out page_ruler_color))
- {
- warning ("Couldn't get theme_fg_color from GTK theme, needed to draw the page view ruler");
- /* Use a bright color so that theme makers notice it. */
- page_ruler_color.parse ("#00ff00");
- }
- var page_view = new PageView (page, page_ruler_color);
+ var page_view = new PageView (page);
page_view.changed.connect (page_view_changed_cb);
page_view.size_changed.connect (page_view_size_changed_cb);
page_data.insert (page, page_view);
@@ -450,6 +443,8 @@ public class BookView : Gtk.Box
for (var i = 0; i < book.n_pages; i++)
pages.append (get_nth_page (i));
+ var ruler_color = get_style_context ().get_color (get_state_flags ());
+
/* Render each page */
foreach (var page in pages)
{
@@ -462,7 +457,7 @@ public class BookView : Gtk.Box
context.save ();
context.translate (-x_offset, 0);
- page.render (context);
+ page.render (context, ruler_color);
context.restore ();
if (page.selected)