shell-app: Fade the app icon on the left in RTL layouts

The point of fading the icon is to make the text displayed over the
icon more legible. In RTL layouts, the text is displayed on the left
of the icon, so fading the right-hand-side of the icon doesn't work
well.

https://bugzilla.gnome.org/show_bug.cgi?id=704583
This commit is contained in:
Jasper St. Pierre
2013-07-19 15:39:48 -04:00
committed by Ray Strode
parent 31f67d9142
commit c1d107a682
3 changed files with 33 additions and 14 deletions

View File

@@ -371,13 +371,16 @@ const AppMenuButton = new Lang.Class({
this._updateIconBoxClip();
},
_syncIcon: function() {
let icon = this._targetApp.get_faded_icon(2 * PANEL_ICON_SIZE, this._iconBox.text_direction);
this._iconBox.set_child(icon);
},
_onIconThemeChanged: function() {
if (this._iconBox.child == null)
return;
this._iconBox.child.destroy();
let icon = this._targetApp.get_faded_icon(2 * PANEL_ICON_SIZE);
this._iconBox.set_child(icon);
this._syncIcon();
},
_updateIconBoxClip: function() {
@@ -595,12 +598,10 @@ const AppMenuButton = new Lang.Class({
}
this._targetApp = targetApp;
let icon = targetApp.get_faded_icon(2 * PANEL_ICON_SIZE);
this._label.setText(targetApp.get_name());
this.setName(targetApp.get_name());
this._iconBox.set_child(icon);
this._syncIcon();
this._iconBox.show();
if (targetApp.get_state() == Shell.AppState.STARTING)