Permalink
Browse files

lineheight property for PriText

  • Loading branch information...
felipevex committed Jun 22, 2018
1 parent a71a4de commit 3d8b1ea880173c39973caed3aa36091e0f3c59a9
Showing with 25 additions and 2 deletions.
  1. +2 −1 helper/display/DisplayHelperIgnition.hx
  2. +1 −0 helper/display/DisplayTextHelper.hx
  3. +22 −1 priori/view/text/PriText.hx
@@ -15,7 +15,8 @@ class DisplayHelperIgnition {
multiLine : false,
selectable : false,
ellipsis : true,
editable : false
editable : false,
lineHeight : null
}
}
@@ -8,4 +8,5 @@ typedef DisplayTextHelper = {
var selectable:Bool;
var ellipsis:Bool;
var editable:Bool;
var lineHeight:Float;
}
@@ -75,6 +75,13 @@ class PriText extends PriDisplay {
**/
public var editable(get, set):Bool;
/**
* Specify the space between line, in percentage values.
*
* `defaur value: null`
**/
public var lineHeight(get, set):Float;
private var dth:DisplayTextHelper = DisplayHelperIgnition.getDisplayTextHelper();
public function new() {
@@ -85,10 +92,24 @@ class PriText extends PriDisplay {
this.dh.width = null;
}
public function get_text():String {
private function get_lineHeight():Float return this.dth.lineHeight;
private function set_lineHeight(value:Float):Float {
this.dth.lineHeight = value;
if (value == null) {
this.dh.jselement.style.removeProperty("line-height");
} else {
this.dh.jselement.style.lineHeight = (value * 100) + "%";
}
return value;
}
private function get_text():String {
if (this.dth.editable) this.dth.text = this.dh.jselement.innerText;
return this.dth.text;
}
private function set_text(value:String):String {
this.dth.text = value;
this.dh.jselement.innerText = value;

0 comments on commit 3d8b1ea

Please sign in to comment.