From: Bowon Ryu Date: Wed, 10 Jul 2024 05:40:25 +0000 (+0900) Subject: [NUI] Add RequestAsyncRenderWithConstraint to TextLabel X-Git-Tag: submit/tizen/20240821.061804~1^2~17 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=fe26abe0351f26692b6c8d1e0b028324cc3f412e;p=platform%2Fcore%2Fcsapi%2Ftizenfx.git [NUI] Add RequestAsyncRenderWithConstraint to TextLabel Requests asynchronous rendering with the maximum available width using the given widthConstraint. If the width of the text content is smaller than the widthConstraint, the width will be determined by the width of the text. If the width of the text content is larger than the widthConstraint, the width will be determined by the widthConstraint. The height is determined by the content of the text when rendered with the given width. In this case, the result will be the same as the height returned by GetHeightForWidth. Signed-off-by: Bowon Ryu --- diff --git a/src/Tizen.NUI/src/internal/Interop/Interop.TextLabel.cs b/src/Tizen.NUI/src/internal/Interop/Interop.TextLabel.cs index b321719fa..502eac09d 100755 --- a/src/Tizen.NUI/src/internal/Interop/Interop.TextLabel.cs +++ b/src/Tizen.NUI/src/internal/Interop/Interop.TextLabel.cs @@ -199,6 +199,9 @@ namespace Tizen.NUI [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_TextLabel_RequestAsyncRenderWithFixedWidth")] public static extern void RequestAsyncRenderWithFixedWidth(global::System.Runtime.InteropServices.HandleRef textLabelRef, float width); + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_TextLabel_RequestAsyncRenderWithConstraint")] + public static extern void RequestAsyncRenderWithConstraint(global::System.Runtime.InteropServices.HandleRef textLabelRef, float widthConstraint); + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_TextLabel_AsyncTextRenderedSignal")] public static extern global::System.IntPtr AsyncTextRenderedSignal(global::System.Runtime.InteropServices.HandleRef jarg1); } diff --git a/src/Tizen.NUI/src/public/BaseComponents/TextLabel.cs b/src/Tizen.NUI/src/public/BaseComponents/TextLabel.cs index dc2ba066c..256776878 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/TextLabel.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/TextLabel.cs @@ -351,6 +351,23 @@ namespace Tizen.NUI.BaseComponents if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } + /// + /// Requests asynchronous rendering with the maximum available width using the given widthConstraint. + /// + /// The maximum available width of text to render. + /// + /// If the width of the text content is smaller than the widthConstraint, the width will be determined by the width of the text.
+ /// If the width of the text content is larger than the widthConstraint, the width will be determined by the widthConstraint.
+ /// The height is determined by the content of the text when rendered with the given width.
+ /// In this case, the result will be the same as the height returned by GetHeightForWidth. + ///
+ [EditorBrowsable(EditorBrowsableState.Never)] + public void RequestAsyncRenderWithConstraint(float widthConstraint) + { + Interop.TextLabel.RequestAsyncRenderWithConstraint(SwigCPtr, widthConstraint); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + /// /// The TranslatableText property.
/// The text can set the SID value.