Move shared styles and attributes from keyboard-key's children to keyboard-key.

This commit is contained in:
József Farkas
2016-05-16 14:07:08 +02:00
parent c01c049fc7
commit a436298e37
6 changed files with 12 additions and 27 deletions

View File

@@ -32,7 +32,11 @@ enum LabelTypes {
[attr.height]="height" [attr.width]="width"
[attr.fill]="fill"
/>
<svg:g [ngSwitch]="labelType">
<svg:g [ngSwitch]="labelType"
[attr.font-size]="19"
[attr.font-family]="'Helvetica'"
[attr.fill]="'white'"
style="dominant-baseline: central">
<svg:g svg-one-line-text-key *ngSwitchWhen="enumLabelTypes.OneLineText"
[height]="height"
[width]="width"

View File

@@ -8,11 +8,7 @@ import { Component, OnInit, Input } from '@angular/core';
<svg:text
[attr.x]="0"
[attr.y]="height / 2"
[attr.text-anchor]="'middle'"
[attr.font-size]="19"
[attr.font-family]="'Helvetica'"
[attr.fill]="'#ffffff'"
style="dominant-baseline: central">
[attr.text-anchor]="'middle'">
<tspan
[attr.x]="width / 2"
dy="0"

View File

@@ -7,8 +7,7 @@ import { Component, OnInit, Input } from '@angular/core';
`
<svg:use [attr.xlink:href]="icon"
[attr.width]="width / 3" [attr.height]="height / 3"
[attr.x]="width / 3" [attr.y]="height / 3"
fill="white">
[attr.x]="width / 3" [attr.y]="height / 3">
</svg:use>
`
})

View File

@@ -11,17 +11,12 @@ import {MapperService} from '../../services/mapper.service';
[attr.width]="width / 4"
[attr.height]="height / 4"
[attr.x]="width * 3 / 8"
[attr.y]="height / 5"
fill="white">
[attr.y]="height / 5">
</svg:use>
<svg:text
[attr.x]="0"
[attr.y]="height * 2 / 3"
[attr.text-anchor]="'middle'"
[attr.font-size]="19"
[attr.font-family]="'Helvetica'"
[attr.fill]="'#ffffff'"
style="dominant-baseline: central">
[attr.text-anchor]="'middle'">
<tspan [attr.x]="width / 2">{{ abbreviation }}</tspan>
</svg:text>
`

View File

@@ -8,19 +8,14 @@ import { Component, OnInit, Input } from '@angular/core';
<svg:text
[attr.x]="0"
[attr.y]="width > 2*height? height / 2 : height / 3"
[attr.text-anchor]="width > 2*height ? 'end' : 'middle'"
[attr.font-size]="19"
[attr.font-family]="'Helvetica'"
[attr.fill]="'#ffffff'"
style="dominant-baseline: central">
[attr.text-anchor]="width > 2*height ? 'end' : 'middle'">
<tspan [attr.x]="width > 2*height ?0.6*width : width / 2">{{ text }}</tspan>
</svg:text>
<svg:use [attr.xlink:href]="icon"
[attr.width]="width / 3"
[attr.height]="height / 3"
[attr.x]="width > 2*height ? width * 0.6 : width / 3"
[attr.y]="width > 2*height ? height / 3 : height / 2"
fill="white">
[attr.y]="width > 2*height ? height / 3 : height / 2">
</svg:use>
`
})

View File

@@ -8,11 +8,7 @@ import { Component, OnInit, Input } from '@angular/core';
<svg:text
[attr.x]="0"
[attr.y]="height/2"
[attr.text-anchor]="'middle'"
[attr.font-size]="19"
[attr.font-family]="'Helvetica'"
[attr.fill]="'#ffffff'"
style="dominant-baseline: central">
[attr.text-anchor]="'middle'">
<tspan
*ngFor="let text of texts; let index = index"
[attr.x]="width / 2"