summaryrefslogtreecommitdiff
path: root/src/book-view.vala
diff options
context:
space:
mode:
Diffstat (limited to 'src/book-view.vala')
-rw-r--r--src/book-view.vala19
1 files changed, 8 insertions, 11 deletions
diff --git a/src/book-view.vala b/src/book-view.vala
index 9dfd361..3acd14e 100644
--- a/src/book-view.vala
+++ b/src/book-view.vala
@@ -30,7 +30,7 @@ public class BookView : Gtk.VBox
private Gtk.Widget drawing_area;
/* Horizontal scrollbar */
- private Gtk.HScrollbar scroll;
+ private Gtk.Scrollbar scroll;
private Gtk.Adjustment adjustment;
private Gdk.CursorType cursor;
@@ -68,7 +68,7 @@ public class BookView : Gtk.VBox
drawing_area.set_events (Gdk.EventMask.POINTER_MOTION_MASK | Gdk.EventMask.BUTTON_PRESS_MASK | Gdk.EventMask.BUTTON_RELEASE_MASK | Gdk.EventMask.FOCUS_CHANGE_MASK | Gdk.EventMask.STRUCTURE_MASK | Gdk.EventMask.SCROLL_MASK);
pack_start (drawing_area, true, true, 0);
- scroll = new Gtk.HScrollbar (null);
+ scroll = new Gtk.Scrollbar (Gtk.Orientation.HORIZONTAL, null);
adjustment = scroll.get_adjustment ();
pack_start (scroll, false, true, 0);
@@ -419,15 +419,11 @@ public class BookView : Gtk.VBox
context.restore ();
if (page.get_selected ())
- Gtk.paint_focus (drawing_area.get_style (),
- context,
- Gtk.StateType.SELECTED,
- null,
- null,
- page.get_x_offset () - get_x_offset (),
- page.get_y_offset (),
- page.get_width (),
- page.get_height ());
+ drawing_area.get_style_context ().render_focus (context,
+ page.get_x_offset () - get_x_offset (),
+ page.get_y_offset (),
+ page.get_width (),
+ page.get_height ());
}
return false;
@@ -435,6 +431,7 @@ public class BookView : Gtk.VBox
private PageView? get_page_at (int x, int y, out int x_, out int y_)
{
+ x_ = y_ = 0;
for (var i = 0; i < book.get_n_pages (); i++)
{
var page = get_nth_page (i);