@@ -58,7 +58,7 @@ public static ButtonEvent BuildButton(this ImGui gui, Rect rect, SchemeColor nor
5858 public static string ScanToString ( SDL . SDL_Scancode scancode ) => SDL . SDL_GetKeyName ( SDL . SDL_GetKeyFromScancode ( scancode ) ) ;
5959
6060 public static bool BuildLink ( this ImGui gui , string text ) {
61- gui . BuildText ( text , color : SchemeColor . Link ) ;
61+ gui . BuildText ( text , TextBlockDisplayStyle . Default ( SchemeColor . Link ) ) ;
6262 var rect = gui . lastRect ;
6363 switch ( gui . action ) {
6464 case ImGuiAction . MouseMove :
@@ -105,7 +105,7 @@ public static ButtonEvent BuildButton(this ImGui gui, string text, SchemeColor c
105105 }
106106
107107 using ( gui . EnterGroup ( padding ?? DefaultButtonPadding , active ? color + 2 : color + 3 ) ) {
108- gui . BuildText ( text , Font . text , align : RectAlignment . Middle ) ;
108+ gui . BuildText ( text , TextBlockDisplayStyle . Centered ) ;
109109 }
110110
111111 return active ? gui . BuildButton ( gui . lastRect , color , color + 1 ) : ButtonEvent . None ;
@@ -119,10 +119,10 @@ public static ButtonEvent BuildContextMenuButton(this ImGui gui, string text, st
119119 gui . BuildIcon ( icon , color : icon >= Icon . FirstCustom ? disabled ? SchemeColor . SourceFaint : SchemeColor . Source : textColor ) ;
120120 }
121121
122- gui . BuildText ( text , Font . text , true , color : textColor ) ;
122+ gui . BuildText ( text , TextBlockDisplayStyle . WrappedText with { Color = textColor } ) ;
123123 if ( rightText != null ) {
124124 gui . allocator = RectAllocator . RightRow ;
125- gui . BuildText ( rightText , align : RectAlignment . MiddleRight ) ;
125+ gui . BuildText ( rightText , new TextBlockDisplayStyle ( Alignment : RectAlignment . MiddleRight ) ) ;
126126 }
127127 }
128128 return gui . BuildButton ( gui . lastRect , SchemeColor . None , SchemeColor . Grey ) ;
@@ -142,7 +142,7 @@ public static ButtonEvent BuildRedButton(this ImGui gui, string text) {
142142 Rect textRect ;
143143 TextCache ? cache ;
144144 using ( gui . EnterGroup ( DefaultButtonPadding ) ) {
145- textRect = gui . AllocateTextRect ( out cache , text , align : RectAlignment . Middle ) ;
145+ textRect = gui . AllocateTextRect ( out cache , text , TextBlockDisplayStyle . Centered ) ;
146146 }
147147
148148 var evt = gui . BuildButton ( gui . lastRect , SchemeColor . None , SchemeColor . Error ) ;
@@ -200,7 +200,7 @@ public static bool WithTooltip(this ButtonEvent evt, ImGui gui, string tooltip,
200200 public static bool BuildCheckBox ( this ImGui gui , string text , bool value , out bool newValue , SchemeColor color = SchemeColor . None , RectAllocator allocator = RectAllocator . LeftRow ) {
201201 using ( gui . EnterRow ( allocator : allocator ) ) {
202202 gui . BuildIcon ( value ? Icon . CheckBoxCheck : Icon . CheckBoxEmpty , 1.5f , color ) ;
203- gui . BuildText ( text , Font . text , color : color ) ;
203+ gui . BuildText ( text , TextBlockDisplayStyle . Default ( color ) ) ;
204204 }
205205
206206 if ( gui . OnClick ( gui . lastRect ) ) {
@@ -215,7 +215,7 @@ public static bool BuildCheckBox(this ImGui gui, string text, bool value, out bo
215215 public static bool BuildRadioButton ( this ImGui gui , string option , bool selected , SchemeColor color = SchemeColor . None ) {
216216 using ( gui . EnterRow ( ) ) {
217217 gui . BuildIcon ( selected ? Icon . RadioCheck : Icon . RadioEmpty , 1.5f , color ) ;
218- gui . BuildText ( option , Font . text , color : color , wrap : true ) ;
218+ gui . BuildText ( option , TextBlockDisplayStyle . WrappedText with { Color = color } ) ;
219219 }
220220
221221 return ! selected && gui . OnClick ( gui . lastRect ) ;
@@ -239,7 +239,7 @@ public static bool BuildErrorRow(this ImGui gui, string text) {
239239 closed = true ;
240240 }
241241
242- gui . RemainingRow ( ) . BuildText ( text , align : RectAlignment . Middle ) ;
242+ gui . RemainingRow ( ) . BuildText ( text , TextBlockDisplayStyle . Centered ) ;
243243 }
244244 if ( gui . isBuilding ) {
245245 gui . DrawRectangle ( gui . lastRect , SchemeColor . Error ) ;
@@ -263,7 +263,7 @@ public static bool BuildIntegerInput(this ImGui gui, int value, out int newValue
263263
264264 public static void ShowTooltip ( this ImGui gui , Rect rect , GuiBuilder builder , float width = 20f ) => gui . window ? . ShowTooltip ( gui , rect , builder , width ) ;
265265
266- public static void ShowTooltip ( this ImGui gui , Rect rect , string text , float width = 20f ) => gui . window ? . ShowTooltip ( gui , rect , x => x . BuildText ( text , wrap : true ) , width ) ;
266+ public static void ShowTooltip ( this ImGui gui , Rect rect , string text , float width = 20f ) => gui . window ? . ShowTooltip ( gui , rect , x => x . BuildText ( text , TextBlockDisplayStyle . WrappedText ) , width ) ;
267267
268268 public static void ShowTooltip ( this ImGui gui , GuiBuilder builder , float width = 20f ) => gui . window ? . ShowTooltip ( gui , gui . lastRect , builder , width ) ;
269269
0 commit comments