add request text argument for new tab action

This commit is contained in:
yggverse 2024-09-27 16:04:27 +03:00
parent 404da1fa74
commit 5ce6090d7a
6 changed files with 18 additions and 10 deletions

View file

@ -10,13 +10,17 @@ pub struct Request {
impl Request {
// Construct
pub fn new() -> Self {
pub fn new(text: Option<GString>) -> Self {
// GTK
let widget = Entry::builder()
.placeholder_text("URL or search term...")
.hexpand(true)
.progress_fraction(0.0)
.progress_pulse_step(0.1)
.text(match text {
Some(text) => text,
None => GString::new(),
})
.build();
// Connect events