@@ -11,7 +11,7 @@ public static class FrameExtensions
1111
1212 static ( string mainNode , string subNode ) ? _borderCssNode = default ;
1313
14- public static ( string mainNode , string subNode ) BorderCssNode ( this Gtk . Frame platformView )
14+ public static ( string mainNode , string subNode ) BorderCssNode ( this Gtk . Container platformView )
1515 {
1616 if ( _borderCssNode is { } )
1717 return _borderCssNode . Value ;
@@ -23,19 +23,18 @@ public static (string mainNode, string subNode) BorderCssNode(this Gtk.Frame pla
2323 return _borderCssNode . Value ;
2424 }
2525
26- public static void UpdateBorderColor ( this Gtk . Frame platformView , Color ? color )
26+ public static void UpdateBorderColor ( this Gtk . Container platformView , Color ? color )
2727 {
28- var ( mainNode , subNode ) = platformView . BorderCssNode ( ) ;
29- platformView . SetStyleColor ( color , mainNode , "border-color" , subNode ) ;
28+ platformView . SetStyleValueNode ( $ "1px solid { color . ToGdkRgba ( ) . ToString ( ) } ", platformView . CssMainNode ( ) , "border" ) ;
3029 }
3130
32- public static void UpdateBorderWidth ( this Gtk . Frame platformView , int width )
31+ public static void UpdateBorderWidth ( this Gtk . Container platformView , int width )
3332 {
3433 var ( mainNode , subNode ) = platformView . BorderCssNode ( ) ;
35- platformView . SetStyleValueNode ( $ "{ width } px", mainNode , "border-width" , subNode ) ;
34+ platformView . SetStyleValueNode ( $ "{ width } px", mainNode , "border-width" ) ;
3635 }
3736
38- public static void UpdateDashPattern ( this Gtk . Frame platformView , float [ ] ? strokeDashPattern )
37+ public static void UpdateDashPattern ( this Gtk . Container platformView , float [ ] ? strokeDashPattern )
3938 {
4039 var ( mainNode , subNode ) = platformView . BorderCssNode ( ) ;
4140
@@ -54,22 +53,22 @@ public static void UpdateDashPattern(this Gtk.Frame platformView, float[]? strok
5453 }
5554
5655 // border-top-left-radius, border-top-right-radius, border-bottom-right-radius, border-bottom-left-radius
57- public static void UpdateBorderRadius ( this Gtk . Frame platformView , float radius , float ? tr = default , float ? br = default , float ? bl = default )
56+ public static void UpdateBorderRadius ( this Gtk . Container platformView , float radius , float ? tr = default , float ? br = default , float ? bl = default )
5857 {
5958 int Clamp ( float r ) => ( int ) ( r < 0 ? 0 : r ) ;
6059
6160 var ( mainNode , subNode ) = platformView . BorderCssNode ( ) ;
6261 if ( tr is not { } || br is not { } || bl is not { } ||
6362 ( radius == tr && radius == br && radius == bl ) )
6463 {
65- platformView . SetStyleValueNode ( $ "{ Clamp ( radius ) } px", mainNode , "border-radius" , subNode ) ;
64+ platformView . SetStyleValueNode ( $ "{ Clamp ( radius ) } px", mainNode , "border-radius" ) ;
6665 return ;
6766 }
6867
69- platformView . SetStyleValueNode ( $ "{ Clamp ( radius ) } px", mainNode , "border-top-left-radius" , subNode ) ;
70- platformView . SetStyleValueNode ( $ "{ Clamp ( tr . Value ) } px", mainNode , "border-top-right-radius" , subNode ) ;
71- platformView . SetStyleValueNode ( $ "{ Clamp ( br . Value ) } px", mainNode , "border-bottom-right-radius" , subNode ) ;
72- platformView . SetStyleValueNode ( $ "{ Clamp ( bl . Value ) } px", mainNode , "border-bottom-left-radius" , subNode ) ;
68+ platformView . SetStyleValueNode ( $ "{ Clamp ( radius ) } px", mainNode , "border-top-left-radius" ) ;
69+ platformView . SetStyleValueNode ( $ "{ Clamp ( tr . Value ) } px", mainNode , "border-top-right-radius" ) ;
70+ platformView . SetStyleValueNode ( $ "{ Clamp ( br . Value ) } px", mainNode , "border-bottom-right-radius" ) ;
71+ platformView . SetStyleValueNode ( $ "{ Clamp ( bl . Value ) } px", mainNode , "border-bottom-left-radius" ) ;
7372
7473 // no effect:
7574 platformView . SetStyleValueNode ( "padding-box" , mainNode , "background-clip" ) ;
@@ -122,7 +121,7 @@ static float[] Radii((PointF from, PointF to)[] corners)
122121 return [ cornerOffset ( 0 ) , cornerOffset ( 1 ) , cornerOffset ( 2 ) , cornerOffset ( 3 ) ] ;
123122 }
124123
125- public static void UpdateShape ( this Gtk . Frame platformView , IShape ? shape )
124+ public static void UpdateShape ( this Gtk . Container platformView , IShape ? shape )
126125 {
127126 if ( platformView is not { } )
128127 return ;
0 commit comments