[gnome-maps] instructionRow: Add property for colored icons
- From: Jonas Danielsson <jonasdn src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-maps] instructionRow: Add property for colored icons
- Date: Thu, 25 Feb 2016 19:15:49 +0000 (UTC)
commit 2dc4d8eea6f62e0744a57dcba1410e81d4dfee0b
Author: Jonas Danielsson <jonas threetimestwo org>
Date: Wed Feb 24 09:43:39 2016 +0100
instructionRow: Add property for colored icons
https://bugzilla.gnome.org/show_bug.cgi?id=762303
src/instructionRow.js | 18 +++++++++++++++++-
1 files changed, 17 insertions(+), 1 deletions(-)
---
diff --git a/src/instructionRow.js b/src/instructionRow.js
index c91321a..b0fcf20 100644
--- a/src/instructionRow.js
+++ b/src/instructionRow.js
@@ -36,10 +36,26 @@ const InstructionRow = new Lang.Class({
this.turnPoint = params.turnPoint;
delete params.turnPoint;
+ this._hasColor = params.hasColor;
+ delete params.hasColor;
+
this.parent(params);
this._instructionLabel.label = this.turnPoint.instruction;
- this._directionImage.icon_name = this.turnPoint.iconName;
+
+ /*
+ * The SVG icons for turn point stops has the color red, but has
+ * the suffix '-symbolic'. So when loading through GtkImage it will have
+ * the proper GtkIconLookupflags to re-color the icon as symbolic.
+ * When we load the PixBuf from the SVG ourself, we get the color.
+ */
+ if (this._hasColor) {
+ let theme = Gtk.IconTheme.get_default();
+ let iconName = this.turnPoint.iconName;
+ this._directionImage.pixbuf = theme.load_icon(iconName, 0, 0);
+ } else {
+ this._directionImage.icon_name = this.turnPoint.iconName;
+ }
if (this.turnPoint.distance > 0)
this._distanceLabel.label = Utils.prettyDistance(this.turnPoint.distance);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]