widgets: Allow widgets to fill remaining space
This is implemented by propagating the expected remaining space to all widget draw calls. It is not currently as smart as it could be, but it works well enough to let the last widget in a row/column fill things. BarWidget-type widgets and the Launcher widget now fill remaining space if their length is set to 0.
This commit is contained in:
@@ -52,6 +52,7 @@ impl<'a> Widget for Clock<'a> {
|
||||
&mut self,
|
||||
ctx: &mut DrawContext,
|
||||
pos: (u32, u32),
|
||||
_expansion: (u32, u32),
|
||||
) -> Result<DrawReport, ::std::io::Error> {
|
||||
let (width, height) = self.size();
|
||||
if !(ctx.time.date() != self.cur_time.date()
|
||||
|
||||
Reference in New Issue
Block a user