From 7e7dcedaf31ee35499875491c9f569c575d28435 Mon Sep 17 00:00:00 2001 From: fiaxh Date: Mon, 14 Feb 2022 14:55:59 +0100 Subject: Port from GTK3 to GTK4 --- .../src/ui/call_window/video_settings_popover.vala | 30 +++++++++++----------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'main/src/ui/call_window/video_settings_popover.vala') diff --git a/main/src/ui/call_window/video_settings_popover.vala b/main/src/ui/call_window/video_settings_popover.vala index 7dd5ec9f..c931c466 100644 --- a/main/src/ui/call_window/video_settings_popover.vala +++ b/main/src/ui/call_window/video_settings_popover.vala @@ -11,10 +11,10 @@ public class Dino.Ui.VideoSettingsPopover : Gtk.Popover { private HashMap row_device = new HashMap(); public VideoSettingsPopover() { - Box box = new Box(Orientation.VERTICAL, 15) { margin=18, visible=true }; - box.add(create_camera_box()); + Box box = new Box(Orientation.VERTICAL, 15) { visible=true }; + box.append(create_camera_box()); - this.add(box); + this.set_child(box); } private Widget create_camera_box() { @@ -22,18 +22,18 @@ public class Dino.Ui.VideoSettingsPopover : Gtk.Popover { Gee.List devices = call_plugin.get_devices("video", false); Box camera_box = new Box(Orientation.VERTICAL, 10) { visible=true }; - camera_box.add(new Label("" + _("Cameras") + "") { use_markup=true, xalign=0, visible=true, can_focus=true /* grab initial focus*/ }); + camera_box.append(new Label("" + _("Cameras") + "") { use_markup=true, xalign=0, visible=true, can_focus=true /* grab initial focus*/ }); if (devices.size == 0) { - camera_box.add(new Label(_("No camera found.")) { visible=true }); + camera_box.append(new Label(_("No camera found.")) { visible=true }); } else { ListBox list_box = new ListBox() { activate_on_single_click=true, selection_mode=SelectionMode.SINGLE, visible=true }; list_box.set_header_func(listbox_header_func); Frame frame = new Frame(null) { visible=true }; - frame.add(list_box); + frame.set_child(list_box); foreach (Plugins.MediaDevice device in devices) { Label display_name_label = new Label(device.display_name) { xalign=0, visible=true }; - Image image = new Image.from_icon_name("object-select-symbolic", IconSize.BUTTON) { visible=true }; + Image image = new Image.from_icon_name("object-select-symbolic") { visible=true }; if (current_device == null || current_device.id != device.id) { image.opacity = 0; } @@ -44,21 +44,21 @@ public class Dino.Ui.VideoSettingsPopover : Gtk.Popover { image.opacity = 1; } }); - Box device_box = new Box(Orientation.HORIZONTAL, 0) { spacing=7, margin=7, visible=true }; - device_box.add(image); + Box device_box = new Box(Orientation.HORIZONTAL, 0) { spacing=7, visible=true }; + device_box.append(image); Box label_box = new Box(Orientation.VERTICAL, 0) { visible = true }; - label_box.add(display_name_label); + label_box.append(display_name_label); if (device.detail_name != null) { 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)); - label_box.add(detail_name_label); + label_box.append(detail_name_label); } - device_box.add(label_box); + device_box.append(label_box); ListBoxRow list_box_row = new ListBoxRow() { visible=true }; - list_box_row.add(device_box); - list_box.add(list_box_row); + list_box_row.set_child(device_box); + list_box.append(list_box_row); row_device[list_box_row] = device; } @@ -67,7 +67,7 @@ public class Dino.Ui.VideoSettingsPopover : Gtk.Popover { camera_selected(row_device[row]); list_box.unselect_row(row); }); - camera_box.add(frame); + camera_box.append(frame); } return camera_box; -- cgit v1.2.3-54-g00ecf