Skip to content

Commit d8dc4fd

Browse files
committed
fix: highlightColor as css property too
1 parent 4578ded commit d8dc4fd

File tree

1 file changed

+13
-6
lines changed
  • src/core/tab-navigation-base/tab-strip

1 file changed

+13
-6
lines changed

src/core/tab-navigation-base/tab-strip/index.ts

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* @module @nativescript-community/ui-material-core/tab-navigation-base/tab-strip
3-
*/
4-
import { AddArrayFromBuilder, AddChildFromBuilder, CSSType, Color, EventData, Property, View, ViewBase, booleanConverter } from '@nativescript/core';
3+
*/
4+
import { AddArrayFromBuilder, AddChildFromBuilder, CSSType, Color, CssProperty, Property, Style, View, ViewBase, booleanConverter } from '@nativescript/core';
55
import { backgroundColorProperty, backgroundInternalProperty, colorProperty, fontInternalProperty } from '@nativescript/core/ui/styling/style-properties';
66
import { textTransformProperty } from '@nativescript/core/ui/text-base';
77
import { TabNavigationBase } from '../tab-navigation-base';
@@ -12,8 +12,9 @@ export const traceCategory = 'TabView';
1212

1313
// Place this on top because the webpack ts-loader doesn't work when export
1414
// is after reference
15-
export const highlightColorProperty = new Property<TabStrip, Color>({
15+
export const highlightColorProperty = new CssProperty<Style, Color>({
1616
name: 'highlightColor',
17+
cssName: 'highlight-color',
1718
equalityComparer: Color.equals,
1819
valueConverter: (v) => new Color(v)
1920
});
@@ -34,11 +35,17 @@ export class TabStrip extends View implements TabStripDefinition, AddChildFromBu
3435
public items: TabStripItem[];
3536
public isIconSizeFixed: boolean;
3637
public iosIconRenderingMode: 'automatic' | 'alwaysOriginal' | 'alwaysTemplate';
38+
39+
40+
/**
41+
* defines the highlight color of the TabStrip item
42+
* can be defined through css `highlight-color`
43+
*/
3744
public highlightColor: Color;
3845
public selectedItemColor: Color;
3946
public unSelectedItemColor: Color;
40-
public _hasImage: boolean;
41-
public _hasTitle: boolean;
47+
protected _hasImage: boolean;
48+
protected _hasTitle: boolean;
4249

4350
public eachChild(callback: (child: ViewBase) => boolean) {
4451
const items = this.items;
@@ -181,6 +188,6 @@ export const isIconSizeFixedProperty = new Property<TabStrip, boolean>({
181188
});
182189
isIconSizeFixedProperty.register(TabStrip);
183190

184-
highlightColorProperty.register(TabStrip);
191+
highlightColorProperty.register(Style);
185192
selectedItemColorProperty.register(TabStrip);
186193
unSelectedItemColorProperty.register(TabStrip);

0 commit comments

Comments
 (0)