Skip to content

Commit

Permalink
qml: Create ProgramButton
Browse files Browse the repository at this point in the history
  • Loading branch information
3unjee authored and jbkempf committed Aug 22, 2022
1 parent 2a92cc0 commit e7e071d
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 0 deletions.
1 change: 1 addition & 0 deletions modules/gui/qt/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -901,6 +901,7 @@ libqt_plugin_la_QML = \
gui/qt/player/qml/controlbarcontrols/PlayerSwitchButton.qml \
gui/qt/player/qml/controlbarcontrols/PlaylistButton.qml \
gui/qt/player/qml/controlbarcontrols/PreviousButton.qml \
gui/qt/player/qml/controlbarcontrols/ProgramButton.qml \
gui/qt/player/qml/controlbarcontrols/QuitButton.qml \
gui/qt/player/qml/controlbarcontrols/RandomButton.qml \
gui/qt/player/qml/controlbarcontrols/RendererButton.qml \
Expand Down
51 changes: 51 additions & 0 deletions modules/gui/qt/player/qml/controlbarcontrols/ProgramButton.qml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
/*****************************************************************************
* Copyright (C) 2021 VLC authors and VideoLAN
*
* Authors: Benjamin Arnaud <[email protected]>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/

import QtQuick 2.11

import org.videolan.vlc 0.1

import "qrc:///widgets/" as Widgets
import "qrc:///style/"

Widgets.IconControlButton {
id: root

signal requestLockUnlockAutoHide(bool lock)

// FIXME: Placeholder icon.
iconText: VLCIcons.bookmark

text: I18n.qtr("Programs")

// NOTE: We want to pop the menu above the button.
onClicked: menu.popup(this.mapToGlobal(0, 0), true)

enabled: (paintOnly === false && Player.hasPrograms)

QmlProgramMenu {
id: menu

player: Player

onAboutToShow: root.requestLockUnlockAutoHide(true)
onAboutToHide: root.requestLockUnlockAutoHide(false)
}
}
1 change: 1 addition & 0 deletions modules/gui/qt/vlc.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,7 @@
<file alias="PlayerSwitchButton.qml">player/qml/controlbarcontrols/PlayerSwitchButton.qml</file>
<file alias="PlaylistButton.qml">player/qml/controlbarcontrols/PlaylistButton.qml</file>
<file alias="PreviousButton.qml">player/qml/controlbarcontrols/PreviousButton.qml</file>
<file alias="ProgramButton.qml">player/qml/controlbarcontrols/ProgramButton.qml</file>
<file alias="QuitButton.qml">player/qml/controlbarcontrols/QuitButton.qml</file>
<file alias="RandomButton.qml">player/qml/controlbarcontrols/RandomButton.qml</file>
<file alias="RendererButton.qml">player/qml/controlbarcontrols/RendererButton.qml</file>
Expand Down
1 change: 1 addition & 0 deletions po/POTFILES.in
Original file line number Diff line number Diff line change
Expand Up @@ -875,6 +875,7 @@ modules/gui/qt/player/qml/controlbarcontrols/PlaybackSpeedButton.qml
modules/gui/qt/player/qml/controlbarcontrols/PlayerSwitchButton.qml
modules/gui/qt/player/qml/controlbarcontrols/PlaylistButton.qml
modules/gui/qt/player/qml/controlbarcontrols/PreviousButton.qml
modules/gui/qt/player/qml/controlbarcontrols/ProgramButton.qml
modules/gui/qt/player/qml/controlbarcontrols/QuitButton.qml
modules/gui/qt/player/qml/controlbarcontrols/RandomButton.qml
modules/gui/qt/player/qml/controlbarcontrols/RecordButton.qml
Expand Down

0 comments on commit e7e071d

Please sign in to comment.