From 33b3d05039a049ede467d11c17cde1ed2db76485 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Thu, 7 Jan 2010 06:40:21 +0100 Subject: [PATCH] Update running app indicator to match latest mockup https://bugzilla.gnome.org/show_bug.cgi?id=606257 --- data/Makefile.am | 1 - data/app-well-glow.png | Bin 3724 -> 0 bytes data/theme/gnome-shell.css | 23 +++---- js/ui/appDisplay.js | 121 +++++++++---------------------------- 4 files changed, 41 insertions(+), 104 deletions(-) delete mode 100644 data/app-well-glow.png diff --git a/data/Makefile.am b/data/Makefile.am index eef11bd01..f0ca34ec1 100644 --- a/data/Makefile.am +++ b/data/Makefile.am @@ -15,7 +15,6 @@ gnome-shell.desktop: gnome-shell.desktop.in imagesdir = $(pkgdatadir)/images dist_images_DATA = \ add-workspace.svg \ - app-well-glow.png \ close-black.svg \ magnifier.svg \ remove-workspace.svg diff --git a/data/app-well-glow.png b/data/app-well-glow.png deleted file mode 100644 index 2a8984f035ada52389d93a47a272ec10ece1c2c2..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3724 zcmV;74s-E|P)Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L01FcU01FcV0GgZ_00007bV*G`2iXY$ z7Y{j&y~AMu000?uMObu0Z*6U5Zgc=ca%Ew3Wn>_CX>@2HM@dakSAh-}000f=Nkl`> z0=$x-lEoHTkIamSd%TFOBAe>gYsOwU03s`2MCGY-&pr3vBtN*a=%NKm}O}2GkY+5h5_@P+W6gvc2yI+t=q|% z--LT_L+~a99Rd}DDFpTwCZ!PA8pjkeWlan$S>~azMFaOjv@PUs1L9uzV-Q-%3!CFL zp%7@^0ak*Qplm^AMZxJs^y0}|HbwLzmg4lnWLeCGZOA38O1{fwJ#0Mx!;A6=+^s&p zzJ4cgZvl2<)y-%8^!61uo7cR$f^AlRw6=T~f_K6D95pRs=Ar3x8;ebiViO&yX*@=m zN5TTcP*8$VM#8+nWMq&L0g!wKC;)i6|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}, - - _onStyleChanged: function() { - let themeNode = this._glowBox.get_theme_node(); - - let success, len; - [success, len] = themeNode.get_length('-shell-glow-extend-vertical', false); - if (success) - this._glowExtendVertical = len; - [success, len] = themeNode.get_length('-shell-glow-shrink-horizontal', false); - if (success) - this._glowShrinkHorizontal = len; - this.actor.queue_relayout(); - }, - - _rerenderGlow: function() { - this._glowBox.destroy_children(); - let glowPath = GLib.filename_to_uri(global.imagedir + 'app-well-glow.png', ''); - let windows = this.app.get_windows(); - for (let i = 0; i < windows.length && i < 3; i++) { - let glow = Shell.TextureCache.get_default().load_uri_sync(Shell.TextureCachePolicy.FOREVER, - glowPath, -1, -1); - glow.keep_aspect_ratio = false; - this._glowBox.add(glow); - } + box.add_actor(this._name); } } @@ -415,6 +324,7 @@ function AppWellIcon(app) { AppWellIcon.prototype = { _init : function(app) { this.app = app; + this._running = false; this.actor = new St.Clickable({ style_class: 'app-well-app', reactive: true, x_fill: true, @@ -433,6 +343,33 @@ AppWellIcon.prototype = { this.actor.connect('button-press-event', Lang.bind(this, this._onButtonPress)); this.actor.connect('notify::hover', Lang.bind(this, this._onHoverChange)); + this.actor.connect('show', Lang.bind(this, this._onShow)); + this.actor.connect('hide', Lang.bind(this, this._onHideDestroy)); + this.actor.connect('destroy', Lang.bind(this, this._onHideDestroy)); + + this._appWindowChangedId = 0; + }, + + _onShow: function() { + this._appWindowChangedId = this.app.connect('windows-changed', + Lang.bind(this, + this._updateStyleClass)); + this._updateStyleClass(); + }, + + _onHideDestroy: function() { + if (this._appWindowChangedId > 0) + this.app.disconnect(this._appWindowChangedId); + }, + + _updateStyleClass: function() { + let windows = this.app.get_windows(); + let running = windows.length > 0; + if (running == this._running) + return; + this._running = running; + this.actor.style_class = this._running ? "app-well-app running" + : "app-well-app"; }, _onButtonPress: function(actor, event) {