Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • videolan/vlc
  • chouquette/vlc
  • bakiewicz.marek122/vlc
  • devnexen/vlc
  • rohanrajpal/vlc
  • blurrrb/vlc
  • gsoc/gsoc2019/darkapex/vlc
  • b1ue/vlc
  • fkuehne/vlc
  • magsoft/vlc
  • chub/vlc
  • cramiro9/vlc
  • robUx4/vlc
  • rom1v/vlc
  • akshayaky/vlc
  • tmk907/vlc
  • akymaster/vlc
  • govind.sharma/vlc
  • psilokos/vlc
  • xjbeta/vlc
  • jahan/vlc
  • 1480c1/vlc
  • amanchande/vlc
  • aaqib/vlc
  • rist/vlc
  • apol/vlc
  • mindfreeze/vlc
  • alexandre-janniaux/vlc
  • sandsmark/vlc
  • jagannatharjun/vlc
  • gsoc/gsoc2020/matiaslgonzalez/vlc
  • gsoc/gsoc2020/jagannatharjun/vlc
  • mstorsjo/vlc
  • gsoc/gsoc2020/vedenta/vlc
  • gsoc/gsoc2020/arnav-ishaan/vlc
  • gsoc/gsoc2020/andreduong/vlc
  • fuzun/vlc
  • gsoc/gsoc2020/vatsin/vlc
  • gsoc/gsoc2020/sagid/vlc
  • yaron/vlc
  • Phoenix/vlc
  • Garf/vlc
  • ePiratWorkarounds/vlc
  • tguillem/vlc
  • jnqnfe/vlc
  • mdc/vlc
  • Vedaa/vlc
  • rasa/vlc
  • quink/vlc
  • yealo/vlc
  • aleksey_ak/vlc
  • ePirat/vlc
  • ilya.yanok/vlc
  • asenat/vlc
  • m/vlc
  • bunjee/vlc
  • BLumia/vlc
  • sagudev/vlc
  • hamedmonji30/vlc
  • nullgemm/vlc
  • DivyamAhuja/vlc
  • thesamesam/vlc
  • dag7/vlc
  • snehil101/vlc
  • haasn/vlc
  • jbk/vlc
  • ValZapod/vlc
  • mfkl/vlc
  • WangChuan/vlc
  • core1024/vlc
  • GhostVaibhav/vlc
  • dfuhrmann/vlc
  • davide.prade/vlc
  • tmatth/vlc
  • Courmisch/vlc
  • zouya/vlc
  • hpi/vlc
  • EwoutH/vlc
  • aleung27/vlc
  • hengwu0/vlc
  • saladin/vlc
  • ashuio/vlc
  • richselwood/vlc
  • verma16Ayush/vlc
  • chemicalflash/vlc
  • PoignardAzur/vlc
  • huangjieNT/vlc
  • Blake-Haydon/vlc
  • AnuthaDev/vlc
  • gsoc/gsoc2021/mpd/vlc
  • nicolas_lequec/vlc
  • sambassaly/vlc
  • thresh/vlc
  • bonniegong/vlc
  • myaashish/vlc
  • stavros.vagionitis/vlc
  • ileoo/vlc
  • louis-santucci/vlc
  • cchristiansen/vlc
  • sabyasachi07/vlc
  • AbduAmeen/vlc
  • ashishb0410/vlc
  • urbanhusky/vlc
  • davidepietrasanta/vlc
  • riksleutelstad/vlc
  • jeremyVignelles/vlc
  • komh/vlc
  • iamjithinjohn/vlc
  • JohannesKauffmann/vlc2
  • kunglao/vlc
  • natzberg/vlc
  • jill/vlc
  • cwendling/vlc
  • adufou/vlc
  • ErwanAirone/vlc
  • HasinduDilshan10/vlc
  • vagrantc/vlc
  • rafiv/macos-bigsur-icon
  • Aymeriic/vlc
  • saranshg20/vlc
  • metzlove24/vlc
  • linkfanel/vlc
  • Ds886/vlc
  • metehan-arslan/vlc
  • Skantes/vlc
  • kgsandundananjaya96/vlc
  • mitchcapper/vlc
  • advaitgupta/vlc
  • StefanBruens/vlc
  • ratajs/vlc
  • T.M.F.B.3761/vlc
  • m222059/vlc
  • casemerrick/vlc
  • joshuaword2alt/vlc
  • sjwaddy/vlc
  • dima/vlc
  • Ybalrid/vlc
  • umxprime/vlc
  • eschmidt/vlc
  • vannieuwenhuysenmichelle/vlc
  • badcf00d/vlc
  • wesinator/vlc
  • louis/vlc
  • xqq/vlc
  • EmperorYP7/vlc
  • NicoLiam/vlc
  • loveleen/vlc
  • rofferom/vlc
  • rbultje/vlc
  • TheUnamed/vlc
  • pratiksharma341/vlc
  • Saurab17/vlc
  • purist.coder/vlc
  • Shuicheng/vlc
  • mdrrubel292/vlc
  • silverbleu00/vlc
  • metif12/vlc
  • asher-m/vlc
  • jeffk/vlc
  • Brandonbr1/vlc
  • beautyyuyanli/vlc
  • rego21/vlc
  • muyangren907/vlc
  • collectionbylawrencejason/vlc
  • evelez/vlc
  • GSMgeeth/vlc
  • Oneric/vlc
  • TJ5/vlc
  • XuanTung95/vlc
  • darrenjenny21/vlc
  • Trenly/vlc
  • RockyTDR/vlc
  • mjakubowski/vlc
  • caprica/vlc
  • ForteFrankie/vlc
  • seannamiller19/vlc
  • junlon2006/vlc
  • kiwiren6666/vlc
  • iuseiphonexs/vlc
  • fenngtun/vlc
  • Rajdutt999/vlc
  • typx/vlc
  • leon.vitanos/vlc
  • robertogarci0938/vlc
  • gsoc/gsoc2022/luc65r/vlc-mpd
  • skeller/vlc
  • MCJack123/vlc
  • luc65r/vlc-mpd
  • popov895/vlc
  • claucambra/vlc
  • brad/vlc
  • matthewmurua88/vlc
  • Tomas8874/vlc
  • philenotfound/vlc
  • makita-do3/vlc
  • LZXCorp/vlc
  • mar0x/vlc
  • senojetkennedy0102/vlc
  • shaneb243/vlc
  • ahmadbader/vlc
  • rajduttcse26/vlc-audio-filters
  • Juniorzito8415/vlc
  • achernyakov/vlc
  • lucasjetgroup/vlc
  • pupdoggy666/vlc
  • gmde9363/vlc
  • alexnwayne/vlc
  • bahareebrahimi781/vlc
  • hamad633666/vlc
  • umghof3112/vlc
  • joe0199771874/vlc
  • Octocats66666666/vlc
  • jjm_223/vlc
  • btech10110.19/vlc
  • sunnykfc028/vlc-audio-filters
  • loic/vlc
  • nguyenminhducmx1/vlc
  • JanekKrueger/vlc
  • bstubbington2/vlc
  • rcombs/vlc
  • Ordissimo/vlc
  • king7532/vlc
  • noobsauce101/vlc
  • schong0525/vlc
  • myQwil/vlc
  • apisbg91/vlc
  • geeboy0101017/vlc
  • kim.faughey/vlc
  • nurupo/vlc
  • yyusea/vlc
  • 0711235879.khco/vlc
  • ialo/vlc
  • iloveyeye2/vlc
  • gdtdftdqtd/vlc
  • leandroconsiglio/vlc
  • AndyHTML2012/vlc
  • ncz/vlc
  • lucenticus/vlc
  • knr1931/vlc
  • kjoonlee/vlc
  • chandrakant100/vlc-qt
  • johge42/vlc
  • polter/vlc
  • hexchain/vlc
  • Tushwrld/vlc
  • mztea928/vlc
  • jbelloncastro/vlc
  • alvinhochun/vlc
  • ghostpiratecrow/vlc
  • ujjwaltwitx/vlc
  • alexsonarin06/vlc
  • adrianbon76/vlc
  • altsod/vlc
  • damien.lucas44/vlc
  • dmytrivtaisa/vlc
  • utk202/vlc
  • aaxhrj/vlc
  • thomas.hermes/vlc
  • structurenewworldorder/vlc
  • slomo/vlc
  • wantlamy/vlc
  • musc.o3cminc/vlc
  • thebarshablog/vlc
  • kerrick/vlc
  • kratos142518/vlc
  • leogps/vlc
  • vacantron/vlc
  • luna_koly/vlc
  • Ratio2/vlc
  • anuoshemohammad/vlc
  • apsun/vlc
  • aaa1115910/vlc
  • alimotmoyo/vlc
  • Ambossmann/vlc
  • Sam-LearnsToCode/vlc
  • Chilledheart/vlc
  • Labnann/vlc
  • ktcoooot1/vlc
  • mohit-marathe/vlc
  • johnddx/vlc
  • manstabuk/vlc
  • Omar-ahmed314/vlc
  • vineethkm/vlc
  • 9Enemi86/vlc
  • radoslav.m.panteleev/vlc
  • ashishami2002/vlc
  • Corbax/vlc
  • firnasahmed/vlc
  • pelayarmalam4/vlc
  • c0ff330k/vlc
  • shikhindahikar/vlc
  • l342723951/vlc
  • christianschwandner/vlc
  • douniwan5788/vlc
  • 7damian7/vlc
  • ferdnyc/vlc
  • f.ales1/vlc
  • pandagby/vlc
  • BaaBaa/vlc
  • jewe37/vlc
  • w00drow/vlc
  • russelltg/vlc
  • ironicallygod/vlc
  • soumyaDghosh/vlc
  • linzihao1999/vlc
  • deyayush6/vlc
  • mibi88/vlc
  • newabdallah10/vlc
  • jhorbincolombia/vlc
  • rimvihaqueshupto/vlc
  • andrewkhon98/vlc
  • fab78/vlc
  • lapaz17/vlc
  • amanna13/vlc
  • mdakram28/vlc
  • 07jw1980/vlc
  • sohamgupta/vlc
  • Eson-Jia1/vlc
  • Sumou/vlc
  • vikram-kangotra/vlc
  • chalice191/vlc
  • olivercalder/vlc
  • aaasg4001/vlc
  • zipdox/vlc
  • kwizart/vlc
  • Dragon-S/vlc
  • jdemeule/vlc
  • gabriel_lt/vlc
  • locutusofborg/vlc
  • sammirata/vlc-librist
  • another/vlc
  • Benjamin_Loison/vlc
  • ahmedmoselhi/vlc
  • petergaal/vlc
  • huynhsontung/vlc
  • dariusmihut/vlc
  • tvermaashutosh/vlc
  • buti/vlc
  • Niram7777/vlc
  • rohan-here/vlc
  • balaji-sivasakthi/vlc
  • rlindner81/vlc
  • Kakadus/vlc
  • djain/vlc
  • ABBurmeister/vlc
  • craighuggins/vlc
  • orbea/vlc
  • maxos/vlc
  • aakarshmj/vlc
  • kblaschke/vlc
  • ankitm/vlc
  • advait-0/vlc
  • mohak2003/vlc
  • yselkowitz/vlc
  • AZM999/vlc-azm
  • andrey.turkin/vlc
  • Disha-Baghel/vlc
  • nowrep/vlc
  • Apeng/vlc
  • Choucroute_melba/vlc
  • autra/vlc
  • eclipseo/vlc
  • fhuber/vlc
  • olafhering/vlc
  • sdasda7777/vlc
  • 1div0/vlc
  • skosnits/vlc-extended-playlist-support
  • dnicolson/vlc
  • Timshel/vlc
  • octopols/vlc
  • MangalK/vlc
  • nima64/vlc
  • misawai/vlc
  • Alexander-Wilms/vlc
  • Maxime2/vlc-fork-for-visualizer
  • ww/vlc
  • jeske/vlc
  • sgross-emlix/vlc
  • morenonatural/vlc
  • freakingLovesVLC/vlc
  • borisgolovnev/vlc
  • mpromonet/vlc
  • diogo.simao-marques/vlc
  • masstock/vlc
  • pratikpatel8982/vlc
  • hugok79/vlc
  • longervision/vlc
  • abhiudaysurya/vlc
  • rishabhgarg/vlc
  • tumic/vlc
  • cart/vlc
  • shubham442/vlc
  • Aditya692005/vlc
  • sammirata/vlc4
  • syrykh/vlc
  • Vvorcun/macos-new-icon
  • AyaanshC/vlc
  • nasso/vlc
  • Quark/vlc
  • sebastinas/vlc
  • rhstone/vlc
  • talregev/vlc
  • Managor/vlc
403 results
Show changes
Commits on Source (23)
Showing
with 324 additions and 222 deletions
......@@ -175,6 +175,7 @@ libqt_plugin_la_SOURCES = \
gui/qt/maininterface/interface_window_handler.hpp \
gui/qt/maininterface/mainctx.cpp \
gui/qt/maininterface/mainctx.hpp \
gui/qt/maininterface/mainctx_submodels.hpp \
gui/qt/maininterface/mainui.cpp \
gui/qt/maininterface/mainui.hpp \
gui/qt/maininterface/videosurface.cpp \
......@@ -446,6 +447,7 @@ nodist_libqt_plugin_la_SOURCES = \
gui/qt/maininterface/compositor_dummy.moc.cpp \
gui/qt/maininterface/interface_window_handler.moc.cpp \
gui/qt/maininterface/mainctx.moc.cpp \
gui/qt/maininterface/mainctx_submodels.moc.cpp \
gui/qt/maininterface/mainui.moc.cpp \
gui/qt/maininterface/videosurface.moc.cpp \
gui/qt/maininterface/video_window_handler.moc.cpp \
......
......@@ -28,7 +28,9 @@
#include "qt.hpp"
#include "maininterface/mainctx.hpp"
#include "mainctx.hpp"
#include "mainctx_submodels.hpp"
#include "compositor.hpp"
#include "util/renderer_manager.hpp"
#include "util/csdbuttonmodel.hpp"
......@@ -124,6 +126,9 @@ MainCtx::MainCtx(qt_intf_t *_p_intf)
settings = getSettings();
m_colorScheme = new ColorSchemeModel(this);
m_sort = new SortCtx(this);
m_search = new SearchCtx(this);
loadPrefs(false);
loadFromSettingsImpl(false);
......
......@@ -60,6 +60,9 @@ class StandardPLPanel;
struct vlc_window;
class VideoSurfaceProvider;
class ControlbarProfileModel;
class SearchCtx;
class SortCtx;
namespace vlc {
namespace playlist {
}
......@@ -142,7 +145,6 @@ public:
};
class MainCtx : public QObject
{
Q_OBJECT
......@@ -161,6 +163,7 @@ class MainCtx : public QObject
Q_PROPERTY(bool mediaLibraryAvailable READ hasMediaLibrary CONSTANT FINAL)
Q_PROPERTY(MediaLib* mediaLibrary READ getMediaLibrary CONSTANT FINAL)
Q_PROPERTY(bool gridView READ hasGridView WRITE setGridView NOTIFY gridViewChanged FINAL)
Q_PROPERTY(bool hasGridListMode MEMBER m_hasGridListMode NOTIFY hasGridListModeChanged FINAL)
Q_PROPERTY(Grouping grouping READ grouping WRITE setGrouping NOTIFY groupingChanged FINAL)
Q_PROPERTY(ColorSchemeModel* colorScheme READ getColorScheme CONSTANT FINAL)
Q_PROPERTY(bool hasVLM READ hasVLM CONSTANT FINAL)
......@@ -190,6 +193,8 @@ class MainCtx : public QObject
Q_PROPERTY(bool windowSuportExtendedFrame READ windowSuportExtendedFrame NOTIFY windowSuportExtendedFrameChanged)
Q_PROPERTY(unsigned windowExtendedMargin READ windowExtendedMargin WRITE setWindowExtendedMargin NOTIFY windowExtendedMarginChanged)
Q_PROPERTY(SearchCtx* search MEMBER m_search CONSTANT FINAL)
Q_PROPERTY(SortCtx* sort MEMBER m_sort CONSTANT FINAL)
public:
/* tors */
......@@ -301,7 +306,7 @@ public:
bool preferHotkeys() const;
void setPreferHotkeys(bool enable);
QWindow *intfMainWindow() const;
Q_INVOKABLE QVariant settingValue(const QString &key, const QVariant &defaultValue) const;
......@@ -357,6 +362,7 @@ protected:
bool b_hasMedialibrary = false;
MediaLib* m_medialib = nullptr;
bool m_gridView = false;
bool m_hasGridListMode = false;
Grouping m_grouping = GROUPING_NONE;
ColorSchemeModel* m_colorScheme = nullptr;
bool m_windowTitlebar = true;
......@@ -397,6 +403,9 @@ protected:
std::unique_ptr<CSDButtonModel> m_csdButtonModel;
SearchCtx* m_search = nullptr;
SortCtx* m_sort = nullptr;
public slots:
void toggleUpdateSystrayMenu();
void showUpdateSystrayMenu();
......@@ -460,6 +469,7 @@ signals:
void hasEmbededVideoChanged(bool);
void showRemainingTimeChanged(bool);
void gridViewChanged( bool );
void hasGridListModeChanged( bool );
void groupingChanged( Grouping );
void colorSchemeChanged( QString );
void useClientSideDecorationChanged();
......@@ -488,7 +498,7 @@ signals:
void screenChanged();
void useGlobalShortcutsChanged( bool );
void maxVolumeChanged();
void safeAreaChanged();
......
/*****************************************************************************
* Copyright (C) 2023 VLC authors and VideoLAN
*
* 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.
*****************************************************************************/
#ifndef MAINCTX_SUBMODELS_HPP
#define MAINCTX_SUBMODELS_HPP
#include <QObject>
#include <QString>
#include <QJSValue>
class SearchCtx: public QObject
{
Q_OBJECT
Q_PROPERTY(QString pattern MEMBER m_pattern NOTIFY patternChanged FINAL)
Q_PROPERTY(bool available MEMBER m_available NOTIFY availableChanged FINAL)
signals:
void askShow();
public:
using QObject::QObject;
signals:
void patternChanged(const QString& pattern);
void availableChanged(bool available);
private:
QString m_pattern;
bool m_available = false;
};
class SortCtx: public QObject
{
Q_OBJECT
Q_PROPERTY(bool available READ getAvailable WRITE setAvailable NOTIFY availableChanged FINAL)
Q_PROPERTY(QJSValue model READ getModel WRITE setModel NOTIFY modelChanged FINAL)
Q_PROPERTY(QString criteria READ getCriteria WRITE setCriteria NOTIFY criteriaChanged FINAL)
Q_PROPERTY(Qt::SortOrder order MEMBER m_order NOTIFY orderChanged FINAL)
signals:
void askShow();
public:
using QObject::QObject;
inline QJSValue getModel() const {
return m_model;
}
inline void setModel(const QJSValue& value) {
if (m_model.strictlyEquals(value))
return;
m_model = value;
emit modelChanged(m_model);
setAvailable(value.isArray()
&& value.property("length").toInt() > 0);
}
inline QString getCriteria() const {
return m_criteria;
}
inline void setCriteria(const QString& value) {
if (m_criteria == value)
return;
emit criteriaChanged(m_criteria);
}
inline bool getAvailable() const {
return m_available;
}
inline void setAvailable(bool value) {
if (m_available == value)
return;
m_available = value;
emit availableChanged(value);
}
signals:
void availableChanged(bool available);
void modelChanged(const QJSValue& model);
void criteriaChanged(const QString& criteria);
void orderChanged(const Qt::SortOrder& criteria);
private:
QJSValue m_model;
QString m_criteria;
Qt::SortOrder m_order = Qt::DescendingOrder;
bool m_available = false;
};
#endif // MAINCTX_SUBMODELS_HPP
......@@ -63,6 +63,8 @@
#include "widgets/native/viewblockingrectangle.hpp"
#include "videosurface.hpp"
#include "mainctx.hpp"
#include "mainctx_submodels.hpp"
#include <QScreen>
......@@ -228,6 +230,8 @@ void MainUI::registerQMLTypes()
const int versionMinor = 1;
qmlRegisterSingletonType<MainCtx>(uri, versionMajor, versionMinor, "MainCtx", SingletonRegisterHelper<MainCtx>::callback);
qmlRegisterUncreatableType<SearchCtx>(uri, versionMajor, versionMinor, "SearchCtx", "");
qmlRegisterUncreatableType<SortCtx>(uri, versionMajor, versionMinor, "SortCtx", "");
qmlRegisterSingletonType<NavigationHistory>(uri, versionMajor, versionMinor, "History", SingletonRegisterHelper<NavigationHistory>::callback);
qmlRegisterSingletonType<PlayerController>(uri, versionMajor, versionMinor, "Player", SingletonRegisterHelper<PlayerController>::callback);
......
......@@ -33,22 +33,13 @@ import "qrc:///widgets/" as Widgets
import "qrc:///menus/" as Menus
import "qrc:///util/Helpers.js" as Helpers
FocusScope {
T.ToolBar {
id: root
height: VLCStyle.applicationVerticalMargin
+ (menubar.visible ? menubar.height : 0)
+ VLCStyle.globalToolbar_height
+ VLCStyle.localToolbar_height
property int selectedIndex: 0
property int subSelectedIndex: 0
property alias sortMenu: sortControl.menu
property alias sortModel: sortControl.model
property var contentModel
property alias isViewMultiView: list_grid_btn.visible
property alias model: pLBannerSources.model
property var extraLocalActions: undefined
property alias localMenuDelegate: localMenuGroup.sourceComponent
// For now, used for d&d functionality
......@@ -61,49 +52,44 @@ FocusScope {
signal toogleMenu()
height: VLCStyle.applicationVerticalMargin
+ (menubar.visible ? menubar.height : 0)
+ VLCStyle.globalToolbar_height
+ VLCStyle.localToolbar_height
hoverEnabled: true
// Triggered when the toogleView button is selected
function toggleView () {
MainCtx.gridView = !MainCtx.gridView
}
function search() {
searchBox.state = "expanded"
}
ColorContext {
id: theme
colorSet: ColorContext.Window
}
BindingCompat {
property: "searchPattern"
target: MainCtx.search
property: "pattern"
value: searchBox.searchPattern
target: (contentModel instanceof QtObject) ? contentModel : null
}
Widgets.AcrylicBackground {
tintColor: theme.bg.primary
alternativeColor: theme.bg.secondary
anchors.fill: parent
Connections {
target: MainCtx.search
onAskShow: searchBox.expandAndFocus()
}
MouseArea {
// don't tranfer mouse to underlying components (#26274)
anchors.fill: parent
hoverEnabled: true
preventStealing: true
background: Widgets.AcrylicBackground {
tintColor: theme.bg.primary
alternativeColor: theme.bg.secondary
}
Item {
contentItem: Column {
id: pLBannerSources
property alias model: globalMenuGroup.model
anchors.fill: parent
Column {
id: col
anchors {
fill: parent
topMargin: VLCStyle.applicationVerticalMargin
......@@ -136,6 +122,7 @@ FocusScope {
width: parent.width
height: implicitHeight
visible: MainCtx.hasToolbarMenu
enabled: visible
}
Item {
......@@ -161,9 +148,14 @@ FocusScope {
onClicked: History.previous()
enabled: !History.previousEmpty
onEnabledChanged: {
if (!enabled && focus)
globalMenuGroup.focus = true
}
Navigation.parentItem: root
Navigation.rightItem: globalMenuGroup
Navigation.downItem: localMenuGroup.visible ? localMenuGroup : localToolbarBg
Navigation.downItem: localMenuGroup.visible ? localMenuGroup : localToolbar
}
Widgets.BannerCone {
......@@ -183,13 +175,13 @@ FocusScope {
focus: true
indexFocus: root.selectedIndex
//indexFocus: root.selectedIndex
Accessible.role: Accessible.PageTabList
Navigation.parentItem: root
Navigation.leftItem: history_back.enabled ? history_back : null
Navigation.downItem: localMenuGroup.visible ? localMenuGroup : playlistGroup
Navigation.leftItem: history_back
Navigation.downItem: localMenuView.visible ? localMenuView : localToolbar
delegate: Widgets.BannerTabButton {
iconTxt: model.icon
......@@ -224,19 +216,6 @@ FocusScope {
width: parent.width
height: VLCStyle.localToolbar_height
onActiveFocusChanged: {
if (activeFocus) {
// sometimes when view changes, one of the "focusable" object will become disabled
// but because of focus chainning, FocusScope still tries to force active focus on the object
// but that will fail, manually assign focus in such cases
const focusable = [localContextGroup, localMenuGroup, playlistGroup]
if (!focusable.some(function (obj) { return obj.activeFocus; })) {
// no object has focus
localToolbar.nextItemInFocusChain(true).forceActiveFocus()
}
}
}
background: Rectangle {
id: localToolbarBg
......@@ -265,14 +244,20 @@ FocusScope {
}
enabled: list_grid_btn.visible || sortControl.visible
model: ObjectModel {
id: localContextModel
property int countExtra: 0
onEnabledChanged: {
if (!enabled && focus) {
if (localMenuView.enabled)
localMenuView.focus = true
else
playlistGroup.focus = true
}
}
model: ObjectModel {
Widgets.IconToolButton {
id: list_grid_btn
visible: MainCtx.hasGridListMode
width: VLCStyle.bannerButton_width
height: VLCStyle.bannerButton_height
size: VLCStyle.icon_banner
......@@ -290,72 +275,50 @@ FocusScope {
size: VLCStyle.icon_banner
visible: root.sortModel !== undefined && root.sortModel.length > 1
visible: MainCtx.sort.available
enabled: visible
textRole: "text"
criteriaRole: "criteria"
model: MainCtx.sort.model
sortKey: contentModel ? contentModel.sortCriteria
: PlaylistController.SORT_KEY_NONE
sortOrder: contentModel ? contentModel.sortOrder : undefined
sortKey: MainCtx.sort.criteria
sortOrder: MainCtx.sort.order
onSortSelected: {
if (contentModel !== undefined)
contentModel.sortCriteria = key
}
onSortOrderSelected: {
if (contentModel !== undefined)
contentModel.sortOrder = type
}
}
}
Connections {
target: root
onExtraLocalActionsChanged : {
for (let i = 0; i < localContextModel.countExtra; i++) {
localContextModel.remove(localContextModel.count - localContextModel.countExtra, localContextModel.countExtra)
}
if (root.extraLocalActions && root.extraLocalActions instanceof ObjectModel) {
for (let i = 0; i < root.extraLocalActions.count; i++)
localContextModel.append(root.extraLocalActions.get(i))
localContextModel.countExtra = root.extraLocalActions.count
} else {
localContextModel.countExtra = 0
MainCtx.sort.criteria = key
}
onSortOrderSelected: MainCtx.sort.order = type
}
}
Navigation.parentItem: root
Navigation.rightItem: localMenuGroup.visible ? localMenuGroup : playlistGroup
Navigation.upItem: globalMenuGroup
Navigation.rightItem: localMenuView
Navigation.upItem: history_back.enabled ? history_back : globalMenuGroup
}
Flickable {
T.Pane {
id: localMenuView
readonly property int availableWidth: parent.width
readonly property int _availableWidth: parent.width
- (localContextGroup.width + playlistGroup.width)
- (VLCStyle.applicationHorizontalMargin * 2)
- (VLCStyle.margin_xsmall * 2)
- (VLCStyle.margin_xxsmall * 2)
readonly property bool _alignHCenter: ((localToolbarContent.width - contentWidth) / 2) + contentWidth < playlistGroup.x
readonly property bool _alignHCenter: ((localToolbarContent.width - contentItem.contentWidth) / 2) + contentItem.contentWidth < playlistGroup.x
width: Math.min(contentWidth, availableWidth)
width: Math.min(contentItem.contentWidth, _availableWidth)
height: VLCStyle.localToolbar_height
clip: contentWidth > width
contentWidth: localMenuGroup.width
contentHeight: VLCStyle.localToolbar_height // don't allow vertical flickering
enabled: localMenuGroup.sourceComponent !== null
visible: enabled
anchors.right: playlistGroup.left
anchors.rightMargin: VLCStyle.margin_xxsmall // only applied when right aligned
ScrollBar.horizontal: ScrollBar { }
onEnabledChanged: {
if (!enabled && focus) {
playlistGroup.focus = true
}
}
on_AlignHCenterChanged: {
if (_alignHCenter) {
......@@ -367,36 +330,42 @@ FocusScope {
}
}
Loader {
id: localMenuGroup
Navigation.parentItem: root
Navigation.leftItem: localContextGroup
Navigation.rightItem: playlistGroup
Navigation.upItem: globalMenuGroup
focus: true
visible: !!item
enabled: status === Loader.Ready
y: status === Loader.Ready ? (VLCStyle.localToolbar_height - item.height) / 2 : 0
width: !!item
? Helpers.clamp(localMenuView.availableWidth,
localMenuGroup.item.minimumWidth || localMenuGroup.item.implicitWidth,
localMenuGroup.item.maximumWidth || localMenuGroup.item.implicitWidth)
: 0
onVisibleChanged: {
//reset the focus on the global group when the local group is hidden,
//this avoids losing the focus if the subview changes
// FIXME: This block needs refactor for keyboard focus.
if (!visible && localMenuGroup.focus) {
localMenuGroup.focus = false
globalMenuGroup.focus = true
}
contentItem: Flickable {
clip: contentWidth > width
contentWidth: localMenuGroup.width
contentHeight: VLCStyle.localToolbar_height // don't allow vertical flickering
ScrollBar.horizontal: ScrollBar {
y: localMenuView.height - height
width: localMenuView.availableWidth
policy: ScrollBar.AsNeeded
}
onItemChanged: {
if (!item)
return
item.Navigation.parentItem = root
item.Navigation.leftItem = Qt.binding(function(){ return localContextGroup.enabled ? localContextGroup : null})
item.Navigation.rightItem = Qt.binding(function(){ return playlistGroup.enabled ? playlistGroup : null})
item.Navigation.upItem = globalMenuGroup
Loader {
id: localMenuGroup
focus: true
enabled: status === Loader.Ready
y: status === Loader.Ready ? (VLCStyle.localToolbar_height - item.height) / 2 : 0
width: !!item
? Helpers.clamp(localMenuView._availableWidth,
localMenuGroup.item.minimumWidth || localMenuGroup.item.implicitWidth,
localMenuGroup.item.maximumWidth || localMenuGroup.item.implicitWidth)
: 0
onItemChanged: {
if (!item)
return
item.Navigation.parentItem = localMenuView
}
}
}
}
......@@ -414,7 +383,7 @@ FocusScope {
Widgets.SearchBox {
id: searchBox
visible: !!root.contentModel
visible: MainCtx.search.available
height: VLCStyle.bannerButton_height
buttonWidth: VLCStyle.bannerButton_width
}
......@@ -494,12 +463,12 @@ FocusScope {
}
Navigation.parentItem: root
Navigation.leftItem: localMenuGroup.visible ? localMenuGroup : localContextGroup
Navigation.leftItem: localMenuView
Navigation.upItem: globalMenuGroup
}
}
}
}
Keys.priority: Keys.AfterItem
Keys.onPressed: root.Navigation.defaultKeyAction(event)
......
......@@ -90,14 +90,10 @@ FocusScope {
return null
})
sourcesBanner.sortModel = Qt.binding(function () { return item.sortModel })
sourcesBanner.contentModel = Qt.binding(function () { return item.contentModel })
sourcesBanner.extraLocalActions = Qt.binding(function () { return item.extraLocalActions })
sourcesBanner.isViewMultiView = Qt.binding(function () {
return item.isViewMultiView === undefined || item.isViewMultiView
})
MainCtx.hasGridListMode = Qt.binding(() => item.hasGridListMode !== undefined && item.hasGridListMode)
MainCtx.search.available = Qt.binding(() => item.isSearchable !== undefined && item.isSearchable)
MainCtx.sort.model = Qt.binding(function () { return item.sortModel })
MainCtx.sort.available = Qt.binding(function () { return Array.isArray(item.sortModel) && item.sortModel.length > 0 })
// Restore sourcesBanner state
sourcesBanner.selectedIndex = pageModel.filter(function (e) {
......@@ -106,11 +102,6 @@ FocusScope {
return e.name === g_mainDisplay.view.name
})
if (item.pageModel !== undefined)
sourcesBanner.subSelectedIndex = item.pageModel.findIndex(function (e) {
return e.name === item.view.name
})
if (Player.hasVideoOutput && MainCtx.hasEmbededVideo)
_showMiniPlayer = true
}
......@@ -121,7 +112,7 @@ FocusScope {
Keys.onPressed: {
if (KeyHelper.matchSearch(event)) {
sourcesBanner.search()
MainCtx.search.askShow()
event.accepted = true
}
//unhandled keys are forwarded as hotkeys
......@@ -185,16 +176,6 @@ FocusScope {
}
}
Util.ModelSortSettingHandler {
id: modelSortSettingHandler
}
Connections {
target: sourcesBanner
onContentModelChanged: modelSortSettingHandler.set(sourcesBanner.contentModel, History.viewPath)
}
ColorContext {
id: theme
palette: VLCStyle.palette
......@@ -265,10 +246,7 @@ FocusScope {
}
Navigation.parentItem: medialibId
Navigation.downAction: function() {
stackView.currentItem.setCurrentItemFocus(Qt.TabFocusReason);
}
Navigation.downItem: stackView
}
Item {
......
......@@ -27,6 +27,7 @@ import org.videolan.compat 0.1
import "qrc:///widgets/" as Widgets
import "qrc:///style/"
import "qrc:///util/" as Util
import "qrc:///playlist/" as PL
Item {
......@@ -42,6 +43,8 @@ Item {
{ name: "player", url:"qrc:///player/Player.qml" },
]
property var _oldHistoryPath: ([])
function setInitialView() {
//set the initial view
const loadPlayer = !MainPlaylistController.empty;
......@@ -70,11 +73,20 @@ Item {
console.warn("unable to load requested view, undefined")
return
}
contextSaver.save(_oldHistoryPath)
stackView.loadView(_pageModel, current.name, current.properties)
contextSaver.restore(History.viewPath)
_oldHistoryPath = History.viewPath
MainCtx.mediaLibraryVisible = !History.match(History.viewPath, ["player"])
}
Util.ModelSortSettingHandler {
id: contextSaver
}
Item {
id: g_mainInterface
......
......@@ -57,6 +57,12 @@ Widgets.StackViewExt {
readonly property int count: model.count
readonly property bool hasGridListMode: !!grid && !!list
property bool isSearchable: false
property var sortModel: []
property var selectionModel: Util.SelectableDelegateModel {
model: root.model
}
......
......@@ -20,6 +20,7 @@
import QtQuick 2.12
import org.videolan.vlc 0.1
import org.videolan.medialib 0.1
import "qrc:///widgets/" as Widgets
......@@ -44,6 +45,10 @@ VideoAll {
model: MLVideoModel {
id: modelVideo
searchPattern: MainCtx.search.pattern
sortOrder: MainCtx.sort.order
sortCriteria: MainCtx.sort.criteria
ml: MediaLib
}
......
......@@ -42,17 +42,21 @@ MainInterface.MainViewLoader {
readonly property int contentLeftMargin: Helpers.get(currentItem, "contentLeftMargin", 0)
readonly property int contentRightMargin: Helpers.get(currentItem, "contentRightMargin", 0)
property var sortModel: [
property alias parentId: albumModelId.parentId
property alias searchPattern: albumModelId.searchPattern
property alias sortOrder: albumModelId.sortOrder
property alias sortCriteria: albumModelId.sortCriteria
isSearchable: true
model: albumModelId
sortModel: [
{ text: I18n.qtr("Alphabetic"), criteria: "title"},
{ text: I18n.qtr("Duration"), criteria: "duration" },
{ text: I18n.qtr("Date"), criteria: "release_year" },
{ text: I18n.qtr("Artist"), criteria: "main_artist" },
]
property alias parentId: albumModelId.parentId
model: albumModelId
grid: gridComponent
list: tableComponent
emptyLabel: emptyLabelComponent
......
......@@ -29,4 +29,8 @@ MusicAlbums {
onCurrentIndexChanged: {
History.update(["mc","music", "albums", {"initialIndex": currentIndex}])
}
searchPattern: MainCtx.search.pattern
sortCriteria: MainCtx.sort.criteria
sortOrder: MainCtx.sort.order
}
......@@ -34,18 +34,25 @@ MainInterface.MainViewLoader {
readonly property int currentIndex: Helpers.get(currentItem, "currentIndex", - 1)
property alias parentId: artistModel.parentId
property alias searchPattern: artistModel.searchPattern
property alias sortOrder: artistModel.sortOrder
property alias sortCriteria: artistModel.sortCriteria
signal requestArtistAlbumView(int reason)
property var sortModel: [
{ text: I18n.qtr("Alphabetic"), criteria: "name" },
{ text: I18n.qtr("Tracks Count"), criteria: "nb_tracks" }
]
isSearchable: true
model: MLArtistModel {
id: artistModel
ml: MediaLib
}
sortModel: [
{ text: I18n.qtr("Alphabetic"), criteria: "name" },
{ text: I18n.qtr("Tracks Count"), criteria: "nb_tracks" }
]
grid: gridComponent
list: tableComponent
emptyLabel: emptyLabelComponent
......
......@@ -39,6 +39,12 @@ FocusScope {
property Item headerItem: _currentView ? _currentView.headerItem : null
property bool isSearchable: true
property alias searchPattern: albumModel.searchPattern
property alias sortOrder: albumModel.sortOrder
property alias sortCriteria: albumModel.sortCriteria
// current index of album model
readonly property int currentIndex: {
if (!_currentView)
......
......@@ -45,10 +45,15 @@ FocusScope {
property int initialIndex: 0
property int initialAlbumIndex: 0
// Aliases
readonly property bool hasGridListMode: true
readonly property bool isSearchable: true
property alias model: artistModel
property alias searchPattern: albumSubView.searchPattern
property alias sortOrder: albumSubView.sortOrder
property alias sortCriteria: albumSubView.sortCriteria
property alias currentIndex: artistList.currentIndex
property alias currentAlbumIndex: albumSubView.currentIndex
......
......@@ -32,12 +32,6 @@ import "qrc:///style/"
Widgets.PageLoader {
id: root
property MLModel model
property var sortModel: !!stackViewItem && ("sortModel" in stackViewItem)
? stackViewItem.sortModel
: null
pageModel: [{
name: "all",
component: allArtistsComponent
......@@ -51,10 +45,6 @@ Widgets.PageLoader {
loadPage("all")
}
onCurrentItemChanged: {
model = currentItem.model
}
function _updateArtistsAllHistory(currentIndex) {
History.update(["mc", "music", "artists", "all", { "initialIndex": currentIndex }])
}
......@@ -72,6 +62,10 @@ Widgets.PageLoader {
MusicAllArtists {
onCurrentIndexChanged: _updateArtistsAllHistory(currentIndex)
searchPattern: MainCtx.search.pattern
sortOrder: MainCtx.sort.order
sortCriteria: MainCtx.sort.criteria
onRequestArtistAlbumView: History.push(["mc", "music", "artists", "albums",
{ initialIndex: currentIndex }], reason)
}
......@@ -84,6 +78,10 @@ Widgets.PageLoader {
Navigation.parentItem: root
searchPattern: MainCtx.search.pattern
sortOrder: MainCtx.sort.order
sortCriteria: MainCtx.sort.criteria
onCurrentIndexChanged: _updateArtistsAlbumsHistory(currentIndex, currentAlbumIndex)
onCurrentAlbumIndexChanged: _updateArtistsAlbumsHistory(currentIndex, currentAlbumIndex)
}
......
......@@ -29,10 +29,6 @@ import "qrc:///style/"
Widgets.PageLoader {
id: root
property var sortModel
property var contentModel
property bool isViewMultiView: true
Accessible.role: Accessible.Client
Accessible.name: I18n.qtr("Music view")
......@@ -64,12 +60,6 @@ Widgets.PageLoader {
loadPage("artists")
}
onCurrentItemChanged: {
sortModel = currentItem.sortModel
contentModel = currentItem.model
isViewMultiView = currentItem.isViewMultiView === undefined || currentItem.isViewMultiView
}
function loadIndex(index) {
History.push(["mc", "music", root.pageModel[index].name])
}
......
......@@ -33,20 +33,24 @@ MainInterface.MainViewLoader {
id: root
// Properties
property var sortModel: [
{ text: I18n.qtr("Alphabetic"), criteria: "name" }
]
readonly property var currentIndex: Helpers.get(currentItem, "currentIndex", - 1)
property alias searchPattern: genreModel.searchPattern
property alias sortOrder: genreModel.sortOrder
property alias sortCriteria: genreModel.sortCriteria
// FIXME: remove this
property var _currentView: currentItem
signal showAlbumView(var id, string name, int reason)
isSearchable: true
model: genreModel
sortModel: [
{ text: I18n.qtr("Alphabetic"), criteria: "name" }
]
list: tableComponent
grid: gridComponent
emptyLabel: emptyLabelComponent
......
......@@ -28,9 +28,6 @@ import "qrc:///style/"
Widgets.PageLoader {
id: root
property var sortModel
property var model
pageModel: [{
name: "all",
component: genresComponent
......@@ -44,11 +41,6 @@ Widgets.PageLoader {
loadPage("all")
}
onCurrentItemChanged: {
sortModel = currentItem.sortModel
model = currentItem.model
}
function _updateGenresAllHistory(currentIndex) {
History.update(["mc", "music", "genres", "all", { "initialIndex": currentIndex }])
......@@ -68,6 +60,10 @@ Widgets.PageLoader {
MusicGenres {
onCurrentIndexChanged: _updateGenresAllHistory(currentIndex)
searchPattern: MainCtx.search.pattern
sortOrder: MainCtx.sort.order
sortCriteria: MainCtx.sort.criteria
onShowAlbumView: History.push(["mc", "music", "genres", "albums",
{ parentId: id, genreName: name }], reason)
}
......@@ -93,6 +89,10 @@ Widgets.PageLoader {
color: colorContext.fg.primary
}
searchPattern: MainCtx.search.pattern
sortOrder: MainCtx.sort.order
sortCriteria: MainCtx.sort.criteria
onParentIdChanged: _updateGenresAlbumsHistory(currentIndex, parentId, genreName)
onGenreNameChanged: _updateGenresAlbumsHistory(currentIndex, parentId, genreName)
onCurrentIndexChanged: _updateGenresAlbumsHistory(currentIndex, parentId, genreName)
......
......@@ -30,15 +30,6 @@ import "qrc:///style/"
Widgets.PageLoader {
id: root
//---------------------------------------------------------------------------------------------
// Aliases
//---------------------------------------------------------------------------------------------
property bool isViewMultiView: true
property var model
property var sortModel
//---------------------------------------------------------------------------------------------
// Settings
//---------------------------------------------------------------------------------------------
......@@ -56,19 +47,6 @@ Widgets.PageLoader {
loadPage("all")
}
//---------------------------------------------------------------------------------------------
// Events
//---------------------------------------------------------------------------------------------
onCurrentItemChanged: {
model = currentItem.model;
sortModel = currentItem.sortModel;
isViewMultiView = (currentItem.isViewMultiView === undefined
||
currentItem.isViewMultiView);
}
//---------------------------------------------------------------------------------------------
// Functions
//---------------------------------------------------------------------------------------------
......@@ -98,8 +76,14 @@ Widgets.PageLoader {
onCurrentIndexChanged: _updateHistoryList(currentIndex)
onShowList: History.push(["mc", "music", "playlists", "list",
{ parentId: model.id, name: model.name }], reason)
onShowList: (model, reason) => {
History.push(["mc", "music", "playlists", "list",
{ parentId: model.id, name: model.name }], reason)
}
searchPattern: MainCtx.search.pattern
sortOrder: MainCtx.sort.order
sortCriteria: MainCtx.sort.criteria
}
}
......@@ -111,6 +95,10 @@ Widgets.PageLoader {
isMusic: true
searchPattern: MainCtx.search.pattern
sortOrder: MainCtx.sort.order
sortCriteria: MainCtx.sort.criteria
onCurrentIndexChanged: _updateHistoryPlaylist(playlist)
onParentIdChanged : _updateHistoryPlaylist(playlist)
onNameChanged : _updateHistoryPlaylist(playlist)
......