Skip to content

Commit

Permalink
Improve search bar styling
Browse files Browse the repository at this point in the history
  • Loading branch information
joulei committed Aug 21, 2024
1 parent 3c0f782 commit 8af3e81
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions src/shared/search_bar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,31 +8,32 @@ live_design! {
import crate::shared::styles::*;

ICON_SEARCH = dep("crate://self/resources/icons/search.svg")
COLOR_TEXT_INPUT_IDLE = #d8d8d8

SearchBar = <RoundedView> {
width: Fill,
height: Fit,

show_bg: true,
draw_bg: {
color: #fff
color: (COLORP_PRIMARY)
}

padding: {top: 3, bottom: 3, left: 20, right: 20}
padding: {top: 3, bottom: 3, left: 10, right: 20}
spacing: 4,
align: {x: 0.0, y: 0.5},

draw_bg: {
radius: 6.0,
border_color: #D0D5DD,
border_width: 1.0,
radius: 0.0,
border_color: #d8d8d8,
border_width: 0.6,
}

<Icon> {
draw_icon: {
svg_file: (ICON_SEARCH),
fn get_color(self) -> vec4 {
return #666;
return (COLOR_TEXT_INPUT_IDLE);
}
}
icon_walk: {width: 14, height: Fit}
Expand All @@ -47,7 +48,7 @@ live_design! {
draw_text: {
text_style: { font_size: 10 },
fn get_color(self) -> vec4 {
return #555
return (COLOR_TEXT_INPUT_IDLE);
}
}

Expand Down Expand Up @@ -89,8 +90,8 @@ live_design! {
}

draw_bg: {
color: #fff
instance radius: 2.0
color: (COLOR_PRIMARY)
instance radius: 0.0
instance border_width: 0.0
instance border_color: #3
instance inset: vec4(0.0, 0.0, 0.0, 0.0)
Expand Down

0 comments on commit 8af3e81

Please sign in to comment.