Implement Microphone UI

Improve Audio UI
You won't believe what happened (gone sexual)
This commit is contained in:
takotori 2023-11-12 17:43:01 +01:00
parent d07180e2c7
commit 35c58e2fcd
36 changed files with 1380 additions and 399 deletions

View file

@ -1,6 +1,8 @@
use adw::glib;
use adw::glib::Object;
use adw::subclass::prelude::ObjectSubclassIsExt;
use gtk::glib::Variant;
use gtk::prelude::ActionableExt;
use crate::components::bluetooth::bluetoothBoxImpl;
use crate::components::bluetooth::bluetoothEntry::BluetoothEntry;
@ -18,6 +20,14 @@ impl BluetoothBox {
Object::builder().build()
}
pub fn setupCallbacks(&self) {
let selfImp = self.imp();
selfImp.resetVisibility.set_action_name(Some("navigation.push"));
selfImp.resetVisibility.set_action_target_value(Some(&Variant::from("visibility")));
selfImp.resetBluetoothMainTab.set_action_name(Some("navigation.pop"));
}
pub fn scanForDevices(&self) {
let selfImp = self.imp();
let mut wifiEntries = selfImp.availableDevices.borrow_mut();

View file

@ -17,6 +17,10 @@ pub struct BluetoothBox {
pub resetBluetoothAvailableDevices: TemplateChild<ListBox>,
#[template_child]
pub resetBluetoothConnectedDevices: TemplateChild<ListBox>,
#[template_child]
pub resetVisibility: TemplateChild<ListEntry>,
#[template_child]
pub resetBluetoothMainTab: TemplateChild<ListEntry>,
pub availableDevices: RefCell<Vec<ListEntry>>,
pub connectedDevices: RefCell<Vec<ListEntry>>,
}
@ -42,6 +46,7 @@ impl ObjectImpl for BluetoothBox {
fn constructed(&self) {
self.parent_constructed();
let obj = self.obj();
obj.setupCallbacks();
obj.scanForDevices();
obj.addConnectedDevices();
}

View file

@ -18,7 +18,7 @@ impl BluetoothEntry {
entryImp.resetBluetoothDeviceType.get().set_from_icon_name(match deviceType {
DeviceTypes::Mouse => Some("input-mouse-symbolic"),
DeviceTypes::Keyboard => Some("input-keyboard-symbolic"),
DeviceTypes::Headset => Some("audio-headset-symbolic"),
DeviceTypes::Headset => Some("output-headset-symbolic"),
DeviceTypes::Controller => Some("input-gaming-symbolic"),
DeviceTypes::None => Some("text-x-generic-symbolic") // no generic bluetooth device icon found
});