| @@ -104,7 +104,6 @@ impl Bar { |
| 104 |
if !self.needs_redraw { |
104 |
if !self.needs_redraw { |
| 105 |
return Ok(()); |
105 |
return Ok(()); |
| 106 |
} |
106 |
} |
| 107 |
- |
|
|
| 108 |
connection.change_gc( |
107 |
connection.change_gc( |
| 109 |
self.graphics_context, |
108 |
self.graphics_context, |
| 110 |
&ChangeGCAux::new().foreground(SCHEME_NORMAL.background), |
109 |
&ChangeGCAux::new().foreground(SCHEME_NORMAL.background), |
| @@ -152,7 +151,14 @@ impl Bar { |
| 152 |
height: self.height, |
151 |
height: self.height, |
| 153 |
}], |
152 |
}], |
| 154 |
)?; |
153 |
)?; |
| 155 |
- } else if is_occupied { |
154 |
+ } |
|
|
155 |
+ |
|
|
156 |
+ let text_y = (self.height as i16 / 2) + (self.font.ascent() / 2); |
|
|
157 |
+ self.font_draw |
|
|
158 |
+ .draw_text(&self.font, scheme.foreground, x_position + 5, text_y, tag); |
|
|
159 |
+ |
|
|
160 |
+ if is_selected { |
|
|
161 |
+ let underline_height = 2; |
| 156 |
connection.change_gc( |
162 |
connection.change_gc( |
| 157 |
self.graphics_context, |
163 |
self.graphics_context, |
| 158 |
&ChangeGCAux::new().foreground(scheme.border), |
164 |
&ChangeGCAux::new().foreground(scheme.border), |
| @@ -162,17 +168,13 @@ impl Bar { |
| 162 |
self.graphics_context, |
168 |
self.graphics_context, |
| 163 |
&[Rectangle { |
169 |
&[Rectangle { |
| 164 |
x: x_position, |
170 |
x: x_position, |
| 165 |
- y: 0, |
171 |
+ y: (self.height - underline_height) as i16, |
| 166 |
width: tag_width, |
172 |
width: tag_width, |
| 167 |
- height: 2, |
173 |
+ height: underline_height, |
| 168 |
}], |
174 |
}], |
| 169 |
)?; |
175 |
)?; |
| 170 |
} |
176 |
} |
| 171 |
|
177 |
|
| 172 |
- let text_y = (self.height as i16 / 2) + (self.font.ascent() / 2); |
|
|
| 173 |
- self.font_draw |
|
|
| 174 |
- .draw_text(&self.font, scheme.foreground, x_position + 5, text_y, tag); |
|
|
| 175 |
- |
|
|
| 176 |
x_position += tag_width as i16; |
178 |
x_position += tag_width as i16; |
| 177 |
} |
179 |
} |
| 178 |
|
180 |
|