From 43ea088f646a8b3a5c41699f48cf5f0b4e7d4107 Mon Sep 17 00:00:00 2001 From: Marvin W Date: Tue, 8 Feb 2022 21:57:48 +0100 Subject: Calls: Device picker --- .../src/ui/call_window/audio_settings_popover.vala | 30 ++++++++++++++++------ 1 file changed, 22 insertions(+), 8 deletions(-) (limited to 'main/src/ui/call_window/audio_settings_popover.vala') diff --git a/main/src/ui/call_window/audio_settings_popover.vala b/main/src/ui/call_window/audio_settings_popover.vala index feb84f32..f13f346b 100644 --- a/main/src/ui/call_window/audio_settings_popover.vala +++ b/main/src/ui/call_window/audio_settings_popover.vala @@ -26,17 +26,21 @@ public class Dino.Ui.AudioSettingsPopover : Gtk.Popover { Gee.List devices = call_plugin.get_devices("audio", false); Box micro_box = new Box(Orientation.VERTICAL, 10) { visible=true }; - micro_box.add(new Label("" + "Microphones" + "") { use_markup=true, xalign=0, visible=true, can_focus=true /* grab initial focus*/ }); + micro_box.add(new Label("" + _("Microphones") + "") { use_markup=true, xalign=0, visible=true, can_focus=true /* grab initial focus*/ }); if (devices.size == 0) { - micro_box.add(new Label("No microphones found.")); + micro_box.add(new Label(_("No microphones found."))); } else { ListBox micro_list_box = new ListBox() { activate_on_single_click=true, selection_mode=SelectionMode.SINGLE, visible=true }; micro_list_box.set_header_func(listbox_header_func); Frame micro_frame = new Frame(null) { visible=true }; micro_frame.add(micro_list_box); foreach (Plugins.MediaDevice device in devices) { - Label label = new Label(device.display_name) { xalign=0, visible=true }; + Label display_name_label = new Label(device.display_name) { xalign=0, visible=true }; + Label detail_name_label = new Label(device.detail_name) { xalign=0, visible=true }; + detail_name_label.get_style_context().add_class("dim-label"); + detail_name_label.attributes = new Pango.AttrList(); + detail_name_label.attributes.insert(Pango.attr_scale_new(0.8)); Image image = new Image.from_icon_name("object-select-symbolic", IconSize.BUTTON) { visible=true }; if (current_microphone_device == null || current_microphone_device.id != device.id) { image.opacity = 0; @@ -50,7 +54,10 @@ public class Dino.Ui.AudioSettingsPopover : Gtk.Popover { }); Box device_box = new Box(Orientation.HORIZONTAL, 0) { spacing=7, margin=7, visible=true }; device_box.add(image); - device_box.add(label); + Box label_box = new Box(Orientation.VERTICAL, 0) { visible = true }; + label_box.add(display_name_label); + label_box.add(detail_name_label); + device_box.add(label_box); ListBoxRow list_box_row = new ListBoxRow() { visible=true }; list_box_row.add(device_box); micro_list_box.add(list_box_row); @@ -73,10 +80,10 @@ public class Dino.Ui.AudioSettingsPopover : Gtk.Popover { Gee.List devices = call_plugin.get_devices("audio", true); Box speaker_box = new Box(Orientation.VERTICAL, 10) { visible=true }; - speaker_box.add(new Label("" + "Speakers" +"") { use_markup=true, xalign=0, visible=true }); + speaker_box.add(new Label("" + _("Speakers") +"") { use_markup=true, xalign=0, visible=true }); if (devices.size == 0) { - speaker_box.add(new Label("No speakers found.")); + speaker_box.add(new Label(_("No speakers found."))); } else { ListBox speaker_list_box = new ListBox() { activate_on_single_click=true, selection_mode=SelectionMode.SINGLE, visible=true }; speaker_list_box.set_header_func(listbox_header_func); @@ -86,7 +93,11 @@ public class Dino.Ui.AudioSettingsPopover : Gtk.Popover { Frame speaker_frame = new Frame(null) { visible=true }; speaker_frame.add(speaker_list_box); foreach (Plugins.MediaDevice device in devices) { - Label label = new Label(device.display_name) { xalign=0, visible=true }; + Label display_name_label = new Label(device.display_name) { xalign=0, visible=true }; + Label detail_name_label = new Label(device.detail_name) { xalign=0, visible=true }; + detail_name_label.get_style_context().add_class("dim-label"); + detail_name_label.attributes = new Pango.AttrList(); + detail_name_label.attributes.insert(Pango.attr_scale_new(0.8)); Image image = new Image.from_icon_name("object-select-symbolic", IconSize.BUTTON) { visible=true }; if (current_speaker_device == null || current_speaker_device.id != device.id) { image.opacity = 0; @@ -100,7 +111,10 @@ public class Dino.Ui.AudioSettingsPopover : Gtk.Popover { }); Box device_box = new Box(Orientation.HORIZONTAL, 0) { spacing=7, margin=7, visible=true }; device_box.add(image); - device_box.add(label); + Box label_box = new Box(Orientation.VERTICAL, 0) { visible = true }; + label_box.add(display_name_label); + label_box.add(detail_name_label); + device_box.add(label_box); ListBoxRow list_box_row = new ListBoxRow() { visible=true }; list_box_row.add(device_box); speaker_list_box.add(list_box_row); -- cgit v1.2.3-54-g00ecf