@@ -9,7 +9,7 @@ use gpui::{
99use crate :: config:: Config ;
1010use crate :: entries:: SearchEntries ;
1111use crate :: ui:: PowerOptions ;
12- use crate :: ui:: elements:: { Separator , Shortcut , TextInput } ;
12+ use crate :: ui:: elements:: { Icon , Separator , Shortcut , TextInput } ;
1313
1414actions ! ( waystart, [ SelectPrev , SelectNext , OpenProgram , Close ] ) ;
1515const CONTEXT : & str = "Waystart" ;
@@ -76,9 +76,9 @@ impl Render for Waystart {
7676 . size_full ( )
7777 . flex ( )
7878 . flex_col ( )
79+ . bg ( config. background )
7980 . text_color ( config. foreground )
8081 . font_family ( config. font_family . clone ( ) )
81- . bg ( config. background )
8282 . border_color ( config. border )
8383 . border_1 ( )
8484 . rounded_lg ( )
@@ -113,7 +113,15 @@ impl Render for Waystart {
113113 window. dispatch_action ( Box :: new ( Close { } ) , cx) ;
114114 }
115115 } ) )
116- . child ( self . search_bar . clone ( ) )
116+ . child (
117+ div ( )
118+ . h_16 ( )
119+ . flex ( )
120+ . pl_6 ( )
121+ . items_center ( )
122+ . child ( Icon :: Search . build ( config. foreground ) )
123+ . child ( self . search_bar . clone ( ) ) ,
124+ )
117125 . child ( Separator :: new ( ) )
118126 . child (
119127 div ( )
@@ -122,7 +130,13 @@ impl Render for Waystart {
122130 . flex_col ( )
123131 . gap_1 ( )
124132 . px_2 ( )
125- . child ( div ( ) . px_2 ( ) . text_color ( config. muted ) . child ( "Results" ) )
133+ . child (
134+ div ( )
135+ . px_5 ( )
136+ . py_1 ( )
137+ . text_color ( config. muted_foreground )
138+ . child ( "Results" ) ,
139+ )
126140 . child (
127141 uniform_list (
128142 "entry_list" ,
@@ -132,6 +146,7 @@ impl Render for Waystart {
132146
133147 range
134148 . map ( |i| {
149+ let selected = i == this. selected ;
135150 let entry = this. entries . get ( i) . unwrap ( ) . clone ( ) ;
136151
137152 div ( )
@@ -142,30 +157,34 @@ impl Render for Waystart {
142157 . h_12 ( )
143158 . flex ( )
144159 . items_center ( )
145- . gap_4 ( )
146160 . rounded_lg ( )
161+ . when ( selected, |this| this. bg ( config. muted ) )
147162 . when_some ( entry. icon ( ) , |this, icon| {
148163 this. child (
149164 img ( ImageSource :: Resource ( icon. clone ( ) ) )
150165 . size_8 ( )
166+ . mr_4 ( )
151167 . object_fit ( ObjectFit :: Contain ) ,
152168 )
153169 } )
154170 . child ( entry. name ( ) . clone ( ) )
155- . when ( i == this. selected , |this| {
156- this. bg ( config. muted ) . when_some (
157- entry. description ( ) ,
158- |this, description| {
159- this. child (
160- div ( )
161- . text_color ( config. muted_foreground )
162- . child ( description. clone ( ) ) ,
163- )
164- } ,
165- )
166- } )
171+ . when_some (
172+ selected. then_some ( entry. description ( ) ) . flatten ( ) ,
173+ |this, description| {
174+ this. child (
175+ div ( )
176+ . flex ( )
177+ . text_color ( config. muted_foreground )
178+ . when ( selected, |this| {
179+ this. bg ( config. muted )
180+ } )
181+ . child ( " — " )
182+ . child ( description. clone ( ) ) ,
183+ )
184+ } ,
185+ )
167186 . on_mouse_move ( cx. listener ( move |this, _, _, cx| {
168- if this . selected != i {
187+ if !selected {
169188 this. selected = i;
170189 cx. notify ( ) ;
171190 }
@@ -187,9 +206,10 @@ impl Render for Waystart {
187206 . child ( Separator :: new ( ) )
188207 . child (
189208 div ( )
190- . px_2 ( )
191- . py_1 ( )
209+ . h_12 ( )
192210 . flex ( )
211+ . px_4 ( )
212+ . items_center ( )
193213 . gap_2 ( )
194214 . child ( PowerOptions :: new ( ) )
195215 . child (
0 commit comments