|
@@ -5,6 +5,7 @@ use mpd::idle;
|
|
|
use mpd::idle::Idle;
|
|
|
use std::path::Path;
|
|
|
use std::thread;
|
|
|
+use ui::color;
|
|
|
use ui::draw_context::DrawContext;
|
|
|
use widgets::{Message, MessageSender, Widget};
|
|
|
|
|
@@ -56,7 +57,7 @@ impl Mpd {
|
|
|
|
|
|
fn redraw(&mut self) {
|
|
|
let x = self.last_pos;
|
|
|
- self.context.set_bg_color(0x0, 0x0, 0x0, 0xFFFF);
|
|
|
+ self.context.set_bg_color(color::BLACK);
|
|
|
self.context.draw_bg(x, WIDTH);
|
|
|
self.render(x, WIDTH);
|
|
|
self.context.flush();
|
|
@@ -74,13 +75,13 @@ impl Widget for Mpd {
|
|
|
self.last_pos = x;
|
|
|
let icon_width = self.context.measure_text(self.icon());
|
|
|
|
|
|
- self.context.set_bg_color(0x6666, 0x6666, 0x6666, 0xFFFF);
|
|
|
+ self.context.set_bg_color(color::GREY);
|
|
|
self.context.draw_bg(x, icon_width + MARGIN * 2);
|
|
|
self.context.draw_text(self.icon(), x + MARGIN);
|
|
|
|
|
|
let text = self.get_text();
|
|
|
let text_width = WIDTH - MARGIN * 4 - icon_width;
|
|
|
- self.context.set_bg_color(0x0, 0x0, 0x0, 0xFFFF);
|
|
|
+ self.context.set_bg_color(color::BLACK);
|
|
|
self.context.draw_bg(x + icon_width + MARGIN * 3, text_width);
|
|
|
self.context.draw_text_with_clipping(&text, x + icon_width + MARGIN * 3, text_width);
|
|
|
}
|