From 06f0bc00f14046dfb72794e0fcf516d240250e21 Mon Sep 17 00:00:00 2001 From: fiaxh Date: Sat, 12 Feb 2022 17:32:13 +0100 Subject: [PATCH] Calls: Show invite button quicker --- main/src/ui/call_window/call_window_controller.vala | 2 +- main/src/ui/call_window/participant_widget.vala | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/main/src/ui/call_window/call_window_controller.vala b/main/src/ui/call_window/call_window_controller.vala index 6ea69287..65e5ebd6 100644 --- a/main/src/ui/call_window/call_window_controller.vala +++ b/main/src/ui/call_window/call_window_controller.vala @@ -156,7 +156,7 @@ public class Dino.Ui.CallWindowController : Object { update_audio_device_choices(); update_video_device_choices(); - } else if (participant_widgets.size >= 1) { + } else if (participant_widgets.size > 1) { participant_widgets.values.@foreach((widget) => widget.may_show_invite_button = true); } }); diff --git a/main/src/ui/call_window/participant_widget.vala b/main/src/ui/call_window/participant_widget.vala index 0d8d25b4..e21ab586 100644 --- a/main/src/ui/call_window/participant_widget.vala +++ b/main/src/ui/call_window/participant_widget.vala @@ -19,6 +19,7 @@ namespace Dino.Ui { public string? participant_name; bool is_highest_row = false; + bool is_start_row = false; public bool controls_active { get; set; } public bool may_show_invite_button { get; set; } @@ -44,12 +45,14 @@ namespace Dino.Ui { this.add_overlay(header_bar); this.notify["controls-active"].connect(reveal_or_hide_controls); + this.notify["may-show-invite-button"].connect(reveal_or_hide_controls); } public void on_row_changed(bool is_highest, bool is_lowest, bool is_start, bool is_end) { - is_highest_row = is_highest; + this.is_highest_row = is_highest; + this.is_start_row = is_start; + header_bar.show_close_button = is_highest_row; - invite_button.visible = may_show_invite_button && is_highest_row && is_start; if (is_highest_row) { header_bar.get_style_context().add_class("call-header-background"); Gtk.Settings? gtk_settings = Gtk.Settings.get_default(); @@ -105,6 +108,7 @@ namespace Dino.Ui { private void reveal_or_hide_controls() { header_bar.opacity = controls_active ? 1.0 : 0.0; + invite_button.visible = may_show_invite_button && is_highest_row && is_start_row; } } } \ No newline at end of file