summaryrefslogtreecommitdiff
path: root/wikipedia/BoxWithBg.js
diff options
context:
space:
mode:
Diffstat (limited to 'wikipedia/BoxWithBg.js')
-rw-r--r--wikipedia/BoxWithBg.js19
1 files changed, 19 insertions, 0 deletions
diff --git a/wikipedia/BoxWithBg.js b/wikipedia/BoxWithBg.js
new file mode 100644
index 0000000..1ae9404
--- /dev/null
+++ b/wikipedia/BoxWithBg.js
@@ -0,0 +1,19 @@
+const GObject = imports.gi.GObject;
+const Gtk = imports.gi.Gtk;
+const Lang = imports.lang;
+
+const BoxWithBg = new Lang.Class({
+ Name: "BoxWithBg",
+ Extends: Gtk.Box,
+
+ vfunc_draw: function(cairoContext) {
+ let width = this.get_allocated_width();
+ let height = this.get_allocated_height();
+ let context = this.get_style_context();
+ Gtk.render_background(context, cairoContext, 0, 0, width, height);
+ Gtk.render_frame(context, cairoContext, 0, 0, width, height);
+
+ return this.parent(cairoContext);
+ }
+});
+