Commit 00c2c07a authored by Camilo Higuita's avatar Camilo Higuita

quick babetable improvements

parent 0f53a12e
......@@ -26,6 +26,9 @@ ApplicationWindow
// property int columnWidth: Kirigami.Units.gridUnit * 13
readonly property bool isMobile: bae.isMobile()
property int columnWidth: Math.sqrt(root.width*root.height)*0.4
property int currentView : 0
property int iconSize
......@@ -44,7 +47,7 @@ ApplicationWindow
// color: "transparent"
// }
onWidthChanged: if(bae.isMobile())
onWidthChanged: if(root.isMobile)
{
if(root.width>root.height)
mainPlaylist.cover.visible = false
......@@ -144,7 +147,7 @@ ApplicationWindow
color: bae.foregroundColor()
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
selectByMouse: !bae.isMobile()
selectByMouse: !root.isMobile
selectionColor: bae.hightlightColor()
selectedTextColor: bae.foregroundColor()
property string placeholderText: "Search..."
......@@ -237,7 +240,7 @@ ApplicationWindow
onCurrentIndexChanged: currentView = currentIndex
Component.onCompleted: contentItem.interactive = bae.isMobile()
Component.onCompleted: contentItem.interactive = root.isMobile
currentIndex: currentView
......
......@@ -12,7 +12,7 @@ Item
property int borderRadius : 2
property string fillColor: bae.midLightColor()
property string textColor: bae.foregroundColor()
property int fontSize : bae.isMobile()? 12 : 10
property int fontSize : root.isMobile? 12 : 10
property bool hide : false
width: albumSize
......
......@@ -8,7 +8,7 @@ ScrollBar
position: 0.2
active: true
focus: true
visible: !bae.isMobile()
visible: !root.isMobile
background : Rectangle
{
radius: 12
......
......@@ -43,16 +43,19 @@ ListView
highlight: highlight
highlightFollowsCurrentItem: false
keyNavigationWraps: bae.isMobile()
keyNavigationWraps: root.isMobile
focus: true
// boundsBehavior: Flickable.StopAtBounds
// boundsBehavior: Flickable.StopAtBounds
// flickableDirection: Flickable.AutoFlickDirection
snapMode: ListView.SnapToItem
addDisplaced: Transition {
addDisplaced: Transition
{
NumberAnimation { properties: "x,y"; duration: 1000 }
}
function clearTable()
{
listModel.clear()
......@@ -64,7 +67,6 @@ ListView
visible: list.count === 0
}
Rectangle
{
anchors.fill: parent
......@@ -79,13 +81,14 @@ ListView
width: parent.width
height: headerBar ? 48 : 0
color: bae.midLightColor()
visible: headerBar
visible: headerBar && count > 0
z: 999
RowLayout
{
anchors.fill: parent
ToolButton
{
id: closeBtn
......@@ -195,20 +198,20 @@ ListView
{
target: delegate
onPressAndHold: if(bae.isMobile()) openItemMenu(index)
onPressAndHold: if(root.isMobile) openItemMenu(index)
onRightClicked: openItemMenu(index)
onClicked:
{
currentIndex = index
if(bae.isMobile())
if(root.isMobile)
list.rowClicked(index)
}
onDoubleClicked:
{
if(!bae.isMobile())
if(!root.isMobile)
list.rowClicked(index)
}
......@@ -226,7 +229,7 @@ ListView
currentRow = index
currentIndex = index
contextMenu.rate = bae.trackRate(list.model.get(currentRow).url)
if(bae.isMobile()) contextMenu.open()
if(root.isMobile) contextMenu.open()
else
contextMenu.popup()
list.rowPressed(index)
......
......@@ -9,7 +9,7 @@ ItemDelegate
id: delegate
width: parent.width
height: 64
height: sameAlbum ? 48 : 64
signal play()
signal rightClicked()
......@@ -56,7 +56,7 @@ ItemDelegate
acceptedButtons: Qt.RightButton
onClicked:
{
if(!bae.isMobile() && mouse.button === Qt.RightButton)
if(!root.isMobile && mouse.button === Qt.RightButton)
rightClicked()
}
}
......@@ -64,7 +64,7 @@ ItemDelegate
contentItem: RowLayout
{
id: gridLayout
height: delegate.height
height: sameAlbum ? 64 : delegate.height
width: delegate.width
spacing: 20
......@@ -101,14 +101,14 @@ ItemDelegate
(artwork.length > 0 && artwork !== "NONE")? "file://"+encodeURIComponent(artwork) : "qrc:/assets/cover.png"
else "qrc:/assets/cover.png"
}
fillMode: Image.PreserveAspectFit
fillMode: Image.PreserveAspectFit
cache: false
antialiasing: true
}
onDoubleClicked: artworkCoverDoubleClicked()
onClicked: artworkCoverClicked()
onPressAndHold: if(bae.isMobile()) artworkCoverDoubleClicked()
onPressAndHold: if(root.isMobile) artworkCoverDoubleClicked()
}
}
......
......@@ -11,7 +11,7 @@ Menu
id: rootMenu
x: parent.width / 2 - width / 2
y: parent.height / 2 - height / 2
modal: bae.isMobile()
modal: root.isMobile
focus: true
......@@ -20,7 +20,7 @@ Menu
property string starReg : bae.foregroundColor()
property string starIcon: MdiFont.Icon.star
property int assetsize : menuItemHeight/2
property int menuItemHeight : bae.isMobile() ? 48 : 32;
property int menuItemHeight : root.isMobile ? 48 : 32;
enter: Transition {
......@@ -35,7 +35,7 @@ Menu
list.currentItem.trackRating.text = rate
list.model.get(currentRow).stars = rate
}
if(!bae.isMobile())
if(!root.isMobile)
dismiss()
else close()
}
......@@ -47,7 +47,7 @@ Menu
list.currentItem.trackMood = color
list.model.get(currentRow).art = color
}
if(!bae.isMobile())
if(!root.isMobile)
dismiss()
else close()
}
......@@ -68,11 +68,11 @@ Menu
// Label
// {
// id: titleLabel
// visible: bae.isMobile()
// padding: bae.isMobile() ? 10 : 0
// visible: root.isMobile
// padding: root.isMobile ? 10 : 0
// font.bold: true
// width: parent.width
// height: bae.isMobile() ? menuItemHeight : 0
// height: root.isMobile ? menuItemHeight : 0
// horizontalAlignment: Qt.AlignHCenter
// elide: Text.ElideRight
// text: currentRow >= 0 ? list.model.get(currentRow).title : ""
......
......@@ -18,7 +18,7 @@ BabeGrid
if(hintSize>200)
200
else if (hintSize < 150)
bae.isMobile() && hintSize < 120 ? 120 : 150
root.isMobile && hintSize < 120 ? 120 : 150
else
hintSize
}
......@@ -46,7 +46,7 @@ BabeGrid
edge: Qt.BottomEdge
interactive: false
focus: true
modal: bae.isMobile()
modal: root.isMobile
dragMargin: 0
background: Rectangle
......
......@@ -17,7 +17,7 @@ BabeGrid
if(hintSize>200)
200
else if (hintSize<150)
bae.isMobile() && hintSize < 120 ? 120 : 150
root.isMobile && hintSize < 120 ? 120 : 150
else
hintSize
......@@ -45,7 +45,7 @@ BabeGrid
edge: Qt.BottomEdge
interactive: false
focus: true
modal: bae.isMobile()
modal: root.isMobile
dragMargin: 0
clip: true
......
......@@ -173,7 +173,7 @@ Item
drag.maximumY: columnWidth
// onClicked:
// {
// if(!bae.isMobile())
// if(!root.isMobile)
// cover.visible = !cover.visible
// }
......@@ -288,7 +288,7 @@ Item
{
id: menuBtn
BabeIcon {text: MdiFont.Icon.dotsVertical}
onClicked: bae.isMobile() ? playlistMenu.open() : playlistMenu.popup()
onClicked: root.isMobile ? playlistMenu.open() : playlistMenu.popup()
}
}
}
......@@ -471,6 +471,8 @@ Item
height: parent.height
quickPlayVisible: false
coverArtVisible: true
cacheBuffer: 64*30
Rectangle
{
anchors.fill: parent
......
......@@ -4,10 +4,10 @@ import "../utils/Help.js" as H
Menu
{
id: root
id: rootPlaylistMenu
x: parent.width / 2 - width / 2
y: parent.height / 2 - height / 2
modal: bae.isMobile()
modal: root.isMobile
signal clearOut()
signal clean()
......
......@@ -11,7 +11,7 @@ Drawer
id: settingsView
y: header.height
height: parent.height - header.height - footer.height
width: bae.isMobile() ? parent.width* 0.7 : parent.width* 0.5
width: root.isMobile ? parent.width* 0.7 : parent.width* 0.5
edge: Qt.RightEdge
interactive: true
focus: true
......@@ -151,7 +151,7 @@ Drawer
onClicked:
{
if(bae.isMobile())
if(root.isMobile)
{
folderPicker.open()
load(bae.homeDir())
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment