view libervia/desktop_kivy/plugins/plugin_wid_calls.kv @ 518:196483685a63 default tip

Use Font-Awesome instead of Fontello, following change in Libervia Media.
author Goffi <goffi@goffi.org>
date Sat, 26 Oct 2024 22:44:37 +0200
parents d78728d7fd6a
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: "minimize" if root.fullscreen else "maximize"
                    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: "video"
                        active: not root.video_muted
                        on_press: root.video_muted = not root.video_muted

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

                    CallControlButton:
                        symbol: "display"
                        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: "regular file"
                        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)