summaryrefslogtreecommitdiff
path: root/wikipedia/BoxWithBg.js
blob: 1ae940475c75b17ad9643471d351dffaf4fcd0d2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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);
    }
});