Created
March 28, 2016 15:48
-
-
Save rmacqueen/7be443ee4182d7f06c45 to your computer and use it in GitHub Desktop.
box shadow
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
const Gtk = imports.gi.Gtk; | |
Gtk.init(null); | |
let frame = new Gtk.Frame({ | |
expand: false, | |
margin: 30 | |
}); | |
frame.set_size_request(200, 100) | |
frame.get_style_context().add_class('shadow') | |
let css = ".shadow {background-color:red; border: 2px solid blue; box-shadow: 0px 1px 20px 0px alpha(black, 0.5); padding: 10px;}" | |
let provider = new Gtk.CssProvider(); | |
provider.load_from_data(css); | |
let context = frame.get_style_context(); | |
context.add_provider(provider, Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION); | |
let mwindow = new Gtk.Window({ | |
default_width: 800, | |
default_height: 600 | |
}); | |
mwindow.add(frame); | |
mwindow.show_all(); | |
mwindow.connect('destroy', function() { Gtk.main_quit() }); | |
Gtk.main(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment