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 (12)
......@@ -47,8 +47,7 @@ FocusScope {
property bool hasMiniPlayer: miniPlayer.visible
// NOTE: The main view must be above the indexing bar and the mini player.
property int displayMargin: (loaderProgress.active) ? miniPlayer.height + loaderProgress.height
: miniPlayer.height
property real displayMargin: (height - miniPlayer.y) + (loaderProgress.active ? loaderProgress.height : 0)
readonly property int positionSliderY: {
var size = miniPlayer.y + miniPlayer.sliderY
......@@ -59,7 +58,6 @@ FocusScope {
return size
}
property bool _inhibitMiniPlayer: false
property bool _showMiniPlayer: false
property var _oldViewProperties: ({}) // saves last state of the views
......@@ -195,7 +193,6 @@ FocusScope {
function showPlayer() {
g_mainDisplay._inhibitMiniPlayer = true
History.push(["player"])
}
......@@ -248,13 +245,7 @@ FocusScope {
tint: frostedTheme.bg.secondary
effectRect: {
let _height = 0
if (loaderProgress.active && loaderProgress.item.visible)
_height += loaderProgress.item.height
if (miniPlayer.visible)
_height += miniPlayer.height
return Qt.rect(0, height - _height, width, _height)
return Qt.rect(0, loaderProgress.y, width, height - loaderProgress.y)
}
}
......@@ -484,6 +475,8 @@ FocusScope {
active: (MainCtx.mediaLibraryAvailable && MainCtx.mediaLibrary.idle === false)
height: active ? implicitHeight : 0
source: "qrc:///widgets/ScanProgressBar.qml"
onLoaded: {
......@@ -507,8 +500,8 @@ FocusScope {
width: VLCStyle.dp(320, VLCStyle.scale)
height: VLCStyle.dp(180, VLCStyle.scale)
z: 2
visible: !g_mainDisplay._inhibitMiniPlayer && g_mainDisplay._showMiniPlayer && MainCtx.hasEmbededVideo
enabled: !g_mainDisplay._inhibitMiniPlayer && g_mainDisplay._showMiniPlayer && MainCtx.hasEmbededVideo
visible: g_mainDisplay._showMiniPlayer && MainCtx.hasEmbededVideo
enabled: g_mainDisplay._showMiniPlayer && MainCtx.hasEmbededVideo
dragXMin: 0
dragXMax: g_mainDisplay.width - playerPip.width
......@@ -543,11 +536,6 @@ FocusScope {
P.MiniPlayer {
id: miniPlayer
BindingCompat on state {
when: g_mainDisplay._inhibitMiniPlayer && !miniPlayer.visible
value: ""
}
anchors.left: parent.left
anchors.right: parent.right
anchors.bottom: parent.bottom
......@@ -555,7 +543,7 @@ FocusScope {
z: 3
horizontalPadding: VLCStyle.applicationHorizontalMargin
bottomPadding: VLCStyle.applicationVerticalMargin
bottomPadding: VLCStyle.applicationVerticalMargin + VLCStyle.margin_xsmall
background.visible: !parentRectangle.layer.enabled
......
......@@ -23,13 +23,14 @@ import QtQuick.Layouts 1.12
import QtQml.Models 2.12
import org.videolan.vlc 0.1
import org.videolan.compat 0.1
import "qrc:///style/"
import "qrc:///widgets/" as Widgets
import "qrc:///playlist/" as PL
Control {
T.Pane {
id: root
enum TimeTextPosition {
......@@ -38,6 +39,18 @@ Control {
LeftRightSlider
}
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
contentWidth + leftPadding + rightPadding)
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
contentHeight + topPadding + bottomPadding)
bottomPadding: VLCStyle.margin_xsmall
BindingCompat on topInset {
delayed: true
value: row2.y
}
readonly property alias sliderY: row2.y
property int textPosition: ControlBar.TimeTextPosition.AboveSlider
property alias identifier: playerControlLayout.identifier
......@@ -56,16 +69,6 @@ Control {
Accessible.name: I18n.qtr("Player controls")
onActiveFocusChanged: if (activeFocus) trackPositionSlider.forceActiveFocus(focusReason)
Component.onCompleted: {
// if initially textPosition = Hide, then _onTextPositionChanged isn't called
if (textPosition === ControlBar.TimeTextPosition.Hide)
_layout()
}
onTextPositionChanged: _layout()
function showChapterMarks() {
trackPositionSlider.showChapterMarks()
}
......@@ -90,85 +93,80 @@ Control {
menu.close()
}
function _layout() {
switch (textPosition) {
case ControlBar.TimeTextPosition.Hide:
row1.children = []
row2.children = [trackPositionSlider]
mediaTime.visible = false
mediaRemainingTime.visible = false
spacer.visible = false
row2.Layout.leftMargin = 0
row2.Layout.rightMargin = 0
mediaTime.font.pixelSize = Qt.binding(function() { return VLCStyle.fontSize_normal })
mediaRemainingTime.font.pixelSize = Qt.binding(function() { return VLCStyle.fontSize_normal })
break;
case ControlBar.TimeTextPosition.AboveSlider:
row1.children = [mediaTime, spacer, mediaRemainingTime]
row2.children = [trackPositionSlider]
mediaTime.visible = true
mediaRemainingTime.visible = Qt.binding(function() { return !playlistVisibility.isPlaylistVisible })
spacer.visible = true
row2.Layout.leftMargin = 0
row2.Layout.rightMargin = 0
mediaTime.font.pixelSize = Qt.binding(function() { return VLCStyle.fontSize_normal })
mediaRemainingTime.font.pixelSize = Qt.binding(function() { return VLCStyle.fontSize_normal })
break;
case ControlBar.TimeTextPosition.LeftRightSlider:
row1.children = []
row2.children = [mediaTime, trackPositionSlider, mediaRemainingTime]
mediaTime.visible = true
mediaRemainingTime.visible = true
spacer.visible = false
row2.Layout.leftMargin = VLCStyle.margin_xsmall
row2.Layout.rightMargin = VLCStyle.margin_xsmall
mediaTime.font.pixelSize = Qt.binding(function() { return VLCStyle.fontSize_small })
mediaRemainingTime.font.pixelSize = Qt.binding(function() { return VLCStyle.fontSize_small })
trackPositionSlider.Layout.alignment = Qt.AlignVCenter
break;
default:
console.assert(false, "invalid text position")
}
row1.visible = row1.children.length > 0
row2.visible = row2.children.length > 0
}
readonly property ColorContext colorContext: ColorContext {
id: theme
colorSet: ColorContext.Window
}
background: Rectangle {
color: theme.bg.primary
}
contentItem: ColumnLayout {
spacing: VLCStyle.margin_xsmall
z: 1
RowLayout {
id: row1
Item {
// BUG: RowLayout can not be used here
// because of a Qt bug. (Height is
// incorrectly determined. Could be
// about nested layouting).
spacing: 0
id: pseudoRow
Layout.fillWidth: true
Layout.fillHeight: false
Layout.leftMargin: VLCStyle.margin_normal
Layout.rightMargin: VLCStyle.margin_normal
implicitHeight: visible ? Math.max(mediaTime.implicitHeight, mediaRemainingTime.implicitHeight) : 0
visible: children.length > 0
children: {
switch (textPosition) {
case ControlBar.TimeTextPosition.AboveSlider:
return [mediaTime, mediaRemainingTime]
case ControlBar.TimeTextPosition.Hide:
case ControlBar.TimeTextPosition.LeftRightSlider:
default:
return []
}
}
}
RowLayout {
id: row2
children: {
switch (textPosition) {
case ControlBar.TimeTextPosition.Hide:
case ControlBar.TimeTextPosition.AboveSlider:
return [trackPositionSlider]
case ControlBar.TimeTextPosition.LeftRightSlider:
return [mediaTime, trackPositionSlider, mediaRemainingTime]
default:
return []
}
}
visible: children.length > 0
spacing: VLCStyle.margin_xsmall
Layout.fillWidth: true
Layout.fillHeight: false
Layout.leftMargin: (textPosition === ControlBar.TimeTextPosition.LeftRightSlider) ? VLCStyle.margin_xsmall
: 0
Layout.rightMargin: Layout.leftMargin
}
PlayerControlLayout {
id: playerControlLayout
Layout.fillWidth: true
Layout.fillHeight: true
Layout.leftMargin: VLCStyle.margin_large
Layout.rightMargin: VLCStyle.margin_large
Layout.bottomMargin: VLCStyle.margin_xsmall
Navigation.upItem: trackPositionSlider.enabled ? trackPositionSlider : root.Navigation.upItem
......@@ -178,64 +176,68 @@ Control {
}
}
T.Label {
id: mediaTime
text: Player.time.formatHMS()
color: theme.fg.primary
}
T.Label {
id: mediaRemainingTime
text: (MainCtx.showRemainingTime && Player.remainingTime.valid())
? "-" + Player.remainingTime.formatHMS()
: Player.length.formatHMS()
color: theme.fg.primary
MouseArea {
anchors.fill: parent
onClicked: MainCtx.showRemainingTime = !MainCtx.showRemainingTime
}
}
Item {
id: spacer
Layout.fillWidth: true
}
SliderBar {
id: trackPositionSlider
barHeight: VLCStyle.heightBar_xxsmall
Layout.fillWidth: true
enabled: Player.playingState === Player.PLAYING_STATE_PLAYING || Player.playingState === Player.PLAYING_STATE_PAUSED
readonly property list<Item> strayItems: [
T.Label {
id: mediaTime
text: Player.time.formatHMS()
color: theme.fg.primary
font.pixelSize: (textPosition === ControlBar.TimeTextPosition.LeftRightSlider) ? VLCStyle.fontSize_small
: VLCStyle.fontSize_normal
anchors.left: (parent === pseudoRow) ? parent.left : undefined
anchors.verticalCenter: (parent === pseudoRow) ? parent.verticalCenter : undefined
},
T.Label {
id: mediaRemainingTime
text: (MainCtx.showRemainingTime && Player.remainingTime.valid())
? "-" + Player.remainingTime.formatHMS()
: Player.length.formatHMS()
color: mediaTime.color
font.pixelSize: mediaTime.font.pixelSize
anchors.right: (parent === pseudoRow) ? parent.right : undefined
anchors.verticalCenter: (parent === pseudoRow) ? parent.verticalCenter : undefined
MouseArea {
anchors.fill: parent
onClicked: MainCtx.showRemainingTime = !MainCtx.showRemainingTime
}
},
SliderBar {
id: trackPositionSlider
barHeight: VLCStyle.heightBar_xxsmall
Layout.fillWidth: true
enabled: Player.playingState === Player.PLAYING_STATE_PLAYING || Player.playingState === Player.PLAYING_STATE_PAUSED
Navigation.parentItem: root
Navigation.downItem: playerControlLayout
Navigation.parentItem: root
Navigation.downItem: playerControlLayout
activeFocusOnTab: true
activeFocusOnTab: true
Keys.onPressed: {
Navigation.defaultKeyAction(event)
}
}
focus: true
Loader {
id: bookmarksLoader
Keys.onPressed: {
Navigation.defaultKeyAction(event)
}
},
Loader {
id: bookmarksLoader
active: MainCtx.mediaLibraryAvailable
source: "qrc:/player/Bookmarks.qml"
parent: root
active: MainCtx.mediaLibraryAvailable
source: "qrc:/player/Bookmarks.qml"
x: root.leftPadding + trackPositionSlider.x + row2.Layout.leftMargin
y: row2.y + row2.height + VLCStyle.margin_xxsmall
width: trackPositionSlider.width
x: root.leftPadding + trackPositionSlider.x + row2.Layout.leftMargin
y: row2.y + row2.height + VLCStyle.margin_xxsmall
width: trackPositionSlider.width
onLoaded: {
item.barHeight = Qt.binding(function() { return bookmarksHeight })
item.controlBarHovered = Qt.binding(function() { return root.hovered })
item.yShift = Qt.binding(function() { return row2.height + VLCStyle.margin_xxsmall })
onLoaded: {
item.barHeight = Qt.binding(function() { return bookmarksHeight })
item.controlBarHovered = Qt.binding(function() { return root.hovered })
item.yShift = Qt.binding(function() { return row2.height + VLCStyle.margin_xxsmall })
}
}
}
]
}
......@@ -16,100 +16,62 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
import QtQuick 2.12
import QtQuick.Controls 2.12
import QtQuick.Templates 2.12 as T
import QtQuick.Layouts 1.12
import QtGraphicalEffects 1.12
import org.videolan.vlc 0.1
import org.videolan.compat 0.1
import "qrc:///widgets/" as Widgets
import "qrc:///style/"
T.Pane {
ControlBar {
id: root
readonly property alias sliderY: controlBar.sliderY
height: 0
// Binding evaluation order:
// state -> implicitHeight OR visible -> anchors.bottomMargin
// Care must be taken to not cause binding loops.
visible: {
if (state === "inViewport")
return true
else if ((anchors.bottomMargin + implicitHeight) > Number.EPSILON)
return true
else
return false
}
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
implicitContentWidth + leftPadding + rightPadding)
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
implicitContentHeight + topPadding + bottomPadding)
state: (Player.playingState === Player.PLAYING_STATE_STOPPED) ? "outViewport"
: "inViewport"
visible: false
textPosition: (MainCtx.pinVideoControls) ? ControlBar.TimeTextPosition.LeftRightSlider
: ControlBar.TimeTextPosition.Hide
state: (Player.playingState === Player.PLAYING_STATE_STOPPED) ? ""
: "expanded"
sliderHeight: (MainCtx.pinVideoControls) ? VLCStyle.heightBar_xxsmall
: VLCStyle.dp(3, VLCStyle.scale)
//redundant with child ControlBar
Accessible.ignored: true
bookmarksHeight: (MainCtx.pinVideoControls) ? VLCStyle.controlBarBookmarksHeight
: VLCStyle.icon_xsmall * 0.7
states: State {
name: "expanded"
identifier: PlayerControlbarModel.Miniplayer
PropertyChanges {
target: root
visible: true
height: implicitHeight
}
Component.onCompleted: {
// Enable the behavior only when everything is resolved:
Qt.callLater(() => { behavior.enabled = true })
}
transitions: Transition {
from: ""; to: "expanded"
reversible: true
BindingCompat on anchors.bottomMargin {
id: binding
SequentialAnimation {
// visible should change first, in order for inner layouts to calculate implicitHeight correctly
PropertyAction { property: "visible" }
NumberAnimation { property: "height"; easing.type: Easing.InOutSine; duration: VLCStyle.duration_long; }
}
}
readonly property ColorContext colorContext: ColorContext {
id: theme
colorSet: ColorContext.Window
}
// eliminate intermediate adjustments until implicit height is calculated fully
// we can not delay on component load because we do not want twitching
// NOTE: The delay here can be removed, as long as a direct height is set
// for the whole control instead of implicit height.
delayed: behavior.enabled
// this MouseArea prevents mouse events to be sent below miniplayer
MouseArea {
anchors.fill: parent
hoverEnabled: true
acceptedButtons: Qt.AllButtons
value: (root.state === "outViewport") ? -root.implicitHeight : 0
}
background: Rectangle {
color: theme.bg.primary
}
contentItem: ControlBar {
id: controlBar
focus: true
// NOTE: When controls are pinned we keep the same slider in both views. Otherwise we make
// it more compact to fit the modern design.
textPosition: (MainCtx.pinVideoControls) ? ControlBar.TimeTextPosition.LeftRightSlider
: ControlBar.TimeTextPosition.Hide
sliderHeight: (MainCtx.pinVideoControls) ? VLCStyle.heightBar_xxsmall
: VLCStyle.dp(3, VLCStyle.scale)
bookmarksHeight: (MainCtx.pinVideoControls) ? VLCStyle.controlBarBookmarksHeight
: VLCStyle.icon_xsmall * 0.7
identifier: PlayerControlbarModel.Miniplayer
Navigation.parentItem: root
Keys.onPressed: {
Navigation.defaultKeyAction(event)
if (!event.accepted) {
MainCtx.sendHotkey(event.key, event.modifiers)
}
}
Behavior on anchors.bottomMargin {
id: behavior
enabled: false
NumberAnimation { easing.type: Easing.InOutSine; duration: VLCStyle.duration_long; }
}
}
......@@ -216,19 +216,6 @@ FocusScope {
}
}
// Backgrounds of topControlbar and controlBar are drawn separately since they can outgrow their content
Component {
id: backgroundForPinnedControls
Rectangle {
width: rootPlayer.width
opacity: MainCtx.pinOpacity
color: windowTheme.bg.primary
}
}
Component {
id: acrylicBackground
......@@ -281,49 +268,22 @@ FocusScope {
}
}
/* bottom control bar background */
Widgets.LoaderFade {
Rectangle {
anchors.bottom: controlBarView.bottom
anchors.left: controlBarView.left
anchors.right: controlBarView.right
height: item.height
state: controlBarView.state
sourceComponent: (MainCtx.pinVideoControls)
? backgroundForPinnedControls
: (rootPlayer.hasEmbededVideo ? forVideoMedia : forMusicMedia)
onItemChanged: {
if (rootPlayer._controlsUnderVideo)
item.height = Qt.binding(function () { return rootPlayer.height - rootPlayer.positionSliderY; })
}
implicitHeight: VLCStyle.dp(206, VLCStyle.scale)
Component {
id: forVideoMedia
opacity: controlBarView.opacity
Rectangle {
width: rootPlayer.width
height: VLCStyle.dp(206, VLCStyle.scale)
gradient: Gradient {
GradientStop { position: 0; color: "transparent" }
GradientStop { position: .64; color: Qt.rgba(0, 0, 0, .8) }
GradientStop { position: 1; color: "black" }
}
}
gradient: Gradient {
GradientStop { position: 0; color: "transparent" }
GradientStop { position: .64; color: Qt.rgba(0, 0, 0, .8) }
GradientStop { position: 1; color: "black" }
}
Component {
id: forMusicMedia
Rectangle {
width: controlBarView.width
height: controlBarView.height - (rootPlayer.positionSliderY - controlBarView.y)
color: windowTheme.bg.primary
opacity: 0.7
}
}
visible: (controlBarView.item ? !controlBarView.item.background.visible : true)
}
Widgets.LoaderFade {
......@@ -656,41 +616,37 @@ FocusScope {
item.showChapterMarks()
}
sourceComponent: MouseArea {
id: controllerMouseArea
sourceComponent: ControlBar {
hoverEnabled: true
readonly property alias sliderY: controllerId.sliderY
focus: true
height: controllerId.implicitHeight + controllerId.anchors.bottomMargin
width: controlBarView.width
hoverEnabled: true
rightPadding: VLCStyle.applicationHorizontalMargin
leftPadding: VLCStyle.applicationHorizontalMargin
bottomPadding: VLCStyle.applicationVerticalMargin + VLCStyle.margin_xsmall
function showChapterMarks() {
controllerId.showChapterMarks()
}
textPosition: (MainCtx.pinVideoControls)
? ControlBar.TimeTextPosition.LeftRightSlider
: ControlBar.TimeTextPosition.AboveSlider
Navigation.parentItem: rootPlayer
Navigation.upItem: playlistpopup.showPlaylist ? playlistpopup : (audioControls.visible ? audioControls : topcontrolView)
onContainsMouseChanged: rootPlayer.lockUnlockAutoHide(containsMouse)
onRequestLockUnlockAutoHide: rootPlayer.lockUnlockAutoHide(lock)
ControlBar {
id: controllerId
identifier: (Player.hasVideoOutput) ? PlayerControlbarModel.Videoplayer
: PlayerControlbarModel.Audioplayer
focus: true
anchors.fill: parent
anchors.leftMargin: VLCStyle.applicationHorizontalMargin
anchors.rightMargin: VLCStyle.applicationHorizontalMargin
anchors.bottomMargin: VLCStyle.applicationVerticalMargin
onHoveredChanged: rootPlayer.lockUnlockAutoHide(hovered)
textPosition: (MainCtx.pinVideoControls)
? ControlBar.TimeTextPosition.LeftRightSlider
: ControlBar.TimeTextPosition.AboveSlider
background: Rectangle {
id: controlBarBackground
Navigation.parentItem: rootPlayer
Navigation.upItem: playlistpopup.showPlaylist ? playlistpopup : (audioControls.visible ? audioControls : topcontrolView)
visible: !MainCtx.hasEmbededVideo
onRequestLockUnlockAutoHide: rootPlayer.lockUnlockAutoHide(lock)
opacity: MainCtx.pinVideoControls ? MainCtx.pinOpacity : 0.7
identifier: (Player.hasVideoOutput) ? PlayerControlbarModel.Videoplayer
: PlayerControlbarModel.Audioplayer
color: windowTheme.bg.primary
}
}
}
......