mirror of
https://github.com/Xetibo/ReSet.git
synced 2025-12-15 10:01:39 +01:00
Dynamically add wifientries
Update wifi UI Increase size of setting
This commit is contained in:
parent
bf1baf5ca3
commit
f06a436aed
10 changed files with 197 additions and 71 deletions
|
|
@ -1,6 +1,16 @@
|
|||
use std::cell::RefCell;
|
||||
use gtk::{Button, CompositeTemplate, glib, Image, Label};
|
||||
use gtk::subclass::prelude::*;
|
||||
|
||||
#[derive(Default, Copy, Clone)]
|
||||
pub enum WifiStrength {
|
||||
Excellent,
|
||||
Ok,
|
||||
Weak,
|
||||
#[default]
|
||||
None,
|
||||
}
|
||||
|
||||
#[allow(non_snake_case)]
|
||||
#[derive(Default, CompositeTemplate)]
|
||||
#[template(resource = "/org/Xetibo/ReSet/resetWifiEntry.ui")]
|
||||
|
|
@ -8,9 +18,13 @@ pub struct WifiEntry {
|
|||
#[template_child]
|
||||
pub resetWifiStrength: TemplateChild<Image>,
|
||||
#[template_child]
|
||||
pub resetWifiEncrypted: TemplateChild<Image>,
|
||||
#[template_child]
|
||||
pub resetWifiLabel: TemplateChild<Label>,
|
||||
#[template_child]
|
||||
pub resetWifiButton: TemplateChild<Button>,
|
||||
pub wifiName: RefCell<String>,
|
||||
pub wifiStrength: RefCell<WifiStrength>,
|
||||
}
|
||||
|
||||
#[glib::object_subclass]
|
||||
|
|
@ -22,7 +36,7 @@ impl ObjectSubclass for WifiEntry {
|
|||
fn class_init(klass: &mut Self::Class) {
|
||||
klass.bind_template();
|
||||
}
|
||||
|
||||
|
||||
fn instance_init(obj: &glib::subclass::InitializingObject<Self>) {
|
||||
obj.init_template();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue