Commit 40df719d authored by Camilo Higuita's avatar Camilo Higuita

more work for plasma mobile scaling. using kirigami units

parent 99d8d18e
......@@ -88,12 +88,12 @@ Kirigami.ApplicationWindow {
property int toolBarIconSize: bae.loadSetting("ICON_SIZE", "BABE",
iconSizes.medium)
property int toolBarHeight: isMobile ? 48 : Kirigami.Units.iconSizes.smallMedium + Kirigami.Units.smallSpacing*2
property int toolBarHeight: Kirigami.Units.iconSizes.medium + (Kirigami.Settings.isMobile ? Kirigami.Units.smallSpacing : Kirigami.Units.largeSpacing)
property int miniArtSize: iconSizes.large
property int columnWidth: Kirigami.Units.gridUnit * 17
property int coverSize: isAndroid ? Math.sqrt(root.width * root.height) * 0.4 :
columnWidth * (isMobile ? 0.5 : 0.6)
columnWidth * (isMobile ? 0.7 : 0.6)
/***************************************************/
......@@ -301,6 +301,9 @@ Kirigami.ApplicationWindow {
{
id: toolbar
width: root.width
height: toolBarHeight
visible: true
currentIndex: currentView
onSettingsViewClicked: settingsDrawer.visible ? settingsDrawer.close(
......@@ -342,8 +345,10 @@ Kirigami.ApplicationWindow {
id: playbackControls
position: ToolBar.Footer
height: visible ? headerHeight : 0
width: root.width
height: toolBarHeight
visible: true
focus: true
leftPadding: 0
......@@ -437,10 +442,10 @@ Kirigami.ApplicationWindow {
Item {
Layout.alignment: Qt.AlignLeft
Layout.fillHeight: true
Layout.maximumWidth: miniArtwork.visible ? headerHeight : 0
Layout.minimumWidth: miniArtwork.visible ? headerHeight : 0
Layout.minimumHeight: miniArtwork.visible ? headerHeight : 0
Layout.maximumHeight: miniArtwork.visible ? headerHeight : 0
Layout.maximumWidth: miniArtwork.visible ? toolBarHeight : 0
Layout.minimumWidth: miniArtwork.visible ? toolBarHeight : 0
Layout.minimumHeight: miniArtwork.visible ? toolBarHeight : 0
Layout.maximumHeight: miniArtwork.visible ? toolBarHeight : 0
Layout.row: 1
Layout.rowSpan: 2
Layout.column: 1
......@@ -538,7 +543,7 @@ Kirigami.ApplicationWindow {
verticalAlignment: Qt.AlignVCenter
text: progressTimeLabel + " / " + (currentTrack ? (currentTrack.title ? currentTrack.title + " - " + currentTrack.artist : "--- - " + currentTrack.artist) : "") + " / " + durationTimeLabel
color: darktextColor
font.pointSize: fontSizes.tiny
font.pointSize: fontSizes.small
elide: Text.ElideRight
}
}
......
......@@ -271,19 +271,11 @@ Page
}
}
Kirigami.Separator
{
visible: !isMobile
Layout.fillWidth: true
width: parent.width
height: 1
}
ToolBar
{
id: searchBox
Layout.fillWidth: true
position: ToolBar.Footer
position: ToolBar.Footer
RowLayout
{
......
......@@ -14,27 +14,27 @@ ToolButton
property bool anim : false
// icon.name: isAndroid ? "" : babeButton.iconName
// icon.width: isAndroid ? 0 : babeButton.iconSize
// icon.height: isAndroid ? 0 : babeButton.iconSize
// icon.color: isAndroid ? "transparent" : (iconColor || defaultColor)
icon.name: isAndroid ? "" : babeButton.iconName
icon.width: isAndroid ? 0 : babeButton.iconSize
icon.height: isAndroid ? 0 : babeButton.iconSize
icon.color: isAndroid ? "transparent" : (down ? babeColor : (iconColor || defaultColor))
onClicked: if(anim) animIcon.running = true
flat: true
highlighted: false
Kirigami.Icon
{
id: kirigamIcon
anchors.centerIn: parent
width: iconSize
height: iconSize
visible: !isAndroid
source: isAndroid ? "" : iconName
isMask: false
color: iconColor || defaultColor
}
// Kirigami.Icon
// {
// id: kirigamIcon
// anchors.centerIn: parent
// width: iconSize
// height: iconSize
// visible: !isAndroid
// source: isAndroid ? "" : iconName
// isMask: false
// color: iconColor || defaultColor
// }
BabeIcon
{
......@@ -59,5 +59,3 @@ ToolButton
}
}
}
......@@ -13,8 +13,8 @@ Dialog
modal: true
margins: 1
padding: 2
margins: 0
padding: space.tiny
Material.accent: babeColor
......
......@@ -5,13 +5,13 @@ import ".."
Pane
{
id: gridPage
padding: 20
padding: space.big
// readonly property int screenSize : bae.screenGeometry("width")*bae.screenGeometry("height");
property int hintSize : Math.sqrt(root.width*root.height)*0.3
// property int hintSize : Math.sqrt(root.width*root.height)*0.3
property int albumCoverSize: isMobile ? iconSizes.huge : iconSizes.enormous
readonly property int albumSpacing: albumCoverSize*0.5 + space.big
property int albumCoverSize: isMobile ? iconSizes.enormous : iconSizes.enormous
readonly property int albumSpacing: albumCoverSize*0.5 + (isMobile ? space.small : space.big)
property int albumCoverRadius : albumCoverSize*0.05
property bool albumCardVisible : true
......@@ -116,5 +116,4 @@ Pane
// grid.cellHeight = size
}
}
}
......@@ -12,8 +12,8 @@ Menu
focus: true
parent: ApplicationWindow.overlay
margins: 1
padding: 2
margins: space.tiny
padding: space.tiny
// enter: Transition
// {
......
......@@ -17,7 +17,7 @@ BabeDialog
ColumnLayout
{
spacing: 20
spacing: space.small
anchors.fill: parent
BabeList
......@@ -54,11 +54,12 @@ BabeDialog
RowLayout
{
Layout.fillWidth: true
Layout.margins: contentMargins
Layout.margins: space.small
TextField
{
Layout.fillWidth: true
width: parent.width
id: newPlaylistField
color: textColor
placeholderText: qsTr("New playlist")
......
......@@ -10,8 +10,10 @@ ItemDelegate
{
id: delegateRoot
readonly property int altHeight : rowHeight * 1.2
width: parent.width
height: sameAlbum ? rowHeight : rowHeight*1.2
height: sameAlbum ? rowHeight : altHeight
clip: true
autoExclusive: true
......@@ -77,7 +79,7 @@ ItemDelegate
pressAndHoldInterval: 3000
onClicked:
{
if(!root.isMobile && mouse.button === Qt.RightButton)
if(!isMobile && mouse.button === Qt.RightButton)
rightClicked()
}
// onPressAndHold:
......@@ -97,14 +99,13 @@ ItemDelegate
visible: coverArt
Layout.fillHeight: true
Layout.alignment: Qt.AlignLeft
width: sameAlbum ? rowHeight : parent.height
width: altHeight
height: parent.height
ToolButton
{
visible: !sameAlbum
height: parent.height
width: parent.height
anchors.verticalCenter: parent.verticalCenter
anchors.fill: parent
Image
{
......@@ -128,7 +129,7 @@ ItemDelegate
onDoubleClicked: artworkCoverDoubleClicked()
onClicked: artworkCoverClicked()
onPressAndHold: if(root.isMobile) artworkCoverDoubleClicked()
onPressAndHold: if(isMobile) artworkCoverDoubleClicked()
}
}
......@@ -136,8 +137,9 @@ ItemDelegate
{
visible: quickPlay
Layout.fillHeight: true
width: sameAlbum ? rowHeight : parent.height
Layout.margins: 0
width: rowHeight
height: parent.height
Layout.leftMargin: space.small
BabeButton
{
......@@ -156,7 +158,7 @@ ItemDelegate
Layout.fillWidth: true
Layout.alignment: Qt.AlignLeft
Layout.margins: space.tiny
Layout.leftMargin: coverArt ? contentMargins : 0
Layout.leftMargin: space.small
anchors.verticalCenter: parent.verticalCenter
GridLayout
......
......@@ -119,11 +119,11 @@ BabeMenu
Label
{
id: titleLabel
visible: root.isMobile
padding: root.isMobile ? contentMargins : 0
visible: isAndroid
padding: isAndroid ? space.small : 0
font.bold: true
width: parent.width
height: root.isMobile ? iconSizes.medium : 0
height: isAndroid ? iconSizes.medium : 0
horizontalAlignment: Qt.AlignHCenter
elide: Text.ElideRight
text: list.currentIndex >= 0 ? list.model.get(list.currentIndex).title : ""
......@@ -163,11 +163,11 @@ BabeMenu
BabeMenuItem
{
text: isMobile ? qsTr("Open with...") : qsTr("Show in folder...")
text: isAndroid ? qsTr("Open with...") : qsTr("Show in folder...")
onTriggered:
{
!isMobile ?
!isAndroid ?
bae.showFolder(list.model.get(list.currentIndex).url) :
bae.openFile(list.model.get(list.currentIndex).url)
close()
......@@ -211,7 +211,7 @@ BabeMenu
{
id: starsRow
width: parent.width
height: toolBarIconSize
height: iconSizes.small
RowLayout
{
......@@ -222,6 +222,7 @@ BabeMenu
Layout.fillWidth: true
Layout.fillHeight: true
iconName: starIcon
iconSize: iconSizes.small
iconColor: rate >= 1 ? starColor :starReg
onClicked: rateIt(1)
}
......@@ -230,7 +231,7 @@ BabeMenu
{
Layout.fillWidth: true
Layout.fillHeight: true
iconSize: iconSizes.small
iconName: starIcon
iconColor: rate >= 2 ? starColor :starReg
onClicked: rateIt(2)
......@@ -240,7 +241,7 @@ BabeMenu
{
Layout.fillWidth: true
Layout.fillHeight: true
iconSize: iconSizes.small
iconName: starIcon
iconColor: rate >= 3 ? starColor :starReg
......@@ -251,7 +252,7 @@ BabeMenu
{
Layout.fillWidth: true
Layout.fillHeight: true
iconSize: iconSizes.small
iconName: starIcon
iconColor: rate >= 4 ? starColor :starReg
......@@ -262,7 +263,7 @@ BabeMenu
{
Layout.fillWidth: true
Layout.fillHeight: true
iconSize: iconSizes.small
iconName: starIcon
iconColor: rate >= 5 ? starColor :starReg
......@@ -276,6 +277,7 @@ BabeMenu
{
id: colorsRow
width: parent.width
height: iconSizes.small
ColorTagsBar
{
......
......@@ -4,8 +4,8 @@ import QtQuick.Controls 2.2
Item
{
property int recSize : 16
readonly property int recRadius : 4
property int recSize : iconSizes.small
readonly property int recRadius : recSize*0.05
signal colorClicked(string color)
RowLayout
......
......@@ -25,7 +25,7 @@ ToolBar
signal searchViewClicked()
signal settingsViewClicked()
width: parent.width
id: babeBar
// Rectangle
......
......@@ -95,44 +95,25 @@ Page
headerBarVisible: true
headerBarExit: true
headerBarExitIcon: "edit-clear"
holder.message: "No search results!"
holder.message: "<h2>No search results!</h2><p>Try with another query</p>"
coverArtVisible: true
trackDuration: true
trackRating: true
onExit: clearSearch()
}
Kirigami.Separator
{
visible: !isMobile
Layout.fillWidth: true
width: parent.width
height: 1
}
ToolBar
{
id: searchBox
Layout.fillWidth: true
// width: parent.width
// height: toolBarHeight
position: ToolBar.Footer
Rectangle
{
anchors.fill: parent
z: -999
color: backgroundColor
}
RowLayout
{
anchors.fill: parent
BabeButton
{
Layout.leftMargin: contentMargins
visible: true
iconName: "view-filter"
iconColor: autoSuggestions ? babeColor : textColor
......@@ -168,7 +149,6 @@ Page
BabeButton
{
Layout.rightMargin: contentMargins
iconName: "edit-clear"
onClicked: searchInput.clear()
}
......
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