@@ -30,9 +30,12 @@ use std::time::Duration;
3030pub const WINDOW_WIDTH : f32 = 500. ;
3131pub const DEFAULT_WINDOW_HEIGHT : f32 = 65. ;
3232
33+ pub const RUSTCAST_DESC_NAME : & str = "RustCast" ;
34+
3335#[ derive( Debug , Clone ) ]
3436pub struct App {
3537 pub open_command : Function ,
38+ pub desc : String ,
3639 pub icons : Option < iced:: widget:: image:: Handle > ,
3740 pub name : String ,
3841 pub name_lc : String ,
@@ -43,12 +46,14 @@ impl App {
4346 vec ! [
4447 App {
4548 open_command: Function :: Quit ,
49+ desc: RUSTCAST_DESC_NAME . to_string( ) ,
4650 icons: None ,
4751 name: "Quit RustCast" . to_string( ) ,
4852 name_lc: "quit" . to_string( ) ,
4953 } ,
5054 App {
5155 open_command: Function :: OpenPrefPane ,
56+ desc: RUSTCAST_DESC_NAME . to_string( ) ,
5257 icons: None ,
5358 name: "Open RustCast Preferences" . to_string( ) ,
5459 name_lc: "settings" . to_string( ) ,
@@ -72,26 +77,29 @@ impl App {
7277 }
7378 }
7479
75- tile = tile
76- . push (
77- Button :: new (
78- Text :: new ( self . name . clone ( ) )
79- . height ( Fill )
80- . width ( Fill )
81- . align_y ( Vertical :: Center ) ,
82- )
83- . on_press ( Message :: RunFunction ( self . open_command . clone ( ) ) )
84- . style ( |_, _| iced:: widget:: button:: Style {
85- background : Some ( iced:: Background :: Color (
86- Theme :: KanagawaDragon . palette ( ) . background ,
87- ) ) ,
88- text_color : Theme :: KanagawaDragon . palette ( ) . text ,
89- ..Default :: default ( )
90- } )
91- . width ( Fill )
92- . height ( 55 ) ,
80+ tile = tile. push (
81+ Button :: new (
82+ Text :: new ( & self . name )
83+ . height ( Fill )
84+ . width ( Fill )
85+ . align_y ( Vertical :: Center ) ,
9386 )
87+ . on_press ( Message :: RunFunction ( self . open_command . clone ( ) ) )
88+ . style ( |_, _| iced:: widget:: button:: Style {
89+ background : Some ( iced:: Background :: Color (
90+ Theme :: KanagawaDragon . palette ( ) . background ,
91+ ) ) ,
92+ text_color : Theme :: KanagawaDragon . palette ( ) . text ,
93+ ..Default :: default ( )
94+ } )
95+ . width ( Fill )
96+ . height ( 55 ) ,
97+ ) ;
98+
99+ tile = tile
100+ . push ( container ( Text :: new ( & self . desc ) ) . padding ( 15 ) )
94101 . width ( Fill ) ;
102+
95103 container ( tile)
96104 . style ( |_| iced:: widget:: container:: Style {
97105 text_color : Some ( Theme :: KanagawaDragon . palette ( ) . text ) ,
@@ -228,6 +236,7 @@ impl Tile {
228236 let rand_num = rand:: random_range ( 0 ..100 ) ;
229237 self . results = vec ! [ App {
230238 open_command: Function :: RandomVar ( rand_num) ,
239+ desc: "Easter egg" . to_string( ) ,
231240 icons: None ,
232241 name: rand_num. to_string( ) ,
233242 name_lc: String :: new( ) ,
@@ -243,6 +252,7 @@ impl Tile {
243252 self . results = vec ! [ App {
244253 open_command: Function :: GoogleSearch ( self . query. clone( ) ) ,
245254 icons: None ,
255+ desc: "Search" . to_string( ) ,
246256 name: format!( "Search for: {}" , self . query) ,
247257 name_lc: String :: new( ) ,
248258 } ] ;
0 commit comments