[vlc-devel] [RFC 73/82] qml: implement main menus

Pierre Lamot pierre at videolabs.io
Fri Feb 1 14:02:17 CET 2019


---
 modules/gui/qt/Makefile.am                    | 10 ++
 modules/gui/qt/qml/menus/AudioMenu.qml        | 55 +++++++++++
 .../qt/qml/menus/CheckableModelSubMenu.qml    | 34 +++++++
 modules/gui/qt/qml/menus/HelpMenu.qml         | 28 ++++++
 modules/gui/qt/qml/menus/MainMenu.qml         | 46 +++++++++
 modules/gui/qt/qml/menus/MediaMenu.qml        | 42 ++++++++
 modules/gui/qt/qml/menus/PlaybackMenu.qml     | 92 ++++++++++++++++++
 modules/gui/qt/qml/menus/SubtitleMenu.qml     | 35 +++++++
 modules/gui/qt/qml/menus/ToolsMenu.qml        | 33 +++++++
 modules/gui/qt/qml/menus/VideoMenu.qml        | 97 +++++++++++++++++++
 modules/gui/qt/qml/menus/ViewMenu.qml         | 68 +++++++++++++
 modules/gui/qt/vlc.qrc                        | 12 +++
 12 files changed, 552 insertions(+)
 create mode 100644 modules/gui/qt/qml/menus/AudioMenu.qml
 create mode 100644 modules/gui/qt/qml/menus/CheckableModelSubMenu.qml
 create mode 100644 modules/gui/qt/qml/menus/HelpMenu.qml
 create mode 100644 modules/gui/qt/qml/menus/MainMenu.qml
 create mode 100644 modules/gui/qt/qml/menus/MediaMenu.qml
 create mode 100644 modules/gui/qt/qml/menus/PlaybackMenu.qml
 create mode 100644 modules/gui/qt/qml/menus/SubtitleMenu.qml
 create mode 100644 modules/gui/qt/qml/menus/ToolsMenu.qml
 create mode 100644 modules/gui/qt/qml/menus/VideoMenu.qml
 create mode 100644 modules/gui/qt/qml/menus/ViewMenu.qml

diff --git a/modules/gui/qt/Makefile.am b/modules/gui/qt/Makefile.am
index bd4905ba91..57c6bfb156 100644
--- a/modules/gui/qt/Makefile.am
+++ b/modules/gui/qt/Makefile.am
@@ -545,6 +545,16 @@ libqt_plugin_la_RES = \
 	gui/qt/qml/utils/SelectableDelegateModel.qml \
 	gui/qt/qml/utils/ComboBoxExt.qml \
 	gui/qt/qml/utils/StackViewExt.qml \
+	gui/qt/qml/menus/CheckableModelSubMenu.qml \
+	gui/qt/qml/menus/AudioMenu.qml \
+	gui/qt/qml/menus/HelpMenu.qml \
+	gui/qt/qml/menus/MainMenu.qml \
+	gui/qt/qml/menus/MediaMenu.qml \
+	gui/qt/qml/menus/PlaybackMenu.qml \
+	gui/qt/qml/menus/SubtitleMenu.qml \
+	gui/qt/qml/menus/ToolsMenu.qml \
+	gui/qt/qml/menus/ViewMenu.qml \
+	gui/qt/qml/menus/VideoMenu.qml \
 	gui/qt/qml/playlist/PlaylistListView.qml \
 	gui/qt/qml/playlist/PLItem.qml \
 	gui/qt/qml/playlist/PLItemFooter.qml \
