@@ -51,6 +51,8 @@ export component Select inherits SCard {
5151 in property <string > placeholder : DefaultSSelectProps.placeholder;
5252 in-out property <bool > is-show : DefaultSSelectProps.is-show;
5353 in-out property <int > active : -1 ;
54+ out property <bool > has-hover <=> selector.has-hover;
55+ out property <bool > expand-hover <=> expand-area.has-hover;
5456 callback changed (int , SOption );
5557 public function open () {
5658 expand.visible=true ;
@@ -68,7 +70,6 @@ export component Select inherits SCard {
6870 return root .active >= 0 && root .active <= options.length - 1 ;
6971 }
7072 selector :=TouchArea {
71- z : 111 ;
7273 HorizontalLayout {
7374 padding-left : root .padding-left;
7475 padding-right : root .padding-right;
@@ -81,7 +82,6 @@ export component Select inherits SCard {
8182 font-italic : root .font-italic;
8283 }
8384 select-icon-view :=Rectangle {
84- z : 110 ;
8585 width : select-icon.width;
8686 select-icon :=SIcon {
8787 theme : root .theme;
@@ -108,35 +108,38 @@ export component Select inherits SCard {
108108 y : parent .height + 6px ;
109109 card-width : parent .card-width;
110110 height : UseSurrealismFn.count-height(root .item-font-size,root .card-padding.padding-top) * 3 ;
111- list :=ListView {
112- padding-top : parent .padding-top;
113- padding-bottom : parent .padding-bottom;
114- for range [index ] in root .options : Rectangle {
115- height : area.height;
116- background :area.has-hover?expand.background.brighter(0.1 ):expand.background;
117- area :=TouchArea {
118- mouse-cursor : pointer;
119- z : 111 ;
120- height : list-item.height;
121- clicked => {
122- root .active = index;
123- root .changed (index, range);
124- }
125- list-item := SText {
126- height : UseSurrealismFn.count-height(root .item-font-size,root .card-padding.padding-top);
127- padding-left : root .padding-left;
128- padding-right : root .padding-right;
129- width : root .width - self .padding-left - self .padding-right;
130- theme : root .theme;
131- text : range.label;
132- font-family : item-font-family;
133- font-size : item-font-size;
134- font-weight : item-font-weight;
135- font-italic : item-font-italic;
111+ expand-area := TouchArea {
112+ mouse-cursor : pointer;
113+ height : parent .height;
114+ width : parent .width;
115+ list :=ListView {
116+ padding-top : parent .padding-top;
117+ padding-bottom : parent .padding-bottom;
118+ for range [index ] in root .options : Rectangle {
119+ height : area.height;
120+ background :area.has-hover?expand.background.brighter(0.1 ):expand.background;
121+ area :=TouchArea {
122+ mouse-cursor : pointer;
123+ height : list-item.height;
124+ clicked => {
125+ root .active = index;
126+ root .changed (index, range);
127+ }
128+ list-item := SText {
129+ height : UseSurrealismFn.count-height(root .item-font-size,root .card-padding.padding-top);
130+ padding-left : root .padding-left;
131+ padding-right : root .padding-right;
132+ width : root .width - self .padding-left - self .padding-right;
133+ theme : root .theme;
134+ text : range.label;
135+ font-family : item-font-family;
136+ font-size : item-font-size;
137+ font-weight : item-font-weight;
138+ font-italic : item-font-italic;
139+ }
136140 }
137141 }
138142 }
139143 }
140144 }
141- }
142-
145+ }
0 commit comments