diff --git a/data/gtk/window.ui b/data/gtk/window.ui index b343c97..682a9a4 100644 --- a/data/gtk/window.ui +++ b/data/gtk/window.ui @@ -44,9 +44,17 @@ Image Viewer - Click here or drag an image here to open a file. + Click "Open File…" or drag an image here. - + + center + Open File… + win.open + + diff --git a/src/window.rs b/src/window.rs index a341c84..ff4cfdc 100644 --- a/src/window.rs +++ b/src/window.rs @@ -65,8 +65,6 @@ mod imp { pub status_page: TemplateChild, #[template_child] pub image_view: TemplateChild, - #[template_child] - pub open_gesture: TemplateChild, } #[glib::object_subclass] @@ -127,14 +125,8 @@ mod imp { // For callbacks, you will want to reference the GTK docs on // the relevant signal to see which parameters you need. - // In this case, we need none to react to the gesture, - // so "_" is used in all 4 spots. - self.open_gesture - .connect_released(clone!(@weak obj => move |_, _, _, _| { - obj.pick_file(); - })); - - // Property bindings didn't seem to work here + // In this case, we need one to react to the signal, + // so we name it `iv` then use `_` for the other spots. self.image_view.connect_notify_local( Some("filename"), clone!(@weak obj => move |iv, _| {