/
separator.js
40 lines (30 loc) · 1.41 KB
/
separator.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
const Gtk = imports.gi.Gtk;
const Lang = imports.lang;
const EDGE_WIDTH = 55;
const SHADOW_HEIGHT = 11;
var FrameSeparator = new Lang.Class({
Name: 'FrameSeparator',
Extends: Gtk.Box,
_init: function() {
this.parent({ orientation: Gtk.Orientation.VERTICAL });
this._separator = new Gtk.Separator({ orientation: Gtk.Orientation.HORIZONTAL });
this._separator.get_style_context().add_class('frame-separator');
this.add(this._separator);
let shadows = new Gtk.Box({ orientation: Gtk.Orientation.HORIZONTAL });
shadows.get_style_context().add_class('frame-separator-shadows');
this.add(shadows);
this._leftEdge = new Gtk.Frame({ width_request: EDGE_WIDTH,
height_request: SHADOW_HEIGHT });
this._leftEdge.get_style_context().add_class('left-edge');
shadows.add(this._leftEdge);
this._centerLine = new Gtk.Frame({ hexpand: true,
height_request: SHADOW_HEIGHT });
this._centerLine.get_style_context().add_class('center-line');
shadows.add(this._centerLine);
this._rightEdge = new Gtk.Frame({ width_request: EDGE_WIDTH,
height_request: SHADOW_HEIGHT });
this._rightEdge.get_style_context().add_class('right-edge');
shadows.add(this._rightEdge);
this.show_all();
}
});