Libadwaita gui (#19)

Major Update: Functional GUI Frontend!
This commit is contained in:
Ferdinand Schober
2023-09-20 15:23:33 +02:00
committed by GitHub
parent c50b746816
commit d042c0aa4a
28 changed files with 1202 additions and 187 deletions

View File

@@ -0,0 +1,31 @@
mod imp;
use gtk::glib::{self, Object};
use adw::subclass::prelude::*;
glib::wrapper! {
pub struct ClientObject(ObjectSubclass<imp::ClientObject>);
}
impl ClientObject {
pub fn new(hostname: String, port: u32, active: bool, position: String) -> Self {
Object::builder()
.property("hostname", hostname)
.property("port", port)
.property("active", active)
.property("position", position)
.build()
}
pub fn get_data(&self) -> ClientData {
self.imp().data.borrow().clone()
}
}
#[derive(Default, Clone)]
pub struct ClientData {
pub hostname: String,
pub port: u32,
pub active: bool,
pub position: String,
}