mirror of
https://github.com/YGGverse/Yoda.git
synced 2025-02-10 10:24:13 +00:00
draft request update actions
This commit is contained in:
parent
e89a1ae31c
commit
5650d3db10
@ -48,9 +48,6 @@ impl Navigation {
|
|||||||
widget.append(request.widget());
|
widget.append(request.widget());
|
||||||
widget.append(bookmark.widget());
|
widget.append(bookmark.widget());
|
||||||
|
|
||||||
// Connect events
|
|
||||||
// request.widget().connect_changed({ |_, _, _| {} });
|
|
||||||
|
|
||||||
// Result
|
// Result
|
||||||
Self {
|
Self {
|
||||||
widget,
|
widget,
|
||||||
|
@ -1,4 +1,7 @@
|
|||||||
use gtk::{prelude::EntryExt, Entry};
|
use gtk::{
|
||||||
|
prelude::{EditableExt, EntryExt, WidgetExt},
|
||||||
|
Entry,
|
||||||
|
};
|
||||||
|
|
||||||
pub struct Request {
|
pub struct Request {
|
||||||
widget: Entry,
|
widget: Entry,
|
||||||
@ -7,19 +10,28 @@ pub struct Request {
|
|||||||
impl Request {
|
impl Request {
|
||||||
// Construct
|
// Construct
|
||||||
pub fn new() -> Request {
|
pub fn new() -> Request {
|
||||||
Self {
|
// GTK
|
||||||
widget: Entry::builder()
|
let widget = Entry::builder()
|
||||||
.placeholder_text("URL or search term...")
|
.placeholder_text("URL or search term...")
|
||||||
.hexpand(true)
|
.hexpand(true)
|
||||||
.progress_pulse_step(0.1)
|
.progress_pulse_step(0.1)
|
||||||
.build(),
|
.build();
|
||||||
}
|
|
||||||
|
// Connect events
|
||||||
|
widget.connect_changed(|entry| {
|
||||||
|
let _ = entry.activate_action("win.update", None); // @TODO
|
||||||
|
});
|
||||||
|
|
||||||
|
widget.connect_activate(|entry| {
|
||||||
|
// @TODO
|
||||||
|
});
|
||||||
|
|
||||||
|
// Result
|
||||||
|
Self { widget }
|
||||||
}
|
}
|
||||||
|
|
||||||
// Actions
|
// Actions
|
||||||
pub fn update(&self) {
|
pub fn update(&self) {}
|
||||||
// @TODO
|
|
||||||
}
|
|
||||||
|
|
||||||
// Getters
|
// Getters
|
||||||
pub fn widget(&self) -> &Entry {
|
pub fn widget(&self) -> &Entry {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user