Created
March 23, 2009 16:01
-
-
Save sander/83621 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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