small cleanups

This commit is contained in:
LordMZTE 2021-07-20 23:03:40 +02:00
parent 3a23f6cabf
commit 0a429a2080

View file

@ -62,7 +62,7 @@ impl Debug for RuntimeMsg {
#[derive(Clone, Msg)]
pub enum Msg {
Quit,
Clicked,
Request,
UpdateText(String),
Working(bool),
}
@ -86,7 +86,7 @@ impl Widget for Win {
fn update(&mut self, event: Msg) {
match event {
Msg::Quit => gtk::main_quit(),
Msg::Clicked => {
Msg::Request => {
let msg = RuntimeMsg {
url: self.widgets.input.text().to_string(),
sender: self.model.sender.clone(),
@ -108,14 +108,16 @@ impl Widget for Win {
orientation: Orientation::Vertical,
#[name = "input"]
gtk::Entry {},
gtk::Entry {
activate => Msg::Request,
},
gtk::Box {
orientation: Orientation::Horizontal,
gtk::Button {
label: "Test",
label: "Request!",
hexpand: true,
clicked => Msg::Clicked,
clicked => Msg::Request,
},
gtk::Spinner {
active: self.model.working,