Commit f667fbc5 authored by camilo higuita's avatar camilo higuita

using latest mauikit

parent 30731fe0
......@@ -311,7 +311,6 @@ Maui.ApplicationWindow
leftContent: ToolButton
{
icon.name: "headphones"
visible: _drawer.modal
checked: _drawer.visible
icon.color: _drawer.visible ? babeColor : Kirigami.Theme.textColor
onClicked: _drawer.visible = !_drawer.visible
......
......@@ -4,25 +4,22 @@ import QtQuick.Controls 2.2
import QtQuick.Layouts 1.3
import AlbumsList 1.0
import org.kde.kirigami 2.7 as Kirigami
import org.kde.mauikit 1.0 as Maui
ItemDelegate
Maui.GridItemDelegate
{
id: babeAlbumRoot
property int itemWidth : albumSize
property int itemHeight: albumSize
property int albumSize : iconSizes.huge
property int albumSize : Maui.Style.iconSizes.huge
property int albumRadius : 0
property bool albumCard : true
property string fillColor : Qt.darker(Kirigami.Theme.backgroundColor, 1.1)
property bool hide : false
property bool showLabels : true
property bool showIndicator : false
property bool isCurrentListItem : ListView.isCurrentItem
property bool hideRepeated : false
property bool increaseCurrentItem : false
property color labelColor : GridView.isCurrentItem || hovered || down ? Kirigami.Theme.highlightColor : Kirigami.Theme.textColor
// height: typeof album === 'undefined' ? parseInt(albumSize+(albumSize*0.3)) : parseInt(albumSize+(albumSize*0.4))
readonly property bool sameAlbum :
......@@ -39,30 +36,18 @@ ItemDelegate
}else false
}
height: visible ? itemHeight : 0
width : visible ? itemWidth : 0
visible: !sameAlbum
hoverEnabled: !isMobile
// spacing: 0
background: Rectangle
{
color: "transparent"
}
ColumnLayout
{
anchors.fill: parent
anchors.centerIn: parent
spacing: 0
Item
{
Layout.alignment: Qt.AlignCenter
Layout.fillHeight: true
Layout.fillWidth: true
Layout.alignment: Qt.AlignHCenter
Layout.maximumHeight: albumSize
Layout.minimumHeight: albumSize
Layout.preferredWidth: albumSize
DropShadow
{
......@@ -92,7 +77,7 @@ ItemDelegate
{
id: img
anchors.centerIn: parent
width: increaseCurrentItem ? albumSize * (isCurrentListItem ? 1 : 0.85) : albumSize
width: albumSize
height: width
sourceSize.width: width
sourceSize.height: height
......@@ -100,7 +85,6 @@ ItemDelegate
fillMode: Image.PreserveAspectFit
smooth: true
asynchronous: true
source:
{
if(artwork)
......@@ -133,7 +117,7 @@ ItemDelegate
height: img.height * 0.1
width: img.width * 0.1
anchors.bottom: parent.bottom
anchors.bottomMargin: space.big
anchors.bottomMargin: Maui.Style.space.big
anchors.horizontalCenter:parent.horizontalCenter
radius: Math.min(width, height)
color: "#f84172"
......@@ -149,60 +133,33 @@ ItemDelegate
}
}
Item
Label
{
visible: showLabels
Layout.fillWidth: true
Layout.fillHeight: true
Layout.alignment: Qt.AlignHCenter
Layout.margins: 0
ColumnLayout
{
anchors.fill: parent
// spacing: space.tiny
Item
{
Layout.fillWidth: true
Layout.alignment: Qt.AlignHCenter
// Layout.margins: space.medium
Label
{
width: parent.width * 0.8
anchors.centerIn: parent
text: list.query === Albums.ALBUMS ? model.album : model.artist
visible: true
horizontalAlignment: Qt.AlignHCenter
elide: Text.ElideRight
font.pointSize: fontSizes.default
font.bold: true
font.weight: Font.Bold
color: labelColor
}
}
Item
{
Layout.fillWidth: true
Layout.alignment: Qt.AlignTop
text: list.query === Albums.ALBUMS ? model.album : model.artist
visible: showLabels
horizontalAlignment: Qt.AlignHCenter
elide: Text.ElideRight
font.pointSize: Maui.Style.fontSizes.default
font.bold: true
font.weight: Font.Bold
color: labelColor
wrapMode: Text.NoWrap
}
Label
{
width: parent.width*0.8
anchors.centerIn: parent
text: list.query === Albums.ALBUMS ? model.artist : undefined
visible: text
horizontalAlignment: Qt.AlignHCenter
elide: Text.ElideRight
font.pointSize: fontSizes.medium
color: labelColor
}
}
}
Label
{
Layout.fillWidth: true
Layout.fillHeight: true
text: list.query === Albums.ALBUMS ? model.artist : undefined
visible: showLabels && text
horizontalAlignment: Qt.AlignHCenter
elide: Text.ElideRight
font.pointSize: Maui.Style.fontSizes.medium
color: labelColor
wrapMode: Text.NoWrap
}
}
}
......@@ -13,8 +13,7 @@ Maui.Page
// readonly property int screenSize : bae.screenGeometry("width")*bae.screenGeometry("height");
// property int hintSize : Math.sqrt(root.width*root.height)*0.3
property int albumCoverSize: Math.min(120, width * 0.3)
readonly property int albumSpacing: albumCoverSize * 0.3 + space.small
property int albumCoverSize: Math.min(180, width * 0.4)
property int albumCoverRadius : Maui.Style.radiusV
property bool albumCardVisible : true
......@@ -53,14 +52,9 @@ Maui.Page
onAreaClicked: bgClicked()
adaptContent: true
anchors.fill: parent
anchors.topMargin: Maui.Style.space.big
topMargin: Maui.Style.space.big
itemSize: albumCoverSize
spacing: albumSpacing
cellWidth: albumCoverSize + spacing
cellHeight: albumCoverSize + spacing*2
holder.visible: count === 0
model: _albumsModel
......@@ -68,12 +62,13 @@ Maui.Page
{
id: albumDelegate
albumSize : grid.itemSize
albumSize : height * 0.6
albumRadius: albumCoverRadius
albumCard: albumCardVisible
padding: Maui.Style.space.small
height: grid.cellHeight
width: grid.cellWidth
height: width
Connections
{
......
This diff is collapsed.
......@@ -18,7 +18,7 @@ Item
anchors.margins: space.big
anchors.fill: parent
showEmblem: false
model: ListModel {}
onItemClicked:
{
var item = browser.model.get(index)
......
......@@ -2,6 +2,7 @@ import QtQuick.Controls 2.2
import QtQuick 2.9
import QtQuick.Layouts 1.3
import org.kde.kirigami 2.7 as Kirigami
import org.kde.mauikit 1.0 as Maui
import "../../view_models/BabeGrid"
import "../../utils/Player.js" as Player
......@@ -41,8 +42,8 @@ ListView
columns: 2
rows: 2
rowSpacing: space.tiny
columnSpacing: space.big
rowSpacing: Maui.Style.space.tiny
columnSpacing: Maui.Style.space.big
BabeAlbum
{
......@@ -50,12 +51,12 @@ ListView
Layout.row: 1
Layout.rowSpan: 2
Layout.column: 1
Layout.preferredWidth: iconSizes.big + space.big
Layout.fillHeight: true
Layout.preferredWidth: albumSize
Layout.preferredHeight: albumSize
Layout.alignment: Qt.AlignCenter
albumSize : iconSizes.big + space.big
albumRadius : radiusV
albumSize : Maui.Style.iconSizes.big + Maui.Style.space.big
albumRadius : Maui.Style.radiusV
showLabels: false
showIndicator: false
hideRepeated: false
......@@ -80,7 +81,7 @@ ListView
Layout.fillHeight: true
text: model.title
color: Kirigami.Theme.textColor
font.pointSize: fontSizes.default
font.pointSize: Maui.Style.fontSizes.default
verticalAlignment: Qt.AlignBottom
clip: true
wrapMode: Text.WrapAtWordBoundaryOrAnywhere
......@@ -94,7 +95,7 @@ ListView
Layout.fillWidth: true
Layout.fillHeight: true
text: model.artist + " | " + model.album
font.pointSize: fontSizes.small
font.pointSize: Maui.Style.fontSizes.small
verticalAlignment: Qt.AlignTop
clip: true
color: Kirigami.Theme.textColor
......
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