mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
fix: dont default to Font.default (#8401)
* fix: dont default to Font.default This would cause a font to be set for any label even when using default system font. This will also cause a typeface which is pretty long * lint: lint fixes * fix: added null font guards * fix: Used default bold for TabView Co-authored-by: Vasko <v.trifonov@gmail.com>
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import tabViewModule = require("@nativescript/core/ui/tab-view");
|
||||
import { Font } from "@nativescript/core/ui/styling/font";
|
||||
|
||||
export function getNativeTabCount(tabView: tabViewModule.TabView): number {
|
||||
if (!tabView.ios.viewControllers) {
|
||||
@@ -30,5 +31,5 @@ export function getNativeFont(tabView: tabViewModule.TabView): UIFont {
|
||||
}
|
||||
|
||||
export function getOriginalFont(tabView: tabViewModule.TabView): UIFont {
|
||||
return tabView.style.fontInternal.getUIFont(UIFont.systemFontOfSize(10));
|
||||
return (tabView.style.fontInternal || Font.default).getUIFont(UIFont.systemFontOfSize(10));
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import tabViewModule = require("@nativescript/core/ui/tab-view");
|
||||
import { Font } from "@nativescript/core/ui/styling/font";
|
||||
|
||||
export function getNativeTabCount(tabView: tabViewModule.TabView): number {
|
||||
if (!tabView.ios.viewControllers) {
|
||||
@@ -30,5 +31,5 @@ export function getNativeFont(tabView: tabViewModule.TabView): UIFont {
|
||||
}
|
||||
|
||||
export function getOriginalFont(tabView: tabViewModule.TabView): UIFont {
|
||||
return tabView.style.fontInternal.getUIFont(UIFont.systemFontOfSize(10));
|
||||
return (tabView.style.fontInternal || Font.default).getUIFont(UIFont.systemFontOfSize(10));
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { Tabs } from "@nativescript/core/ui/tabs";
|
||||
import { Font } from "@nativescript/core/ui/styling/font";
|
||||
|
||||
// TODO: Should we add getCount to UIPageViewController???
|
||||
export function getNativeTabCount(tabView: Tabs): number {
|
||||
@@ -39,5 +40,5 @@ export function getNativeFont(tabView: Tabs): UIFont {
|
||||
}
|
||||
|
||||
export function getOriginalFont(tabView: Tabs): UIFont {
|
||||
return tabView.style.fontInternal.getUIFont(UIFont.systemFontOfSize(10));
|
||||
return (tabView.style.fontInternal || Font.default).getUIFont(UIFont.systemFontOfSize(10));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user