⭐️ Impl: Aux. Preview - width
Update MenuAuxiliaryPreviewConfig.ts
This commit is contained in:
parent
e940594d9b
commit
ff87f23733
@ -141,6 +141,7 @@ struct RNIContextMenuAuxiliaryPreviewConfig {
|
||||
// ------------------
|
||||
|
||||
var height: CGFloat?;
|
||||
var width: CGFloat?;
|
||||
|
||||
var anchorPosition: AnchorPosition;
|
||||
var alignmentHorizontal: HorizontalAlignment;
|
||||
@ -156,6 +157,7 @@ struct RNIContextMenuAuxiliaryPreviewConfig {
|
||||
|
||||
init(dictionary: NSDictionary){
|
||||
self.height = dictionary["height"] as? CGFloat;
|
||||
self.width = dictionary["width" ] as? CGFloat;
|
||||
|
||||
self.anchorPosition = {
|
||||
guard let string = dictionary["anchorPosition"] as? String,
|
||||
|
||||
@ -539,9 +539,9 @@ fileprivate extension RNIContextMenuView {
|
||||
case .stretchPreview:
|
||||
return morphingPlatterView.frame.width - adj;
|
||||
|
||||
// C - Infer aux preview width from view...
|
||||
// C - Infer aux config or aux preview width from view...
|
||||
default:
|
||||
return previewAuxiliaryView.frame.width;
|
||||
return auxConfig.width ?? previewAuxiliaryView.frame.width;
|
||||
};
|
||||
}();
|
||||
|
||||
|
||||
@ -49,8 +49,7 @@ export type MenuAuxiliaryPreviewTransitionEntranceDelay =
|
||||
|
||||
export type MenuAuxiliaryPreviewConfig = {
|
||||
height?: number;
|
||||
// TODO: Make optional - if null determine width from component view height
|
||||
// width?: number;
|
||||
width?: number;
|
||||
|
||||
anchorPosition?: MenuAuxiliaryPreviewAnchorPosition;
|
||||
alignmentHorizontal?: MenuAuxiliaryPreviewHorizontalAlignment;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user