diff --git a/modules/gui/qt/qml/menus/AudioMenu.qml b/modules/gui/qt/qml/menus/AudioMenu.qml
new file mode 100644
index 0000000000..9e83bd54a0
--- /dev/null
+++ b/modules/gui/qt/qml/menus/AudioMenu.qml
@@ -0,0 +1,55 @@
+/*****************************************************************************
+ * Copyright (C) 2019 VLC authors and VideoLAN
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser 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 QtQuick.Controls 2.4
+
+import "qrc:///utils/" as Utils
+
+Utils.MenuExt {
+    CheckableModelSubMenu {
+        title: qsTr("Audio &Track");
+        enabled: player.isPlaying
+        model: player.audioTracks
+    }
+
+    /* FIXME port to QML
+    Menu {
+        title: qsTr("Audio &Device")
+    }
+    */
+
+    CheckableModelSubMenu {
+        title: qsTr("&Stereo Mode");
+        enabled: player.isPlaying
+        model: player.audioStereoMode
+    }
+
+    MenuSeparator { }
+
+    CheckableModelSubMenu {
+        title: qsTr("&Visualizations");
+        enabled: player.isPlaying
+        model: player.audioVisualization
+    }
+
+    MenuSeparator { }
+
+    Action { text: qsTr("Increase Volume"); enabled: player.isPlaying; onTriggered: player.setVolumeUp();   icon.source: "qrc:/toolbar/volume-high.svg";  }
+    Action { text: qsTr("Decrease Volume"); enabled: player.isPlaying; onTriggered: player.setVolumeDown(); icon.source: "qrc:/toolbar/volume-low.svg";   }
+    Action { text: qsTr("Mute");            enabled: player.isPlaying; onTriggered: player.toggleMuted();   icon.source: "qrc:/toolbar/volume-muted.svg"; }
+}
diff --git a/modules/gui/qt/qml/menus/CheckableModelSubMenu.qml b/modules/gui/qt/qml/menus/CheckableModelSubMenu.qml
new file mode 100644
index 0000000000..6590c07b20
--- /dev/null
+++ b/modules/gui/qt/qml/menus/CheckableModelSubMenu.qml
@@ -0,0 +1,34 @@
+/*****************************************************************************
+ * Copyright (C) 2019 VLC authors and VideoLAN
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser 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 QtQuick.Controls 2.4
+
+import "qrc:///utils/" as Utils
+
+Utils.MenuExt {
+    property alias model: values.model
+    Repeater {
+        id: values
+        Utils.MenuItemExt {
+            text: model.display
+            checkable: true
+            checked: model.checked
+            onTriggered: model.checked = !model.checked
+        }
+    }
+}
diff --git a/modules/gui/qt/qml/menus/HelpMenu.qml b/modules/gui/qt/qml/menus/HelpMenu.qml
new file mode 100644
index 0000000000..37b18f33dd
--- /dev/null
+++ b/modules/gui/qt/qml/menus/HelpMenu.qml
@@ -0,0 +1,28 @@
+/*****************************************************************************
+ * Copyright (C) 2019 VLC authors and VideoLAN
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser 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 QtQuick.Controls 2.4
+import org.videolan.vlc 0.1
+
+import "qrc:///utils/" as Utils
+
+Utils.MenuExt {
+    Action { text: qsTr("&Help");                 onTriggered: dialogProvider.helpDialog();   icon.source: "qrc:/menu/help.svg"; shortcut: "F1"              }
+    Action { text: qsTr("Check for &Updates..."); onTriggered: dialogProvider.updateDialog();                                                                }
+    Action { text: qsTr("&About");                onTriggered: history.push(["about"], History.Go);  icon.source: "qrc:/menu/info.svg"; shortcut: "Shift+F1" }
+}
diff --git a/modules/gui/qt/qml/menus/MainMenu.qml b/modules/gui/qt/qml/menus/MainMenu.qml
new file mode 100644
index 0000000000..cd639edab3
--- /dev/null
+++ b/modules/gui/qt/qml/menus/MainMenu.qml
@@ -0,0 +1,46 @@
+/*****************************************************************************
+ * Copyright (C) 2019 VLC authors and VideoLAN
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser 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 QtQuick.Controls 2.4
+
+import "qrc:///utils/" as Utils
+
+Utils.MenuExt {
+    closePolicy: Popup.CloseOnPressOutside | Popup.CloseOnEscape
+
+    MediaMenu { title: qsTr("&Media") }
+    PlaybackMenu { title: qsTr("&Playback") }
+    AudioMenu { title: qsTr("&Audio") }
+    VideoMenu { title: qsTr("&Video") }
+    SubtitleMenu { title: qsTr("&Subtitle") }
+    ToolsMenu { title: qsTr("&Tools") }
+    ViewMenu { title: qsTr("V&iew") }
+    HelpMenu { title: qsTr("&Help") }
+
+    function openBelow(obj) {
+        this.x = (obj.x + obj.width / 2) - this.width / 2
+        this.y = obj.y + obj.height
+        this.open()
+    }
+
+    function openAbove(obj) {
+        this.x = (obj.x + obj.width / 2) - this.width / 2
+        this.y = obj.y - this.height
+        this.open()
+    }
+}
diff --git a/modules/gui/qt/qml/menus/MediaMenu.qml b/modules/gui/qt/qml/menus/MediaMenu.qml
new file mode 100644
index 0000000000..aadff3923d
--- /dev/null
+++ b/modules/gui/qt/qml/menus/MediaMenu.qml
@@ -0,0 +1,42 @@
+/*****************************************************************************
+ * Copyright (C) 2019 VLC authors and VideoLAN
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser 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 QtQuick.Controls 2.4
+
+import "qrc:///utils/" as Utils
+
+Utils.MenuExt {
+    Action { text: qsTr("Open &File..." ) ;               onTriggered: dialogProvider.simpleOpenDialog();          icon.source:"qrc:/type/file-asym.svg"                        }
+    Action { text: qsTr( "&Open Multiple Files..." );     onTriggered: dialogProvider.openFileDialog();            icon.source:"qrc:/type/file-asym.svg";                       }
+    Action { text: qsTr( "Open D&irectory" );             onTriggered: dialogProvider.PLOpenDir();                 icon.source:"qrc:/type/folder-grey.svg";  shortcut: "Ctrl+F" }
+
+    Action { text: qsTr("Open &Disc...");                 onTriggered: dialogProvider.openDiscDialog();            icon.source:"qrc:/type/disc.svg";         shortcut: "Ctrl+D" }
+    Action { text: qsTr("Open &Network Stream...");       onTriggered: dialogProvider.openNetDialog();             icon.source:"qrc:/type/network.svg";      shortcut: "Ctrl+N" }
+    Action { text: qsTr("Open &Capture Device...");       onTriggered: dialogProvider.openCaptureDialog();         icon.source:"qrc:/type/capture-card.svg"; shortcut: "Ctrl+C" }
+    Action { text: qsTr("Open &Location from clipboard"); onTriggered: dialogProvider.openUrlDialog();                                                       shortcut: "Ctrl+V" }
+
+    /* FIXME recent */
+
+    Action { text: qsTr("Save Playlist to &File...");     onTriggered: dialogProvider.savePlayingToPlaylist();     icon.source: "";                      shortcut: "Ctrl+Y" }
+    Action { text: qsTr("Conve&rt / Save..." );           onTriggered: dialogProvider.openAndTranscodingDialogs(); icon.source: "";                      shortcut: "Ctrl+R" }
+    Action { text: qsTr("&Stream..." );                   onTriggered: dialogProvider.openAndStreamingDialogs();   icon.source: "qrc:/menu/stream.svg";  shortcut: "Ctrl+S" }
+
+    //Action { text: qsTr( "&close to systray" );           onTriggered: dialogprovider.closeToSystray();                                                                     }
+    Action { text: qsTr( "Quit at the end of playlist" ); onTriggered: console.warn("FIXME");                                                            shortcut: "Ctrl+Q"; checkable: true; checked: true; }
+    Action { text: qsTr( "&Quit" );                       onTriggered: dialogProvider.quit();                      icon.source:"qrc:/menu/exit.svg";     shortcut: "Ctrl+Q" }
+}
diff --git a/modules/gui/qt/qml/menus/PlaybackMenu.qml b/modules/gui/qt/qml/menus/PlaybackMenu.qml
new file mode 100644
index 0000000000..3d31a39945
--- /dev/null
+++ b/modules/gui/qt/qml/menus/PlaybackMenu.qml
@@ -0,0 +1,92 @@
+/*****************************************************************************
+ * Copyright (C) 2019 VLC authors and VideoLAN
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser 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 QtQuick.Controls 2.4
+
+import org.videolan.vlc 0.1
+
+import "qrc:///utils/" as Utils
+
+Utils.MenuExt {
+    PlaylistControlerModel {
+        id: playlistCtrl
+    }
+
+    property bool isPlaying: player.playingState != PlayerControler.PLAYING_STATE_STOPPED
+
+
+    CheckableModelSubMenu {
+        title: qsTr("Title")
+        enabled: player.isPlaying
+        model: player.titles
+    }
+
+
+    CheckableModelSubMenu {
+        title: qsTr("Chapters");
+        enabled: player.isPlaying
+        model: player.chapters
+    }
+
+    CheckableModelSubMenu {
+        title: qsTr("Program");
+        enabled: player.isPlaying
+        model: player.programs
+    }
+
+    /*
+    //FIXME unimplemented
+    Menu {
+        title: qsTr("Custom Bookmarks");
+        enabled: isPlaying
+    }
+    */
+
+    MenuSeparator { }
+
+    Utils.MenuExt {
+        title: qsTr("Renderer");
+    }
+
+    MenuSeparator { }
+
+    Utils.MenuExt {
+        title: qsTr("Speed");
+        enabled: isPlaying
+        Action { text: qsTr("&Faster");         onTriggered: player.faster();       icon.source: "qrc:/toolbar/faster2.svg";    }
+        Action { text: qsTr("&Faster (fine)");  onTriggered: player.littlefaster(); icon.source: "qrc:/toolbar/faster2.svg";    }
+        Action { text: qsTr("N&ormal Speed");   onTriggered: player.normalRate();                                               }
+        Action { text: qsTr("Slo&wer");         onTriggered: player.slower();       icon.source: "qrc:/toolbar/slower2.svg";    }
+        Action { text: qsTr("Slo&wer (fine)");  onTriggered: player.littleslower(); icon.source: "qrc:/toolbar/slower2.svg";    }
+    }
+
+    MenuSeparator { }
+
+    Action { text: qsTr("&Jump Forward");          enabled: player.isPlaying; onTriggered: player.jumpFwd();                icon.source: "qrc:/toolbar/skip_fw.svg";   }
+    Action { text: qsTr("Jump Bac&kward");         enabled: player.isPlaying; onTriggered: player.jumpBwd();                icon.source: "qrc:/toolbar/skip_back.svg"; }
+    Action { text: qsTr("Jump to Specific &Time"); enabled: player.isPlaying; onTriggered: dialogProvider.gotoTimeDialog();                                    }
+
+    MenuSeparator { }
+
+    Action { text: qsTr("Play");     enabled: player.isPlaying ; onTriggered: playlistCtrl.play();     icon.source: "qrc:/toolbar/play_b.svg";     }
+    Action { text: qsTr("Pause");    enabled: player.isPlaying ; onTriggered: playlistCtrl.pause();    icon.source: "qrc:/toolbar/pause_b.svg";    }
+    Action { text: qsTr("Stop");     enabled: player.isPlaying ; onTriggered: playlistCtrl.stop();     icon.source: "qrc:/toolbar/stop_b.svg";     }
+    Action { text: qsTr("Previous"); enabled: player.isPlaying ; onTriggered: playlistCtrl.previous(); icon.source: "qrc:/toolbar/previous_b.svg"; }
+    Action { text: qsTr("Next");     enabled: player.isPlaying ; onTriggered: playlistCtrl.next();     icon.source: "qrc:/toolbar/next_b.svg";     }
+    Action { text: qsTr("Record");   enabled: player.isPlaying ; onTriggered: player.record();         icon.source: "qrc:/toolbar/record.svg";     }
+}
diff --git a/modules/gui/qt/qml/menus/SubtitleMenu.qml b/modules/gui/qt/qml/menus/SubtitleMenu.qml
new file mode 100644
index 0000000000..cf56357b44
--- /dev/null
+++ b/modules/gui/qt/qml/menus/SubtitleMenu.qml
@@ -0,0 +1,35 @@
+/*****************************************************************************
+ * Copyright (C) 2019 VLC authors and VideoLAN
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser 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 QtQuick.Controls 2.4
+
+import "qrc:///utils/" as Utils
+
+Utils.MenuExt {
+    Action {
+        text: qsTr("Add Subtitle File...")
+        enabled: player.isPlaying
+        onTriggered: dialogProvider.loadSubtitlesFile();
+    }
+
+    CheckableModelSubMenu {
+        title: qsTr("Sub Track");
+        enabled: player.isPlaying
+        model: player.subtitleTracks
+    }
+}
diff --git a/modules/gui/qt/qml/menus/ToolsMenu.qml b/modules/gui/qt/qml/menus/ToolsMenu.qml
new file mode 100644
index 0000000000..ab5fecafdf
--- /dev/null
+++ b/modules/gui/qt/qml/menus/ToolsMenu.qml
@@ -0,0 +1,33 @@
+/*****************************************************************************
+ * Copyright (C) 2019 VLC authors and VideoLAN
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser 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 QtQuick.Controls 2.4
+
+import "qrc:///utils/" as Utils
+
+Utils.MenuExt {
+    Action { text: qsTr("&Effects and Filters");    onTriggered: dialogProvider.extendedDialog();   icon.source: "qrc:/menu/settings.svg";    shortcut: "Ctrl+E" }
+    Action { text: qsTr("&Track Synchronization");  onTriggered: dialogProvider.synchroDialog();    icon.source: "qrc:/menu/settings.svg";                       }
+    Action { text: qsTr("Media &Information") ;     onTriggered: dialogProvider.mediaInfoDialog();  icon.source: "qrc:/menu/info.svg";        shortcut: "Ctrl+I" }
+    Action { text: qsTr("&Codec Information") ;     onTriggered: dialogProvider.mediaCodecDialog(); icon.source: "qrc:/menu/info.svg";        shortcut: "Ctrl+J" }
+    Action { text: qsTr("Program Guide");           onTriggered: dialogProvider.epgDialog();                                                                     }
+    Action { text: qsTr("&Messages");               onTriggered: dialogProvider.messagesDialog();   icon.source: "qrc:/menu/messages.svg";    shortcut: "Ctrl+M" }
+    Action { text: qsTr("Plu&gins and extensions"); onTriggered: dialogProvider.pluginDialog();                                                                  }
+    MenuSeparator {}
+    Action { text: qsTr("&Preferences");            onTriggered: dialogProvider.prefsDialog();      icon.source: "qrc:/menu/preferences.svg"; shortcut: "Ctrl+P" }
+}
diff --git a/modules/gui/qt/qml/menus/VideoMenu.qml b/modules/gui/qt/qml/menus/VideoMenu.qml
new file mode 100644
index 0000000000..71e2ad2c43
--- /dev/null
+++ b/modules/gui/qt/qml/menus/VideoMenu.qml
@@ -0,0 +1,97 @@
+/*****************************************************************************
+ * Copyright (C) 2019 VLC authors and VideoLAN
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser 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 QtQuick.Controls 2.4
+
+import "qrc:///utils/" as Utils
+
+Utils.MenuExt {
+    CheckableModelSubMenu {
+        title: qsTr("Video Track");
+        enabled: player.isPlaying
+        model: player.videoTracks
+    }
+
+    MenuSeparator { }
+
+    Action {
+        text: qsTr("Fullscreen")
+        enabled: player.isPlaying
+        checkable: true
+        checked: player.fullscreen
+        onTriggered: player.fullscreen = !player.fullscreen
+    }
+
+    Action {
+        text: qsTr("Always Fit Window")
+        enabled: player.isPlaying
+        checkable: true
+        checked: player.autoscale
+        onTriggered: player.autoscale = !player.autoscale
+    }
+
+    Action {
+        text: qsTr("Set as Wallpaper")
+        enabled: player.isPlaying
+        checkable: true
+        checked: player.wallpaperMode
+        onTriggered: player.wallpaperMode = !player.wallpaperMode;
+    }
+
+    MenuSeparator { }
+
+    CheckableModelSubMenu {
+        title: qsTr("Zoom")
+        enabled: player.isPlaying
+        model: player.zoom
+    }
+
+    CheckableModelSubMenu {
+        title: qsTr("Aspect Ratio")
+        enabled: player.isPlaying
+        model: player.aspectRatio
+    }
+
+    CheckableModelSubMenu {
+        title: qsTr("Crop")
+        enabled: player.isPlaying
+        model: player.crop
+    }
+
+    MenuSeparator { }
+
+    CheckableModelSubMenu {
+        title: qsTr("Deinterlace")
+        enabled: player.isPlaying
+        model: player.deinterlace
+    }
+
+    CheckableModelSubMenu {
+        title: qsTr("Deinterlace Mode");
+        enabled: player.isPlaying
+        model: player.deinterlaceMode
+    }
+
+    MenuSeparator { }
+
+    Action {
+        text: qsTr("Take snapshot");
+        enabled: player.isPlaying
+        onTriggered: player.snapshot();
+    }
+}
diff --git a/modules/gui/qt/qml/menus/ViewMenu.qml b/modules/gui/qt/qml/menus/ViewMenu.qml
new file mode 100644
index 0000000000..b34fd4095a
--- /dev/null
+++ b/modules/gui/qt/qml/menus/ViewMenu.qml
@@ -0,0 +1,68 @@
+/*****************************************************************************
+ * Copyright (C) 2019 VLC authors and VideoLAN
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser 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 QtQuick.Controls 2.4
+
+import "qrc:///style/"
+import "qrc:///utils/" as Utils
+
+Utils.MenuExt {
+    Action {
+        text: qsTr("&Always on Top")
+        checkable: true
+        checked: rootWindow.interfaceAlwaysOnTop
+        onTriggered: rootWindow.interfaceAlwaysOnTop = !rootWindow.interfaceAlwaysOnTop
+    }
+
+    Action {
+        text: qsTr("&Fullscreen Interface")
+        checkable: true
+        checked: rootWindow.interfaceFullScreen
+        onTriggered: rootWindow.interfaceFullScreen = !rootWindow.interfaceFullScreen
+    }
+
+    Action {
+        text: qsTr("&View Items as Grid")
+        checkable: true
+        checked: medialib.gridView
+        onTriggered: medialib.gridView = !medialib.gridView
+    }
+
+    Utils.MenuExt {
+        title: qsTr("Color Scheme")
+        Repeater {
+            model: VLCStyle.colors.colorSchemes
+            Utils.MenuItemExt {
+                text: modelData
+                checkable: true
+                checked: modelData === VLCStyle.colors.state
+                onTriggered: VLCStyle.colors.state = modelData
+            }
+        }
+    }
+
+    /* FIXME unimplemented
+    Menu {
+        title: qsTr("Add Interface")
+    }
+    */
+
+    /* FIXME unimplemented
+    extensions
+    */
+}
diff --git a/modules/gui/qt/vlc.qrc b/modules/gui/qt/vlc.qrc
index de7bac2321..80dff0122f 100644
--- a/modules/gui/qt/vlc.qrc
+++ b/modules/gui/qt/vlc.qrc
@@ -191,6 +191,18 @@
         <file alias="PlaylistMenu.qml">qml/playlist/PlaylistMenu.qml</file>
         <file alias="PLItemFooter.qml">qml/playlist/PLItemFooter.qml</file>
     </qresource>
+    <qresource prefix="/menus">
+        <file alias="AudioMenu.qml">qml/menus/AudioMenu.qml</file>
+        <file alias="HelpMenu.qml">qml/menus/HelpMenu.qml</file>
+        <file alias="MainMenu.qml">qml/menus/MainMenu.qml</file>
+        <file alias="MediaMenu.qml">qml/menus/MediaMenu.qml</file>
+        <file alias="PlaybackMenu.qml">qml/menus/PlaybackMenu.qml</file>
+        <file alias="SubtitleMenu.qml">qml/menus/SubtitleMenu.qml</file>
+        <file alias="ToolsMenu.qml">qml/menus/ToolsMenu.qml</file>
+        <file alias="VideoMenu.qml">qml/menus/VideoMenu.qml</file>
+        <file alias="CheckableModelSubMenu.qml">qml/menus/CheckableModelSubMenu.qml</file>
+        <file alias="ViewMenu.qml">qml/menus/ViewMenu.qml</file>
+    </qresource>
     <qresource prefix="/about">
         <file alias="About.qml">qml/about/About.qml</file>
     </qresource>
-- 
2.19.1



More information about the vlc-devel mailing list