Merge pull request #1046 from NativeScript/text-decoration

text-decoration implemented
This commit is contained in:
Vladimir Enchev
2015-11-09 09:17:04 +02:00
16 changed files with 229 additions and 4 deletions

View File

@@ -19,4 +19,9 @@ ActionBar, TabView, ActivityIndicator, Label, Button, TextView, TextField, Searc
Switch, Progress, Slider, SegmentedBar {
color: mediumaquamarine;
background-color: aquamarine;
}*/
/*
TextView, TextField, Label, Button {
text-decoration: underline;
}*/

View File

@@ -0,0 +1,17 @@
var obj;
export function loaded(args) {
obj = args.object;
}
export function butonTap(args) {
if (obj.style.textDecoration === "underline") {
obj.style.textDecoration = "line-through";
} else if (obj.style.textDecoration === "line-through") {
obj.style.textDecoration = "line-through underline";
} else if (obj.style.textDecoration === "line-through underline") {
obj.style.textDecoration = "none";
} else if (obj.style.textDecoration === "none") {
obj.style.textDecoration = "underline";
}
}

View File

@@ -0,0 +1,32 @@
<Page >
<ScrollView>
<StackLayout>
<Button text="Change" tap="butonTap" />
<Label text="Text" style.textDecoration="underline" loaded="loaded"/>
<Label text="Label" style="text-decoration:none" />
<Label text="Label" style="text-decoration:underline" />
<Label text="Label" style="text-decoration:line-through" />
<Label text="Label" style="text-decoration:line-through underline" />
<Label text="Label" style="text-decoration:line-through underline none" />
<TextField text="TextField" style="text-decoration:none" />
<TextField text="TextField" style="text-decoration:underline" />
<TextField text="TextField" style="text-decoration:line-through" />
<TextField text="TextField" style="text-decoration:underline line-through" />
<TextField text="TextField" style="text-decoration:underline line-through none" />
<TextView text="TextView" style="text-decoration:none" />
<TextView text="TextView" style="text-decoration:underline" />
<TextView text="TextView" style="text-decoration:line-through" />
<TextView text="TextView" style="text-decoration:line-through underline" />
<TextView text="TextView" style="text-decoration:line-through underline none" />
<Button text="Button" style="text-decoration:none" />
<Button text="Button" style="text-decoration:underline" />
<Button text="Button" style="text-decoration:line-through" />
<Button text="Button" style="text-decoration:underline line-through" />
<Button text="Button" style="text-decoration:underline line-through none" />
</StackLayout>
</ScrollView>
</Page>

View File

@@ -90,4 +90,5 @@ examples.set("textfield", "text-field/text-field");
examples.set("webview", "web-view/web-view");
examples.set("webtest", "web-view/web-vew-test");
examples.set("decoration", "css/text-decoration");
//VM.set("selected", "tabAll");