mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-04-02 01:25:27 +00:00
wrap some locals in scope
This commit is contained in:
parent
7223ac9de4
commit
d34b8fe43a
2 changed files with 25 additions and 24 deletions
|
|
@ -24,9 +24,6 @@ impl Text {
|
|||
base: &Uri,
|
||||
gemtext: &str,
|
||||
) -> Self {
|
||||
// Define some local dependencies
|
||||
use gtk::{prelude::WidgetExt, GestureClick};
|
||||
|
||||
// Init gemtext reader
|
||||
let gemini = Gemini::build(actions, base, gemtext).unwrap(); // @TODO handle
|
||||
|
||||
|
|
@ -38,16 +35,18 @@ impl Text {
|
|||
.build();
|
||||
|
||||
// Grab focus into the `TextView` on click empty `ClampScrollable` area
|
||||
let controller = GestureClick::new();
|
||||
{
|
||||
use gtk::{prelude::WidgetExt, GestureClick};
|
||||
let controller = GestureClick::new();
|
||||
|
||||
controller.connect_released({
|
||||
let text_view = gemini.text_view.clone();
|
||||
move |_, _, _, _| {
|
||||
text_view.grab_focus();
|
||||
}
|
||||
});
|
||||
|
||||
clamp_scrollable.add_controller(controller);
|
||||
controller.connect_released({
|
||||
let text_view = gemini.text_view.clone();
|
||||
move |_, _, _, _| {
|
||||
text_view.grab_focus();
|
||||
}
|
||||
});
|
||||
clamp_scrollable.add_controller(controller);
|
||||
}
|
||||
|
||||
Self {
|
||||
text_view: gemini.text_view,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue