chore: Show address for bluetooth

This commit is contained in:
Fabio Lenherr / DashieTM 2023-12-06 19:15:39 +01:00
parent 64a5a67e29
commit 8518d6e247
4 changed files with 65 additions and 23 deletions

View file

@ -3,7 +3,6 @@ use std::time::Duration;
use crate::components::bluetooth::bluetooth_entry_impl;
use adw::glib::Object;
use adw::prelude::ActionRowExt;
use adw::subclass::prelude::ObjectSubclassIsExt;
use adw::{glib, ActionRow};
use dbus::blocking::Connection;
@ -29,7 +28,10 @@ impl BluetoothEntry {
.reset_bluetooth_label
.get()
.set_text(&device.alias);
entry.set_subtitle(&device.address);
entry_imp
.reset_bluetooth_address
.get()
.set_text(&device.address);
entry.set_activatable(true);
if device.icon.is_empty() {
entry_imp

View file

@ -14,6 +14,8 @@ pub struct BluetoothEntry {
#[template_child]
pub reset_bluetooth_label: TemplateChild<Label>,
#[template_child]
pub reset_bluetooth_address: TemplateChild<Label>,
#[template_child]
pub reset_bluetooth_button: TemplateChild<Button>,
pub device_name: RefCell<String>,
}

View file

@ -14,17 +14,39 @@
</object>
</child>
<child>
<object class="GtkLabel" id="reset_bluetooth_label">
<property name="ellipsize">end</property>
<object class="GtkBox">
<property name="hexpand">True</property>
<property name="hexpand-set">True</property>
<property name="label">LoremIpsum Wireless Mouse</property>
<property name="margin-end">10</property>
<property name="single-line-mode">True</property>
<property name="vexpand">True</property>
<property name="vexpand-set">True</property>
<property name="width-request">200</property>
<property name="xalign">0.0</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkLabel" id="reset_bluetooth_label">
<property name="ellipsize">end</property>
<property name="hexpand">True</property>
<property name="hexpand-set">True</property>
<property name="label">LoremIpsum Wireless Mouse</property>
<property name="margin-end">10</property>
<property name="single-line-mode">True</property>
<property name="vexpand">True</property>
<property name="vexpand-set">True</property>
<property name="width-request">200</property>
<property name="xalign">0.0</property>
</object>
</child>
<child>
<object class="GtkLabel" id="reset_bluetooth_address">
<property name="ellipsize">end</property>
<property name="hexpand">True</property>
<property name="hexpand-set">True</property>
<property name="label">LoremIpsum Wireless Mouse</property>
<property name="margin-end">10</property>
<property name="sensitive">False</property>
<property name="single-line-mode">True</property>
<property name="vexpand">True</property>
<property name="vexpand-set">True</property>
<property name="width-request">200</property>
<property name="xalign">0.0</property>
</object>
</child>
</object>
</child>
<child>

View file

@ -161,8 +161,10 @@
(11,32,"AdwActionRow","resetBluetoothEntry",None,None,None,None,-1,None),
(11,39,"GtkBox",None,32,None,None,None,-1,None),
(11,40,"GtkImage","reset_bluetooth_device_type",39,None,None,None,None,None),
(11,44,"GtkButton","reset_bluetooth_button",39,None,None,None,2,None),
(11,45,"GtkLabel","reset_bluetooth_label",39,None,None,None,1,None),
(11,44,"GtkButton","reset_bluetooth_button",39,None,None,None,3,None),
(11,47,"GtkBox",None,39,None,None,None,2,None),
(11,48,"GtkLabel","reset_bluetooth_label",47,None,None,None,None,None),
(11,49,"GtkLabel","reset_bluetooth_address",47,None,None,None,1,None),
(12,11,"GtkBox","resetAudioInput",None,None,None,None,None,None),
(12,12,"GtkLabel",None,11,None,None,None,None,None),
(12,13,"AdwNavigationView",None,11,None,None,None,1,None),
@ -604,16 +606,30 @@
(11,44,"GtkButton","has-frame","False",None,None,None,None,None,None,None,None,None),
(11,44,"GtkButton","icon-name","user-trash-symbolic",None,None,None,None,None,None,None,None,None),
(11,44,"GtkWidget","halign","end",None,None,None,None,None,None,None,None,None),
(11,45,"GtkLabel","ellipsize","end",None,None,None,None,None,None,None,None,None),
(11,45,"GtkLabel","label","LoremIpsum Wireless Mouse",None,None,None,None,None,None,None,None,None),
(11,45,"GtkLabel","single-line-mode","True",None,None,None,None,None,None,None,None,None),
(11,45,"GtkLabel","xalign","0.0",None,None,None,None,None,None,None,None,None),
(11,45,"GtkWidget","hexpand","True",None,None,None,None,None,None,None,None,None),
(11,45,"GtkWidget","hexpand-set","True",None,None,None,None,None,None,None,None,None),
(11,45,"GtkWidget","margin-end","10",None,None,None,None,None,None,None,None,None),
(11,45,"GtkWidget","vexpand","True",None,None,None,None,None,None,None,None,None),
(11,45,"GtkWidget","vexpand-set","True",None,None,None,None,None,None,None,None,None),
(11,45,"GtkWidget","width-request","200",None,None,None,None,None,None,None,None,None),
(11,47,"GtkOrientable","orientation","vertical",None,None,None,None,None,None,None,None,None),
(11,47,"GtkWidget","hexpand","True",None,None,None,None,None,None,None,None,None),
(11,47,"GtkWidget","hexpand-set","True",None,None,None,None,None,None,None,None,None),
(11,48,"GtkLabel","ellipsize","end",None,None,None,None,None,None,None,None,None),
(11,48,"GtkLabel","label","LoremIpsum Wireless Mouse",None,None,None,None,None,None,None,None,None),
(11,48,"GtkLabel","single-line-mode","True",None,None,None,None,None,None,None,None,None),
(11,48,"GtkLabel","xalign","0.0",None,None,None,None,None,None,None,None,None),
(11,48,"GtkWidget","hexpand","True",None,None,None,None,None,None,None,None,None),
(11,48,"GtkWidget","hexpand-set","True",None,None,None,None,None,None,None,None,None),
(11,48,"GtkWidget","margin-end","10",None,None,None,None,None,None,None,None,None),
(11,48,"GtkWidget","vexpand","True",None,None,None,None,None,None,None,None,None),
(11,48,"GtkWidget","vexpand-set","True",None,None,None,None,None,None,None,None,None),
(11,48,"GtkWidget","width-request","200",None,None,None,None,None,None,None,None,None),
(11,49,"GtkLabel","ellipsize","end",None,None,None,None,None,None,None,None,None),
(11,49,"GtkLabel","label","LoremIpsum Wireless Mouse",None,None,None,None,None,None,None,None,None),
(11,49,"GtkLabel","single-line-mode","True",None,None,None,None,None,None,None,None,None),
(11,49,"GtkLabel","xalign","0.0",None,None,None,None,None,None,None,None,None),
(11,49,"GtkWidget","hexpand","True",None,None,None,None,None,None,None,None,None),
(11,49,"GtkWidget","hexpand-set","True",None,None,None,None,None,None,None,None,None),
(11,49,"GtkWidget","margin-end","10",None,None,None,None,None,None,None,None,None),
(11,49,"GtkWidget","sensitive","False",None,None,None,None,None,None,None,None,None),
(11,49,"GtkWidget","vexpand","True",None,None,None,None,None,None,None,None,None),
(11,49,"GtkWidget","vexpand-set","True",None,None,None,None,None,None,None,None,None),
(11,49,"GtkWidget","width-request","200",None,None,None,None,None,None,None,None,None),
(12,11,"GtkOrientable","orientation","vertical",None,None,None,None,None,None,None,None,None),
(12,11,"GtkWidget","valign","start",None,None,None,None,None,None,None,None,None),
(12,12,"GtkLabel","label","Input",None,None,None,None,None,None,None,None,None),