|
@@ -5,6 +5,8 @@ use xcb;
|
|
|
|
|
|
use std::sync::Arc;
|
|
|
|
|
|
+const MARGIN: u16 = 7;
|
|
|
+
|
|
|
pub struct Title {
|
|
|
conn: Arc<x11::Connection>,
|
|
|
context: widget::DrawContext,
|
|
@@ -28,8 +30,8 @@ impl Title {
|
|
|
|
|
|
pub fn redraw(&mut self) {
|
|
|
self.context.draw_bg(self.last_pos, self.last_width);
|
|
|
- self.context.draw_text(&self.title, self.last_pos);
|
|
|
- self.last_width = self.context.measure_text(&self.title);
|
|
|
+ self.context.draw_text(&self.title, self.last_pos + MARGIN);
|
|
|
+ self.last_width = self.context.measure_text(&self.title) + MARGIN;
|
|
|
self.conn.flush();
|
|
|
}
|
|
|
}
|
|
@@ -45,8 +47,8 @@ impl Widget for Title {
|
|
|
|
|
|
fn render(&mut self, x: u16) {
|
|
|
self.last_pos = x;
|
|
|
- self.context.draw_text(&self.title, self.last_pos);
|
|
|
- self.last_width = self.context.measure_text(&self.title);
|
|
|
+ self.context.draw_text(&self.title, self.last_pos + MARGIN);
|
|
|
+ self.last_width = self.context.measure_text(&self.title) + MARGIN;
|
|
|
}
|
|
|
|
|
|
fn width(&mut self) -> u16 {
|