[overview] Port pane to CSS

https://bugzilla.gnome.org/show_bug.cgi?id=600734
This commit is contained in:
Colin Walters 2009-11-06 14:55:03 -05:00
parent d51384fb86
commit bc255a525f
4 changed files with 27 additions and 28 deletions

View File

@ -16,7 +16,6 @@ imagesdir = $(pkgdatadir)/images
dist_images_DATA = \ dist_images_DATA = \
add-workspace.svg \ add-workspace.svg \
app-well-glow.png \ app-well-glow.png \
close.svg \
close-black.svg \ close-black.svg \
info.svg \ info.svg \
magnifier.svg \ magnifier.svg \
@ -25,6 +24,7 @@ dist_images_DATA = \
themedir = $(pkgdatadir)/theme themedir = $(pkgdatadir)/theme
dist_theme_DATA = \ dist_theme_DATA = \
theme/gnome-shell.css \ theme/gnome-shell.css \
theme/close.svg \
theme/scroll-button-down.png \ theme/scroll-button-down.png \
theme/scroll-button-down-hover.png \ theme/scroll-button-down-hover.png \
theme/scroll-button-up.png \ theme/scroll-button-up.png \

View File

Before

Width:  |  Height:  |  Size: 2.6 KiB

After

Width:  |  Height:  |  Size: 2.6 KiB

View File

@ -137,6 +137,19 @@ StTooltip {
font-weight: normal; font-weight: normal;
} }
.dash-pane {
background-color: rgba(0,0,0,0.95);
border: 1px solid #262626;
padding: 4px;
spacing: 4px;
}
.dash-pane-close {
background-image: url("close.svg");
width: 16px;
height: 16px;
}
/* LookingGlass */ /* LookingGlass */
#LookingGlassDialog #LookingGlassDialog

View File

@ -50,13 +50,6 @@ const SECTION_INNER_SPACING = 8;
const BROWSE_ACTIVATED_BG = new Clutter.Color(); const BROWSE_ACTIVATED_BG = new Clutter.Color();
BROWSE_ACTIVATED_BG.from_pixel(0x303030f0); BROWSE_ACTIVATED_BG.from_pixel(0x303030f0);
const PANE_BORDER_COLOR = new Clutter.Color();
PANE_BORDER_COLOR.from_pixel(0x101d3cfa);
const PANE_BORDER_WIDTH = 2;
const PANE_BACKGROUND_COLOR = new Clutter.Color();
PANE_BACKGROUND_COLOR.from_pixel(0x000000f4);
const APPS = "apps"; const APPS = "apps";
const PREFS = "prefs"; const PREFS = "prefs";
const DOCS = "docs"; const DOCS = "docs";
@ -95,36 +88,29 @@ Pane.prototype = {
_init: function () { _init: function () {
this._open = false; this._open = false;
this.actor = new Big.Box({ orientation: Big.BoxOrientation.VERTICAL, this.actor = new St.BoxLayout({ style_class: "dash-pane",
background_color: PANE_BACKGROUND_COLOR, vertical: true,
border: PANE_BORDER_WIDTH, reactive: true });
border_color: PANE_BORDER_COLOR,
padding: DEFAULT_PADDING,
reactive: true });
this.actor.connect('button-press-event', Lang.bind(this, function (a, e) { this.actor.connect('button-press-event', Lang.bind(this, function (a, e) {
// Eat button press events so they don't go through and close the pane // Eat button press events so they don't go through and close the pane
return true; return true;
})); }));
let chromeTop = new Big.Box({ orientation: Big.BoxOrientation.HORIZONTAL, let chromeTop = new St.BoxLayout();
spacing: 6 });
let closeIconUri = "file://" + global.imagedir + "close.svg"; let closeIcon = new St.Bin({ style_class: "dash-pane-close" });
let closeIcon = Shell.TextureCache.get_default().load_uri_sync(Shell.TextureCachePolicy.FOREVER,
closeIconUri,
16,
16);
closeIcon.reactive = true; closeIcon.reactive = true;
closeIcon.connect('button-press-event', Lang.bind(this, function (b, e) { closeIcon.connect('button-press-event', Lang.bind(this, function (b, e) {
this.close(); this.close();
return true; return true;
})); }));
chromeTop.append(closeIcon, Big.BoxPackFlags.END); let dummy = new St.Bin();
this.actor.append(chromeTop, Big.BoxPackFlags.NONE); chromeTop.add(dummy, { expand: true });
chromeTop.add(closeIcon, { x_align: St.Align.END });
this.actor.add(chromeTop);
this.content = new Big.Box({ orientation: Big.BoxOrientation.VERTICAL, this.content = new St.BoxLayout({ vertical: true });
spacing: DEFAULT_PADDING }); this.actor.add(this.content, { expand: true });
this.actor.append(this.content, Big.BoxPackFlags.EXPAND);
// Hidden by default // Hidden by default
this.actor.hide(); this.actor.hide();
@ -200,7 +186,7 @@ function createPaneForDetails(dash, display) {
if (index >= 0) { if (index >= 0) {
detailPane.destroyContent(); detailPane.destroyContent();
let details = display.createDetailsForIndex(index); let details = display.createDetailsForIndex(index);
detailPane.content.append(details, Big.BoxPackFlags.EXPAND); detailPane.content.add(details, { expand: true });
detailPane.open(); detailPane.open();
} else { } else {
detailPane.close(); detailPane.close();
@ -228,7 +214,7 @@ ResultPane.prototype = {
createPaneForDetails(this._dash, resultArea.display); createPaneForDetails(this._dash, resultArea.display);
this.content.append(resultArea.actor, Big.BoxPackFlags.EXPAND); this.content.add(resultArea.actor, { expand: true });
this.connect('open-state-changed', Lang.bind(this, function(pane, isOpen) { this.connect('open-state-changed', Lang.bind(this, function(pane, isOpen) {
resultArea.display.resetState(); resultArea.display.resetState();
})); }));