view libervia/desktop_kivy/plugins/plugin_wid_calls.kv @ 514:d78728d7fd6a default tip

plugin wid calls, core: implements WebRTC DataChannel file transfer: - Add a new "file" icon in call UI to send a file via WebRTC. - Handle new preflight mechanism, and WebRTC file transfer. - Native file chooser handling has been moved to new `core.file_chooser` module, and now supports "save" and "dir" modes (based on `plyer`). rel 442
author Goffi <goffi@goffi.org>
date Sat, 06 Apr 2024 13:37:27 +0200
parents 97ab236e8f20
children
line wrap: on
line source

# desktop/mobile frontend for Libervia XMPP client
# Copyright (C) 2016-2023 Jérôme Poisson (goffi@goffi.org)

# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.

# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU Affero General Public License for more details.

# You should have received a copy of the GNU Affero General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.


<WindowSelectButton>:
    size_hint_y: None
    height: '44dp'
    color: 0.8, 0.8, 0.8, 1


<DesktopScreenDialog>:
    title: "Select a Screen or Window"
    size_hint: 0.8, 0.8
    windows_buttons: windows_buttons
    BoxLayout:
        orientation: "vertical"
        ScrollView:
            BoxLayout:
                id: windows_buttons
                orientation: "vertical"
                size_hint_y: None
                height: self.minimum_height
                WindowSelectButton:
                    text: "Full Screen"
                    on_press: root.on_window_selected(None, None)

        Button:
            size_hint_y: None
            height: '44dp'
            text: 'Close'
            on_release: root.dismiss()


<CallControlButton>:
    size_hint: None, None
    size: "50dp", "50dp"
    color: 1, 1, 1, 1
    background_color: (0.28, 0.78, 0.56, 1) if self.active else (1.0, 0.88, 0.54, 1)
    canvas.before:
        Color:
            rgba: root.background_color
        Rectangle:
            size: (self.width - 2*dp(self.margin_x), self.height - 2*dp(self.margin_y))
            pos: (self.x + dp(self.margin_x), self.y + dp(self.margin_y))
    canvas.after:
        Color:
            rgba: (1, 0, 0, 1) if not self.active else (0, 0, 0, 0)
        Line:
            points: [self.x + dp(10), self.y + dp(10), self.right - dp(10), self.top - dp(10)]
            width: 2
            cap: "round"

<Calls>:
    jid_selector: jid_selector
    call_layout: call_layout
    remote_video: remote_video
    local_video: local_video
    screen_manager: screen_manager
    call_screen: call_screen
    ScreenManager:
        id: screen_manager
        SearchScreen:
            name: "search"
            JidSelector:
                id: jid_selector
                on_select: root.on_jid_select(args[1])
                to_show: ["roster"]
        InCallScreen:
            id: call_screen
            name: "call"
            remote_video: remote_video
            local_video: local_video
            orientation: "vertical"
            FloatLayout:
                id: call_layout
                pos_hint: {"x": 0, "y": 0}
                size_hint: 1, 1

                VideoStreamWidget:
                    id: remote_video
                    size: call_layout.size
                    pos: call_layout.pos
                    fit_mode: "contain"
                    canvas.before:
                        Color:
                            rgba: (0, 0, 0, 1)
                        Rectangle:
                            pos: self.pos
                            size: self.size

                VideoStreamWidget:
                    id: local_video
                    size_hint: 0.25, 0.25
                    pos_hint: {"right": 1, "bottom": 0}
                    fit_mode: "contain"
                    canvas.before:
                        Color:
                            rgba: (0, 0, 0, 1)
                        Rectangle:
                            pos: self.pos
                            size: self.size

                CallControlButton:
                    id: full_screen_btn
                    size: "60dp", "60dp"
                    pos_hint: {"right": 1, "top": 1}
                    margin_x: dp(10)
                    margin_y: dp(10)
                    symbol: "resize-small" if root.fullscreen else "resize-full"
                    color: 0.29, 0.29, 0.29, 1
                    background_color: 0.96, 0.96, 0.96, 1
                    on_press: root.fullscreen = not root.fullscreen


                BoxLayout:
                    id: call_controls
                    orientation: "horizontal"
                    size_hint: 0.5, None
                    height: "50dp"
                    pos_hint: {"x": 0.25, "y": 0.05}
                    spacing: "30dp"
                    Widget:

                    CallControlButton:
                        symbol: "videocam"
                        active: not root.video_muted
                        on_press: root.video_muted = not root.video_muted

                    CallControlButton:
                        symbol: "volume-up"
                        active: not root.audio_muted
                        on_press: root.audio_muted = not root.audio_muted

                    CallControlButton:
                        symbol: "desktop"
                        active: root.desktop_sharing
                        background_color: (0.28, 0.78, 0.56, 1) if not self.active else (0.95, 0.27, 0.41, 1)
                        on_press: root.on_desktop_btn_press()
                        canvas.after:
                            Color:
                                rgba: (0, 0, 0, 0) if self.active else (0.4, 0.4, 0.4, 1)
                            Line:
                                points: [self.x + dp(10), self.y + dp(10), self.right - dp(10), self.top - dp(10)]
                                width: 2
                                cap: "round"
                    CallControlButton:
                        symbol: "doc"
                        color: 0, 0, 0, 1
                        background_color: (1, 1, 1, 1)
                        on_press: root.on_file_btn_press()

                    CallControlButton:
                        symbol: "phone"
                        background_color: 0.95, 0.27, 0.41, 1
                        on_press: root.hang_up()
                        canvas.before:
                            PushMatrix
                            Rotate:
                                angle: 225
                                origin: self.center
                        canvas.after:
                            PopMatrix

                    Widget:


<CallButton>:
    size_hint: None, 1
    text: "Hang Up" if self.parent_widget.in_call else "Call"
    background_color: (1, 0, 0, 1) if self.parent_widget.in_call else (0, 1, 0, 1)