mirror of
https://github.com/Xetibo/ReSet.git
synced 2025-07-03 08:47:45 +02:00
Implement Microphone UI
Improve Audio UI You won't believe what happened (gone sexual)
This commit is contained in:
parent
d07180e2c7
commit
35c58e2fcd
36 changed files with 1380 additions and 399 deletions
|
@ -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();
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
|
|
@ -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
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue