feat: glass effects containers

This commit is contained in:
Nathan Walker
2025-09-15 10:18:06 -07:00
parent abe0b7a9cd
commit f2ec80f4ff
19 changed files with 374 additions and 53 deletions

View File

@@ -2,10 +2,11 @@ import { ControlStateChangeListener } from '../core/control-state-change';
import { ButtonBase } from './button-common';
import { View, PseudoClassHandler } from '../core/view';
import { borderTopWidthProperty, borderRightWidthProperty, borderBottomWidthProperty, borderLeftWidthProperty, paddingLeftProperty, paddingTopProperty, paddingRightProperty, paddingBottomProperty } from '../styling/style-properties';
import { textAlignmentProperty, whiteSpaceProperty, textOverflowProperty } from '../text-base';
import { textAlignmentProperty, whiteSpaceProperty, textOverflowProperty, textProperty } from '../text-base';
import { resetSymbol } from '../text-base/text-base-common';
import { layout } from '../../utils';
import { SDK_VERSION } from '../../utils/constants';
import { CoreTypes } from '../../core-types';
import { Color } from '../../color';
export * from './button-common';
@@ -208,6 +209,34 @@ export class Button extends ButtonBase {
};
}
// [textProperty.setNative](value: string | number | symbol) {
// if (SDK_VERSION >= 26) {
// const config = UIButtonConfiguration.plainButtonConfiguration();
// // const attrs = {};
// // attrs[NSFontAttributeName] = UIFont.preferredFontForTextStyle(UIFontTextStyleHeadline);
// // config.attributedTitle = NSAttributedString.alloc().initWithStringAttributes(this.text, {
// // [NSFontAttributeName]: UIFont.preferredFontForTextStyle(UIFontTextStyleHeadline),
// // } as any);
// //attributes: AttributeContainer([
// // .font : UIFont.preferredFont(forTextStyle: .headline)
// // ])
// this.nativeViewProtected.tintColor = UIColor.labelColor;
// config.contentInsets = NSDirectionalEdgeInsetsFromString('8,12,8,12');
// // semantic; flips as needed over glass
// config.baseForegroundColor = UIColor.labelColor;
// this.nativeViewProtected.configuration = config;
// this._requestLayoutOnTextChanged();
// } else {
// const reset = value === resetSymbol;
// if (!reset && this.formattedText) {
// return;
// }
// this._setNativeText(reset);
// this._requestLayoutOnTextChanged();
// }
// }
[textAlignmentProperty.setNative](value: CoreTypes.TextAlignmentType) {
switch (value) {
case 'left':