Skip to content

Commit

Permalink
Fix location preview label to be width: Fill such that wrapping works
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinaboos committed Oct 10, 2024
1 parent 5d8da58 commit 44542db
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 9 additions & 4 deletions src/home/room_screen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -697,6 +697,8 @@ live_design! {
}

<Label> {
width: Fill,
height: Fit,
draw_text: {
wrap: Word,
color: (MESSAGE_TEXT_COLOR),
Expand All @@ -706,6 +708,8 @@ live_design! {
}

location_label = <Label> {
width: Fill,
height: Fit,
align: {x: 0.0, y: 0.5},
padding: {left: 5.0}
draw_text: {
Expand Down Expand Up @@ -2978,10 +2982,11 @@ impl Widget for LocationPreview {
fn draw_walk(&mut self, cx: &mut Cx2d, scope: &mut Scope, walk: Walk) -> DrawStep {
let text = match self.coords {
Some(Ok(c)) => {
// format!("Current location: {},{}\n Timestamp: {:?}",
// c.latitude, c.longitude, self.timestamp,
// )
format!("Current location: {},{}", c.latitude, c.longitude)
// if let Some(st) = self.timestamp {
// format!("Current location: {:.6},{:.6}\n Timestamp: {:?}", c.latitude, c.longitude, st)
// } else {
format!("Current location: {:.6},{:.6}", c.latitude, c.longitude)
// }
}
Some(Err(e)) => format!("Error getting location: {e:?}"),
None => format!("Current location is not yet available."),
Expand Down

0 comments on commit 44542db

Please sign in to comment.