Skip to content

Instantly share code, notes, and snippets.

@sander
Created March 23, 2009 16:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sander/83621 to your computer and use it in GitHub Desktop.
Save sander/83621 to your computer and use it in GitHub Desktop.
Panel.prototype = {
_init : function() {
let me = this;
let global = Shell.Global.get();
// Put the background under the panel within a group.
let group = new Clutter.Group();
// Create a box with the background and the shadow. The background
// is drawn using two gradient boxes. We let the backBox divide the
// panel's height between these instead of calculating their heights
// here, to prevent rounding errors. The shadow gets a fixed height.
let backBox = new Big.Box({ orientation: Big.BoxOrientation.VERTICAL,
x: 0,
y: 0,
width: global.screen_width,
height: PANEL_HEIGHT + SHADOW_HEIGHT });
let backUpper = global.create_vertical_gradient(PANEL_TOP_COLOR,
PANEL_MIDDLE_COLOR);
let backLower = global.create_vertical_gradient(PANEL_MIDDLE_COLOR,
PANEL_BOTTOM_COLOR);
let shadow = global.create_vertical_gradient(SHADOW_COLOR,
TRANSPARENT_COLOR);
shadow.set_height(SHADOW_HEIGHT);
backBox.append(backUpper, Big.BoxPackFlags.EXPAND);
backBox.append(backLower, Big.BoxPackFlags.EXPAND);
backBox.append(shadow, Big.BoxPackFlags.NONE);
group.add_actor(backBox);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment