got to layouts

This commit is contained in:
Hristo Hristov
2016-12-09 17:57:17 +02:00
parent 07e2102c5d
commit 19ee47ba24
76 changed files with 941 additions and 1002 deletions

View File

@@ -280,8 +280,8 @@ function applyDescriptors(view: ViewBase, ruleset: RuleSet): void {
// try {
// view.style._setValue(resolvedProperty, value, modifier);
// } catch (ex) {
// if (trace.enabled) {
// trace.write("Error setting property: " + resolvedProperty.name + " view: " + view + " value: " + value + " " + ex, trace.categories.Style, trace.messageType.error);
// if (traceEnabled) {
// traceWrite("Error setting property: " + resolvedProperty.name + " view: " + view + " value: " + value + " " + ex, traceCategories.Style, trace.messageType.error);
// }
// }
// }

View File

@@ -128,7 +128,7 @@ declare module "ui/styling/style" {
// public _beginUpdate();
// public _endUpdate();
// public _resetCssValues(): void;
public _resetCssValues(): void;
// public _syncNativeProperties(): void;
// public _inheritStyleProperty(property: Property): void;
// public _inheritStyleProperties(parent: View): void;

View File

@@ -1,5 +1,7 @@
import { Style as StyleDefinition } from "ui/styling/style";
import { Length, PercentLength, Color, Background, Font, ViewBase, Observable } from "ui/core/view";
import { Length, PercentLength, Color, Background, Font, ViewBase } from "ui/core/view";
import { Observable } from "data/observable";
import { resetStyleProperties } from "ui/core/properties";
export class Style extends Observable implements StyleDefinition {
constructor(public view: ViewBase) {
@@ -84,9 +86,16 @@ export class Style extends Observable implements StyleDefinition {
public selectedTabTextColor: Color;
public androidSelectedTabHighlightColor: Color;
// ListView-specific props
public separatorColor: Color;
//SegmentedBar-specific props
public selectedBackgroundColor: Color;
// Page-specific props
public statusBarStyle: string;
public androidStatusBarBackground: Color;
effectiveMinWidth: number;
effectiveMinHeight: number;
effectiveWidth: number;
@@ -134,7 +143,7 @@ export class Style extends Observable implements StyleDefinition {
public _resetCssValues() {
this.view._cancelAllAnimations();
this._resetValues(ValueSource.Css);
resetStyleProperties(this);
}
// public _resetLocalValues() {
@@ -153,12 +162,12 @@ export class Style extends Observable implements StyleDefinition {
// }
// public _onPropertyChanged(property: Property, oldValue: any, newValue: any) {
// if (trace.enabled) {
// trace.write(
// if (traceEnabled) {
// traceWrite(
// "Style._onPropertyChanged view:" + this._view +
// ", property: " + property.name +
// ", oldValue: " + oldValue +
// ", newValue: " + newValue, trace.categories.Style);
// ", newValue: " + newValue, traceCategories.Style);
// }
// super._onPropertyChanged(property, oldValue, newValue);
@@ -212,13 +221,13 @@ export class Style extends Observable implements StyleDefinition {
// let handler: definition.StylePropertyChangedHandler = getHandler(property, this._view);
// if (!handler) {
// if (trace.enabled) {
// trace.write("No handler for property: " + property.name + " with id: " + property.id + ", view:" + this._view, trace.categories.Style);
// if (traceEnabled) {
// traceWrite("No handler for property: " + property.name + " with id: " + property.id + ", view:" + this._view, traceCategories.Style);
// }
// }
// else {
// if (trace.enabled) {
// trace.write("Found handler for property: " + property.name + ", view:" + this._view, trace.categories.Style);
// if (traceEnabled) {
// traceWrite("Found handler for property: " + property.name + ", view:" + this._view, traceCategories.Style);
// }
// let shouldReset = false;

View File

@@ -323,98 +323,98 @@
// export function numberConverter(cssValue: any): number;
//@private
public _beginUpdate();
public _endUpdate();
public _resetCssValues(): void;
public _syncNativeProperties(): void;
// public _inheritStyleProperty(property: dependencyObservable.Property): void;
public _inheritStyleProperties(parent: view.View): void;
public _updateTextDecoration(): void;
public _updateTextTransform(): void;
// public _beginUpdate();
// public _endUpdate();
// public _resetCssValues(): void;
// public _syncNativeProperties(): void;
// // public _inheritStyleProperty(property: dependencyObservable.Property): void;
// public _inheritStyleProperties(parent: view.View): void;
// public _updateTextDecoration(): void;
// public _updateTextTransform(): void;
//@endprivate
}
// }
/**
* Encapsulates the style properties definitions and utility methods.
*/
module properties {
/**
* The font-size property definition.
*/
export var fontSizeProperty: Property;
// /**
// * Encapsulates the style properties definitions and utility methods.
// */
// module properties {
// /**
// * The font-size property definition.
// */
// export var fontSizeProperty: Property;
/**
* The color property definition.
*/
export var colorProperty: Property;
// /**
// * The color property definition.
// */
// export var colorProperty: Property;
/**
* The background-color property definition.
*/
export var backgroundColorProperty: Property;
// /**
// * The background-color property definition.
// */
// export var backgroundColorProperty: Property;
/**
* The text-alignment property definition.
*/
export var textAlignmentProperty: Property;
// /**
// * The text-alignment property definition.
// */
// export var textAlignmentProperty: Property;
/**
* Gets style Property by its name.
* @param The name.
*/
export function getPropertyByName(name: string): Property;
// /**
// * Gets style Property by its name.
// * @param The name.
// */
// export function getPropertyByName(name: string): Property;
/**
* Gets style Property by its CSS name.
* @param The CSS name.
*/
export function getPropertyByCssName(name: string): Property;
// /**
// * Gets style Property by its CSS name.
// * @param The CSS name.
// */
// export function getPropertyByCssName(name: string): Property;
/**
* Executes a callback for all defined style properties.
* @param The callback.
*/
export function eachProperty(callback: (property: Property) => void);
// /**
// * Executes a callback for all defined style properties.
// * @param The callback.
// */
// export function eachProperty(callback: (property: Property) => void);
/**
* Executes a callback for all defined inheritable style properties.
* @param The callback.
*/
export function eachInheritableProperty(callback: (property: Property) => void);
}
// /**
// * Executes a callback for all defined inheritable style properties.
// * @param The callback.
// */
// export function eachInheritableProperty(callback: (property: Property) => void);
// }
/**
* Encapsulates CSS converter methods.
*/
module converters {
/**
* CSS color converter function.
* @param cssValue The css value.
*/
export function colorConverter(cssValue: any): color.Color;
// /**
// * Encapsulates CSS converter methods.
// */
// module converters {
// /**
// * CSS color converter function.
// * @param cssValue The css value.
// */
// export function colorConverter(cssValue: any): color.Color;
/**
* CSS font-size converter function.
* @param cssValue The css value.
*/
export function fontSizeConverter(cssValue: any): number;
// /**
// * CSS font-size converter function.
// * @param cssValue The css value.
// */
// export function fontSizeConverter(cssValue: any): number;
/**
* CSS text-align converter function.
* @param cssValue The css value.
*/
export function textAlignConverter(cssValue: any): string;
// /**
// * CSS text-align converter function.
// * @param cssValue The css value.
// */
// export function textAlignConverter(cssValue: any): string;
/**
* CSS number converter function.
* @param cssValue The css value.
*/
export function numberConverter(cssValue: any): number;
// /**
// * CSS number converter function.
// * @param cssValue The css value.
// */
// export function numberConverter(cssValue: any): number;
/**
* CSS visibility converter function.
* @param cssValue The css value.
*/
export function visibilityConverter(cssValue: any): number;
}
}
// /**
// * CSS visibility converter function.
// * @param cssValue The css value.
// */
// export function visibilityConverter(cssValue: any): number;
// }
// }