Dynamically add bluetooth devices

Add scrolling for wifi
Improve audio ui a little
This commit is contained in:
takotori 2023-11-02 10:43:37 +01:00
parent 13084ed86d
commit e34e8ce80f
11 changed files with 263 additions and 141 deletions

View file

@ -1,3 +1,4 @@
use std::cell::RefCell;
use gtk::{CompositeTemplate, glib, ListBox, Switch};
use gtk::prelude::*;
use gtk::subclass::prelude::*;
@ -15,6 +16,8 @@ pub struct BluetoothBox {
pub resetBluetoothAvailableDevices: TemplateChild<ListBox>,
#[template_child]
pub resetBluetoothConnectedDevices: TemplateChild<ListBox>,
pub availableDevices: RefCell<Vec<BluetoothEntry>>,
pub connectedDevices: RefCell<Vec<BluetoothEntry>>,
}
#[glib::object_subclass]
@ -36,6 +39,9 @@ impl ObjectSubclass for BluetoothBox {
impl ObjectImpl for BluetoothBox {
fn constructed(&self) {
self.parent_constructed();
let obj = self.obj();
obj.scanForDevices();
obj.addConnectedDevices();
}
}