Commit f97109a8 authored by Camilo Higuita's avatar Camilo Higuita

more work on responsive design

parent e7162b27
......@@ -32,8 +32,10 @@ Kirigami.ApplicationWindow
signal missingAlert(var track)
readonly property bool isMobile: bae.isMobile()
readonly property int wideSize : bae.screenGeometry("width")*0.45
readonly property int wideSize : bae.screenGeometry("width")*0.5
readonly property int toolBarIconSize: isMobile ? 24 : 22
readonly property int rowHeight: isMobile ? 64 : 52
readonly property int rowHeightAlt: isMobile ? 48 : 32
property int columnWidth: Kirigami.Units.gridUnit * 20
property int coverSize: isMobile ? Math.sqrt(root.width*root.height)*0.4 : columnWidth * 0.65
......
......@@ -253,10 +253,9 @@ namespace BAE
const QString Version = "1.0";
const QString DBName = "collection.db";
const QStringList MoodColors = {"#F0FF01","#01FF5B","#3DAEFD","#B401FF","#E91E63"};
const QStringList formats {"*.mp4","*.mp3","*.wav","*.flac","*.ogg","*.m4a", "*.m3u"};
const QStringList formats {"*.mp4","*.mp3","*.wav","*.flac","*.ogg","*.m4a"};
inline QString fixTitle(const QString &title,const QString &s,const QString &e)
{
......
......@@ -6,14 +6,23 @@ Pane
{
id: gridPage
padding: 20
readonly property int screenSize : bae.screenGeometry("width")*bae.screenGeometry("height");
property int albumSize:
{
var hintSize = Math.sqrt(root.width*root.height)*0.25
if(!isMobile)
{
Math.sqrt(screenSize)*0.15
}else
{
if(hintSize > 150)
150
else
hintSize
var hintSize = Math.sqrt(root.width*root.height)*0.25
if(hintSize > 150)
150
else
hintSize
}
}
property int albumSpacing: 20
property int albumRadius : 0
......@@ -66,7 +75,6 @@ Pane
width: Math.min(model.count, Math.floor(parent.width/cellWidth))*cellWidth
height: parent.height
anchors.horizontalCenter: parent.horizontalCenter
cellWidth: albumSize +(albumSize*0.2)
cellHeight: albumSize+(albumSize*0.8)
......@@ -125,7 +133,7 @@ Pane
}
}
ScrollBar.vertical:BabeScrollBar {}
ScrollBar.vertical:BabeScrollBar { visible: true }
}
}
......@@ -154,7 +154,6 @@ ListView
iconName: /*"application-menu"*/ "overflow-menu"
onClicked: {}
}
}
}
......
......@@ -5,10 +5,7 @@ import "../../view_models"
ItemDelegate
{
id: delegateRoot
readonly property int rowHeight: isMobile ? 64 : 52
readonly property int rowHeightAlt: isMobile ? 48 : 32
id: delegateRoot
width: parent.width
height: sameAlbum ? rowHeightAlt : rowHeight
......
......@@ -13,16 +13,16 @@ BabeGrid
id: albumsViewGrid
visible: true
// property int hintSize : Math.sqrt(root.width*root.height)*0.25
// albumSize:
// {
// if(hintSize > 150)
// 150
// else if (hintSize < 100)
// root.isMobile && hintSize < 100 ? 100 : 130
// else
// hintSize
// }
// property int hintSize : Math.sqrt(root.width*root.height)*0.25
// albumSize:
// {
// if(hintSize > 150)
// 150
// else if (hintSize < 100)
// root.isMobile && hintSize < 100 ? 100 : 130
// else
// hintSize
// }
signal rowClicked(var track)
signal playAlbum(var tracks)
......@@ -30,10 +30,10 @@ BabeGrid
signal queueTrack(var track)
signal appendAlbum(var tracks)
transform: Translate
{
y: (drawer.position * albumsViewGrid.height * 0.33)*-1
}
// transform: Translate
// {
// y: (drawer.height)*-1
// }
onBgClicked: if(drawer.visible) drawer.close()
onFocusChanged: drawer.close()
......@@ -42,7 +42,20 @@ BabeGrid
{
id: drawer
height: parent.height * 0.4
height:
{
var customHeight = (drawerList.count*rowHeight)+48
if(customHeight > parent.height)
parent.height-root.header.height
else
{
if(customHeight < parent.height*0.4)
parent.height*0.4
else
customHeight
}
}
x: pageStack.wideMode ? columnWidth+1 : 0
width: pageStack.wideMode ? albumsViewGrid.width-1 : albumsViewGrid.width
edge: Qt.BottomEdge
......
......@@ -12,8 +12,8 @@ BabeGrid
{
id: artistsViewGrid
visible: true
// albumCardVisible: false
// albumRadius: Math.min(albumSize, albumSize)
// albumCardVisible: false
// albumRadius: Math.min(albumSize, albumSize)
signal rowClicked(var track)
signal playAlbum(var tracks)
......@@ -21,10 +21,10 @@ BabeGrid
signal queueTrack(var track)
signal appendAlbum(var tracks)
// transform: Translate
// {
// y: (drawer.position * artistsViewGrid.height * 0.33)*-1
// }
// transform: Translate
// {
// y: (drawer.position * artistsViewGrid.height)*-1
// }
onBgClicked: if(drawer.visible) drawer.close()
onFocusChanged: drawer.close()
......@@ -32,7 +32,20 @@ BabeGrid
Drawer
{
id: drawer
height: parent.height * 0.4
height:
{
var customHeight = (drawerList.count*rowHeight)+48
if(customHeight > parent.height)
parent.height-root.header.height
else
{
if(customHeight < parent.height*0.4)
parent.height*0.4
else
customHeight
}
}
x: pageStack.wideMode ? columnWidth+1 : 0
width: pageStack.wideMode ? artistsViewGrid.width-1 : artistsViewGrid.width
edge: Qt.BottomEdge
......
......@@ -98,46 +98,16 @@ Item
MouseArea
{
anchors.fill: parent
onDoubleClicked:
{
// var query = Q.GET.albumTracks_.arg(currentTrack.album)
// query = query.arg(currentTrack.artist)
// var tracks = bae.get(query)
// coverDoubleClicked(tracks)
onDoubleClicked: gomini()
// {
// var query = Q.GET.albumTracks_.arg(currentTrack.album)
// query = query.arg(currentTrack.artist)
if(!isMobile)
{
if(root.header.visible)
{
root.maximumWidth = columnWidth
root.minimumWidth = artwork.width
root.maximumHeight = mainPlaylistItem.y
root.minimumHeight = mainPlaylistItem.y
root.header.visible = false
root.footer.visible = false
infoBtn.visible = false
menuBtn.visible = false
}else
{
cover.y = 0
root.maximumWidth = bae.screenGeometry("width")
root.minimumWidth = columnWidth
root.maximumHeight = bae.screenGeometry("height")
root.minimumHeight = columnWidth
// var tracks = bae.get(query)
// coverDoubleClicked(tracks)
root.width = columnWidth
root.height = 700
root.header.visible = true
root.footer.visible = true
infoBtn.visible = true
menuBtn.visible = true
}
}
}
// }
onPressAndHold:
{
......@@ -587,4 +557,37 @@ Item
}
}
}
function gomini()
{
if(!isMobile)
{
if(root.header.visible)
{
root.maximumWidth = columnWidth
root.minimumWidth = columnWidth
root.maximumHeight = mainPlaylistItem.y
root.minimumHeight = mainPlaylistItem.y
root.header.visible = false
root.footer.visible = false
infoBtn.visible = false
menuBtn.visible = false
}else
{
cover.y = 0
root.maximumWidth = bae.screenGeometry("width")
root.minimumWidth = columnWidth
root.maximumHeight = bae.screenGeometry("height")
root.minimumHeight = columnWidth
root.width = columnWidth
root.height = 700
root.header.visible = true
root.footer.visible = true
infoBtn.visible = true
menuBtn.visible = true
}
}
}
}
......@@ -11,7 +11,7 @@ Drawer
id: settingsView
y: header.height
height: parent.height - header.height - footer.height
width: root.pageStack.wideMode ? parent.width* 0.7 : parent.width
width: root.pageStack.wideMode ? views.width -1: root.width
edge: Qt.RightEdge
interactive: true
focus: true
......
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