feat: logging support and proper error handling

This commit is contained in:
Jake Stanger
2022-08-21 23:36:07 +01:00
parent 917838c98c
commit ab8f7ecfc8
28 changed files with 1056 additions and 388 deletions

View File

@@ -107,9 +107,10 @@ impl Popup {
let screen_width = self.monitor.workarea().width();
let popup_width = self.window.allocated_width();
let top_level = button.toplevel().expect("Failed to get top-level widget");
let (widget_x, _) = button
.translate_coordinates(&button.toplevel().unwrap(), 0, 0)
.unwrap();
.translate_coordinates(&top_level, 0, 0)
.unwrap_or((0, 0));
let widget_center = f64::from(widget_x) + f64::from(widget_width) / 2.0;