comparison libervia/desktop_kivy/plugins/plugin_wid_calls.kv @ 506:0480f883f0a6

plugin calls: update UI: - there is now a "search" UI to select a contact to call - "call" UI is displayed only when we actually are in a call - new control button to (un)mute audio and video - new control button to go to fullscreen/back to normal - add an extra "hang up" button directly in the call UI, so there is always one even in fullscreen mode - UI is similar to the one implemented in web frontend - notification + ringtone + desktop notification on incoming call - if an incoming call is cancelled from initiator, confirmation dialog is removed rel 425
author Goffi <goffi@goffi.org>
date Wed, 25 Oct 2023 15:28:44 +0200
parents f387992d8e37
children 97ab236e8f20
comparison
equal deleted inserted replaced
505:bbef1a413515 506:0480f883f0a6
12 # GNU Affero General Public License for more details. 12 # GNU Affero General Public License for more details.
13 13
14 # You should have received a copy of the GNU Affero General Public License 14 # You should have received a copy of the GNU Affero General Public License
15 # along with this program. If not, see <http://www.gnu.org/licenses/>. 15 # along with this program. If not, see <http://www.gnu.org/licenses/>.
16 16
17 <CallControlButton>:
18 size_hint: None, None
19 size: "50dp", "50dp"
20 color: 1, 1, 1, 1
21 background_color: (0.28, 0.78, 0.56, 1) if self.active else (1.0, 0.88, 0.54, 1)
22 canvas.before:
23 Color:
24 rgba: root.background_color
25 Rectangle:
26 size: (self.width - 2*dp(self.margin_x), self.height - 2*dp(self.margin_y))
27 pos: (self.x + dp(self.margin_x), self.y + dp(self.margin_y))
28 canvas.after:
29 Color:
30 rgba: (1, 0, 0, 1) if not self.active else (0, 0, 0, 0)
31 Line:
32 points: [self.x + dp(10), self.y + dp(10), self.right - dp(10), self.top - dp(10)]
33 width: 2
34 cap: "round"
17 35
18 <Calls>: 36 <Calls>:
37 jid_selector: jid_selector
38 call_layout: call_layout
19 remote_video: remote_video 39 remote_video: remote_video
20 local_video: local_video 40 local_video: local_video
21 orientation: 'vertical' 41 screen_manager: screen_manager
22 FloatLayout: 42 call_screen: call_screen
23 id: float_layout 43 ScreenManager:
24 pos_hint: {'x': 0, 'y': 0} 44 id: screen_manager
25 size_hint: 1, 1 45 SearchScreen:
46 name: "search"
47 JidSelector:
48 id: jid_selector
49 on_select: root.on_jid_select(args[1])
50 to_show: ["roster"]
51 InCallScreen:
52 id: call_screen
53 name: "call"
54 remote_video: remote_video
55 local_video: local_video
56 orientation: "vertical"
57 FloatLayout:
58 id: call_layout
59 pos_hint: {"x": 0, "y": 0}
60 size_hint: 1, 1
26 61
27 VideoStreamWidget: 62 VideoStreamWidget:
28 id: remote_video 63 id: remote_video
29 size: float_layout.size 64 size: call_layout.size
30 pos: float_layout.pos 65 pos: call_layout.pos
31 fit_mode: "contain" 66 fit_mode: "contain"
67 canvas.before:
68 Color:
69 rgba: (0, 0, 0, 1)
70 Rectangle:
71 pos: self.pos
72 size: self.size
32 73
33 VideoStreamWidget: 74 VideoStreamWidget:
34 id: local_video 75 id: local_video
35 size_hint: 0.25, 0.25 76 size_hint: 0.25, 0.25
36 pos_hint: {'right': 1, 'bottom': 0} 77 pos_hint: {"right": 1, "bottom": 0}
37 fit_mode: "contain" 78 fit_mode: "contain"
38 canvas.before: 79 canvas.before:
39 Color: 80 Color:
40 rgba: (0, 0, 0, 0) 81 rgba: (0, 0, 0, 1)
41 Rectangle: 82 Rectangle:
42 pos: self.pos 83 pos: self.pos
43 size: self.size 84 size: self.size
85
86 CallControlButton:
87 id: full_screen_btn
88 size: "60dp", "60dp"
89 pos_hint: {"right": 1, "top": 1}
90 margin_x: dp(10)
91 margin_y: dp(10)
92 symbol: "resize-small" if root.fullscreen else "resize-full"
93 color: 0.29, 0.29, 0.29, 1
94 background_color: 0.96, 0.96, 0.96, 1
95 on_press: root.fullscreen = not root.fullscreen
96
97
98 BoxLayout:
99 id: call_controls
100 orientation: "horizontal"
101 size_hint: 0.5, None # Adjusted to 50% of the width
102 height: "50dp"
103 pos_hint: {"x": 0.25, "y": 0.05} # Adjusted starting position
104 spacing: "30dp"
105 Widget:
106
107 CallControlButton:
108 symbol: "videocam"
109 active: not root.video_muted
110 on_press: root.video_muted = not root.video_muted
111
112 CallControlButton:
113 symbol: "volume-up"
114 active: not root.audio_muted
115 on_press: root.audio_muted = not root.audio_muted
116
117
118 CallControlButton:
119 symbol: "phone"
120 background_color: 0.95, 0.27, 0.41, 1
121 on_press: root.hang_up()
122 canvas.before:
123 PushMatrix
124 Rotate:
125 angle: 225
126 origin: self.center
127 canvas.after:
128 PopMatrix
129
130 Widget:
44 131
45 132
46 <CallButton>: 133 <CallButton>:
47 size_hint: None, 1 134 size_hint: None, 1
48 text: "Hang Up" if self.parent_widget.in_call else "Call" 135 text: "Hang Up" if self.parent_widget.in_call else "Call"