[gnome-maps] Ellipsize route instructions in print layout



commit 4bfc1e718f2d7f80c42dd4d7a52a21b8ecfa7f61
Author: Razvan Brinzea <razvan brinzea gmail com>
Date:   Wed Feb 24 22:25:58 2016 +0200

    Ellipsize route instructions in print layout
    
    Route instructions are ellipsized after two lines
    in order to prevent overlapping in the printed
    route.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=762305

 src/instructionRow.js |    6 ++++++
 src/printLayout.js    |    3 ++-
 2 files changed, 8 insertions(+), 1 deletions(-)
---
diff --git a/src/instructionRow.js b/src/instructionRow.js
index b0fcf20..a004cb9 100644
--- a/src/instructionRow.js
+++ b/src/instructionRow.js
@@ -39,8 +39,14 @@ const InstructionRow = new Lang.Class({
         this._hasColor = params.hasColor;
         delete params.hasColor;
 
+        let lines = params.lines;
+        delete params.lines;
+
         this.parent(params);
 
+        if (lines)
+            this._instructionLabel.lines = lines;
+
         this._instructionLabel.label = this.turnPoint.instruction;
 
         /*
diff --git a/src/printLayout.js b/src/printLayout.js
index 2efe11c..b89d9aa 100644
--- a/src/printLayout.js
+++ b/src/printLayout.js
@@ -207,7 +207,8 @@ const PrintLayout = new Lang.Class({
         let instructionEntry =  new InstructionRow.InstructionRow({
             visible: true,
             turnPoint: turnPoint,
-            hasColor: turnPoint.isStop()
+            hasColor: turnPoint.isStop(),
+            lines: 2
         });
 
         instructionWidget.width_request = width;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]