From af35dea019f69e2f63e98ff1dffe6a5ebb94a044 Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Tue, 10 Nov 2009 10:02:02 -0500 Subject: [PATCH] [dash] Move BackLink to CSS The previous commit 626f679947298a99 broke the back links on search drilldown. https://bugzilla.gnome.org/show_bug.cgi?id=601413 --- data/Makefile.am | 4 ++-- data/theme/gnome-shell.css | 12 ++++++++++ data/{back.svg => theme/section-back.svg} | 0 js/ui/dash.js | 27 +++++++++-------------- 4 files changed, 25 insertions(+), 18 deletions(-) rename data/{back.svg => theme/section-back.svg} (100%) diff --git a/data/Makefile.am b/data/Makefile.am index 06827d0b3..8c090c08f 100644 --- a/data/Makefile.am +++ b/data/Makefile.am @@ -16,7 +16,6 @@ imagesdir = $(pkgdatadir)/images dist_images_DATA = \ add-workspace.svg \ app-well-glow.png \ - back.svg \ close.svg \ close-black.svg \ info.svg \ @@ -30,7 +29,8 @@ dist_theme_DATA = \ theme/scroll-button-down-hover.png \ theme/scroll-button-up.png \ theme/scroll-button-up-hover.png \ - theme/scroll-vhandle.png + theme/scroll-vhandle.png \ + theme/section-back.svg schemadir = @GCONF_SCHEMA_FILE_DIR@ schema_DATA = gnome-shell.schemas diff --git a/data/theme/gnome-shell.css b/data/theme/gnome-shell.css index 86ec44b84..a01d1eaf0 100644 --- a/data/theme/gnome-shell.css +++ b/data/theme/gnome-shell.css @@ -101,12 +101,24 @@ StScrollBar StButton#vhandle:hover .section-header-inner { border: 1px solid #000000; padding: 0px 4px; + spacing: 4px; } .section-text-content { padding: 4px 0px; } +.section-header-back { + padding: 0px 4px 0px 0px; + border-right: 1px solid #262626; +} + +.section-header-back-image { + background-image: url("section-back.svg"); + width: 12px; + height: 16px; +} + .section-count { } diff --git a/data/back.svg b/data/theme/section-back.svg similarity index 100% rename from data/back.svg rename to data/theme/section-back.svg diff --git a/js/ui/dash.js b/js/ui/dash.js index 823a15d81..fe7a4dafb 100644 --- a/js/ui/dash.js +++ b/js/ui/dash.js @@ -403,21 +403,9 @@ function BackLink() { BackLink.prototype = { _init : function () { - this.actor = new Shell.ButtonBox({ orientation: Big.BoxOrientation.HORIZONTAL, - padding_right: DEFAULT_PADDING, - padding_left: DEFAULT_PADDING, - reactive: true, - x_align: Big.BoxAlignment.CENTER, - y_align: Big.BoxAlignment.CENTER, - border_right: SECTION_BORDER, - border_color: SECTION_BORDER_COLOR }); - - let backIconUri = "file://" + global.imagedir + "back.svg"; - let backIcon = Shell.TextureCache.get_default().load_uri_sync(Shell.TextureCachePolicy.FOREVER, - backIconUri, - 12, - 16); - this.actor.append(backIcon, Big.BoxPackFlags.NONE); + this.actor = new St.Button({ style_class: "section-header-back", + reactive: true }); + this.actor.set_child(new St.Bin({ style_class: "section-header-back-image" })); } } @@ -442,13 +430,20 @@ SectionHeader.prototype = { this._onStyleChanged(); })); + this.backLink = new BackLink(); + this._innerBox.add(this.backLink.actor); + this.backLink.actor.hide(); + this.backLink.actor.connect('clicked', Lang.bind(this, function (actor) { + this.emit('back-link-activated'); + })); + let textBox = new St.BoxLayout({ style_class: "section-text-content" }); this.text = new St.Label({ style_class: "section-title", text: title }); textBox.add(this.text, { x_align: St.Align.START }); this.countText = new St.Label({ style_class: "section-count" }); - textBox.add(this.countText, { x_align: St.Align.END }); + textBox.add(this.countText, { expand: true, x_fill: false, x_align: St.Align.END }); this.countText.hide(); this._innerBox.add(textBox, { expand: true });