small fixes
This commit is contained in:
parent
e526de786e
commit
968f18e107
|
@ -202,7 +202,12 @@
|
|||
<property name="can-focus">True</property>
|
||||
<property name="position">800</property>
|
||||
<child>
|
||||
<object class="GtkViewport" id="viewport1">
|
||||
<object class="GtkScrolledWindow">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">True</property>
|
||||
<property name="shadow-type">in</property>
|
||||
<child>
|
||||
<object class="GtkViewport">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<child>
|
||||
|
@ -245,9 +250,11 @@
|
|||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="resize">True</property>
|
||||
<property name="shrink">True</property>
|
||||
<property name="shrink">False</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
|
|
|
@ -41,7 +41,6 @@ class PdfPage(Gtk.DrawingArea):
|
|||
self.page: fitz.Page = page
|
||||
pix = self.page.get_pixmap(dpi=96) # type: ignore
|
||||
self.set_size_request(pix.width, pix.height)
|
||||
print(f"w: {pix.width}, h: {pix.height}")
|
||||
self.set_app_paintable(True) # type: ignore
|
||||
self.connect("draw", self.on_draw, {})
|
||||
|
||||
|
@ -49,7 +48,9 @@ class PdfPage(Gtk.DrawingArea):
|
|||
# app: Application = widget.get_window().get_application() # type: ignore
|
||||
width = widget.get_allocated_width()
|
||||
height = widget.get_allocated_height()
|
||||
print(f"alloc w: {width}, h: {height}")
|
||||
|
||||
cr.set_source_rgba(255, 255, 255)
|
||||
cr.paint()
|
||||
|
||||
sctx = widget.get_style_context()
|
||||
Gtk.render_background(sctx, cr, 0, 0, width, height)
|
||||
|
@ -59,12 +60,6 @@ class PdfPage(Gtk.DrawingArea):
|
|||
cr.set_source_surface(ims, 0, 0)
|
||||
cr.paint()
|
||||
|
||||
cr.set_source_rgba(255, 0, 0)
|
||||
cr.set_line_width(10)
|
||||
cr.move_to(0, 0)
|
||||
cr.line_to(width, height)
|
||||
cr.stroke()
|
||||
|
||||
|
||||
@Gtk.Template.from_file("MainWindow.glade")
|
||||
class MainWindow(Gtk.ApplicationWindow):
|
||||
|
|
Loading…
Reference in New Issue