I use a dark GTK+ theme and the stark white background on xdot's graph
canvas area sometimes hurts my eyes. This change makes the widget use
the current theme's background colour instead.
... | ... |
@@ -170,11 +170,11 @@ class DotWidget(Gtk.DrawingArea): |
170 | 170 |
return True |
171 | 171 |
|
172 | 172 |
def on_draw(self, widget, cr): |
173 |
- cr.set_source_rgba(1.0, 1.0, 1.0, 1.0) |
|
174 |
- cr.paint() |
|
173 |
+ rect = self.get_allocation() |
|
174 |
+ Gtk.render_background(self.get_style_context(), cr, 0, 0, |
|
175 |
+ rect.width, rect.height) |
|
175 | 176 |
|
176 | 177 |
cr.save() |
177 |
- rect = self.get_allocation() |
|
178 | 178 |
cr.translate(0.5*rect.width, 0.5*rect.height) |
179 | 179 |
cr.scale(self.zoom_ratio, self.zoom_ratio) |
180 | 180 |
cr.translate(-self.x, -self.y) |