Remove superflous blocks
@@ -187,7 +187,6 @@ impl WindowBuilder {
Inhibit(true)
});
- {
let last_size = Cell::new((0, 0));
drawing_area.connect_draw(clone!(handle => move |widget, context| {
@@ -223,9 +222,7 @@ impl WindowBuilder {
Inhibit(false)
}));
- }
- {
drawing_area.connect_button_press_event(clone!(handle => move |_widget, button| {
if let Some(state) = handle.state.upgrade() {
let mut ctx = WinCtxImpl::from(&handle);
@@ -243,9 +240,7 @@ impl WindowBuilder {
Inhibit(true)
}));
- }
- {
drawing_area.connect_button_release_event(clone!(handle => move |_widget, button| {
if let Some(state) = handle.state.upgrade() {
let mut ctx = WinCtxImpl::from(&handle);
@@ -263,9 +258,7 @@ impl WindowBuilder {
Inhibit(true)
}));
- }
- {
drawing_area.connect_motion_notify_event(clone!(handle=>move |_widget, motion| {
if let Some(state) = handle.state.upgrade() {
let mut ctx = WinCtxImpl::from(&handle);
@@ -286,9 +279,7 @@ impl WindowBuilder {
Inhibit(true)
}));
- }
- {
drawing_area.connect_scroll_event(clone!(handle => move |_widget, scroll| {
if let Some(state) = handle.state.upgrade() {
let mut ctx = WinCtxImpl::from(&handle);
@@ -333,9 +324,7 @@ impl WindowBuilder {
Inhibit(true)
}));
- }
- {
drawing_area.connect_key_press_event(clone!(handle => move |_widget, key| {
if let Some(state) = handle.state.upgrade() {
let mut ctx = WinCtxImpl::from(&handle);
@@ -351,9 +340,7 @@ impl WindowBuilder {
Inhibit(true)
}));
- }
- {
drawing_area.connect_key_release_event(clone!(handle => move |_widget, key| {
if let Some(state) = handle.state.upgrade() {
let mut ctx = WinCtxImpl::from(&handle);
@@ -366,16 +353,13 @@ impl WindowBuilder {
Inhibit(true)
}));
- }
- {
drawing_area.connect_destroy(clone!(handle => move |_widget| {
if let Some(state) = handle.state.upgrade() {
let mut ctx = WinCtxImpl::from(&handle);
state.handler.borrow_mut().destroy(&mut ctx);
}
}));
- }
vbox.pack_end(&drawing_area, true, true, 0);
