Commit 1a3a9184 authored by Jeremy Soller's avatar Jeremy Soller

Adjust combo-box color when focused

parent 74e9ef53
......@@ -68,6 +68,10 @@ text-box :focus {
border-color: #5294E2;
}
combo-box :focus {
border-color: #5294E2;
}
combo-box-toggle :active {
background: #5294E2;
}
......
......@@ -315,7 +315,7 @@ impl Widget for ComboBox {
&self.margin
}
fn draw(&self, renderer: &mut Renderer, _focused: bool, theme: &Theme) {
fn draw(&self, renderer: &mut Renderer, focused: bool, theme: &Theme) {
let rect = self.rect.get();
let activated = self.activated.get();
let offset = self.offset.get();
......@@ -340,7 +340,7 @@ impl Widget for ComboBox {
if point.y >= rect.y
&& point.y + rect.height as i32 <= flyout_rect.y + flyout_rect.height as i32
{
entry.draw(renderer, _focused, theme);
entry.draw(renderer, focused, theme);
}
}
}
......@@ -352,6 +352,10 @@ impl Widget for ComboBox {
selector = selector.with_pseudo_class("active");
}
if focused {
selector = selector.with_pseudo_class("focus");
}
draw_box(renderer, rect, theme, &selector);
// draw toggle indicator
......@@ -377,12 +381,12 @@ impl Widget for ComboBox {
if activated {
if let Some(ref icon) = *self.toggle_icon_active.borrow() {
icon.position(toggle_rect.x, toggle_rect.y);
icon.draw(renderer, _focused, theme)
icon.draw(renderer, focused, theme)
}
} else {
if let Some(ref icon) = *self.toggle_icon.borrow() {
icon.position(toggle_rect.x, toggle_rect.y);
icon.draw(renderer, _focused, theme)
icon.draw(renderer, focused, theme)
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment