Commit 34d34429 authored by Camilo Higuita's avatar Camilo Higuita

migrate to mauikit even more

parent d9d4bb6b
......@@ -475,6 +475,11 @@ Maui.ApplicationWindow
z: pageStack.z +1
}
Maui.ShareDialog
{
id: shareDialog
}
// Item
// {
// Layout.alignment: Qt.AlignCenter
......@@ -920,7 +925,7 @@ Maui.ApplicationWindow
{
var query = Q.GET.albumTracks_.arg(album)
query = query.arg(artist)
albumsView.table.headerBarTitle = album
albumsView.table.headBarTitle = album
albumsView.populateTable(query)
}
......@@ -965,7 +970,7 @@ Maui.ApplicationWindow
onAlbumCoverClicked:
{
var query = Q.GET.artistTracks_.arg(artist)
artistsView.table.headerBarTitle = artist
artistsView.table.headBarTitle = artist
artistsView.populateTable(query)
}
......
......@@ -14,7 +14,6 @@
<file>view_models/BabeHolder.qml</file>
<file>db/Queries.js</file>
<file>utils/Help.js</file>
<file>utils/BabeIcon.qml</file>
<file>view_models/BabeScrollBar.qml</file>
<file>assets/bars.gif</file>
<file>view_models/BabeGrid/BabeAlbum.qml</file>
......@@ -32,7 +31,6 @@
<file>widgets/InfoView/LyricsView.qml</file>
<file>widgets/PlaylistsView/PlaylistsViewModel.qml</file>
<file>widgets/PlaylistsView/AddPlaylistDialog.qml</file>
<file>view_models/BabeButton.qml</file>
<file>utils/Props.js</file>
<file>assets/face-sleeping.svg</file>
<file>assets/face-laughing.svg</file>
......
......@@ -2,7 +2,7 @@ import QtQuick 2.9
import QtQuick.Layouts 1.3
import QtQuick.Controls 2.2
import org.kde.kirigami 2.2 as Kirigami
import org.kde.maui 1.0 as Maui
import "../../utils"
import "../../widgets/PlaylistsView"
import "../../view_models"
......@@ -14,17 +14,17 @@ BabeList
{
id: linkingListRoot
headerBarExit: false
headerBarTitle: isLinked ?link.getIp() : qsTr("Disconnected")
headBarExit: false
headBarTitle: isLinked ?link.getIp() : qsTr("Disconnected")
headerBarLeft: BabeButton
headBar.leftContent: Maui.ToolButton
{
anim : true
iconName : "view-refresh"
onClicked : refreshPlaylists()
}
headerBarRight: BabeButton
headBar.rightContent: Maui.ToolButton
{
id: menuBtn
iconName: "application-menu"
......
......@@ -9,6 +9,7 @@ import "../../db/Queries.js" as Q
import Link.Codes 1.0
import org.kde.kirigami 2.2 as Kirigami
import org.kde.maui 1.0 as Maui
ColumnLayout
{
......@@ -34,7 +35,6 @@ ColumnLayout
defaultColumnWidth: Kirigami.Units.gridUnit * 15
interactive: false
LinkingDialog
{
id: linkingConf
......@@ -63,7 +63,7 @@ ColumnLayout
{
id: linkingFilter
headerBarExitIcon: "go-previous"
headBarExitIcon: "go-previous"
model : ListModel {}
delegate: BabeDelegate
......@@ -73,7 +73,7 @@ ColumnLayout
Connections
{
target: delegate
onClicked: populateFromFilter(index, linkingFilter.headerBarTitle)
onClicked: populateFromFilter(index, linkingFilter.headBarTitle)
}
}
......@@ -98,10 +98,10 @@ ColumnLayout
trackRating: true
trackDuration: false
allowMenu: false
headerBarVisible: true
headerBarExitIcon: "go-previous"
headerBarExit: !linkingPage.wideMode
headerBarTitle: linkingPage.wideMode ? "" : linkingModel.model.get(linkingModel.currentIndex).playlist
headBarVisible: true
headBarExitIcon: "go-previous"
headBarExit: !linkingPage.wideMode
headBarTitle: linkingPage.wideMode ? "" : linkingModel.model.get(linkingModel.currentIndex).playlist
onExit: if(!linkingPage.wideMode)
linkingPage.currentIndex = 0
......@@ -188,7 +188,7 @@ ColumnLayout
}
BabeButton
Maui.ToolButton
{
Layout.rightMargin: contentMargins
iconName: "edit-clear"
......@@ -265,7 +265,7 @@ ColumnLayout
link.ask(code, query)
linkingFilter.clearTable()
linkingFilter.headerBarTitle = title
linkingFilter.headBarTitle = title
}
function parseResponse(res)
......@@ -330,9 +330,9 @@ ColumnLayout
function runSearch(searchTxt)
{
if(searchTxt)
if(searchTxt !== filterList.headerBarTitle)
if(searchTxt !== filterList.headBarTitle)
{
filterList.headerBarTitle = searchTxt
filterList.headBarTitle = searchTxt
link.ask(LINK.SEARCHFOR, searchTxt)
}
}
......@@ -341,7 +341,7 @@ ColumnLayout
{
searchInput.clear()
youtubeTable.clearTable()
youtubeTable.headerBarTitle = ""
youtubeTable.headBarTitle = ""
searchRes = []
}
......
......@@ -4,11 +4,10 @@ import QtQuick.Layouts 1.3
import "../../../view_models"
import "../../../view_models/BabeTable"
import org.kde.kirigami 2.2 as Kirigami
import org.kde.maui 1.0 as Maui
Page
{
Loader
{
id: loginLoader
......@@ -25,8 +24,8 @@ Page
Layout.fillWidth: true
Layout.fillHeight: true
headerBarExit: false
headerBarLeft: BabeButton
headBarExit: false
headBar.leftContent: Maui.ToolButton
{
iconName: "internet-services"
onClicked:if(!isAndroid)
......@@ -68,7 +67,7 @@ Page
}
BabeButton
Maui.ToolButton
{
Layout.rightMargin: contentMargins
iconName: "edit-clear"
......
......@@ -4,7 +4,7 @@ import QtQuick.Layouts 1.3
import "../../view_models"
import "../../view_models/BabeTable"
import org.kde.kirigami 2.2 as Kirigami
import org.kde.maui 1.0 as Maui
Page
{
......@@ -62,9 +62,9 @@ Page
function runSearch(searchTxt)
{
if(searchTxt)
if(searchTxt !== youtubeTable.headerBarTitle)
if(searchTxt !== youtubeTable.headBarTitle)
{
youtubeTable.headerBarTitle = searchTxt
youtubeTable.headBarTitle = searchTxt
youtube.getQuery(searchTxt, bae.loadSetting("YOUTUBELIMIT", "BABE", 25))
}
}
......@@ -73,7 +73,7 @@ Page
{
searchInput.clear()
youtubeTable.clearTable()
youtubeTable.headerBarTitle = ""
youtubeTable.headBarTitle = ""
searchRes = []
}
......@@ -238,10 +238,10 @@ Page
Layout.fillHeight: true
Layout.fillWidth: true
trackNumberVisible: false
headerBarVisible: true
headerBarExit: true
headerBarExitIcon: "edit-clear"
headerBarTitle: "YouTube"
headBarVisible: true
headBarExit: true
headBarExitIcon: "edit-clear"
headBarTitle: "YouTube"
holder.message: "No YouTube results!"
coverArtVisible: true
trackDuration: true
......@@ -254,7 +254,7 @@ Page
playAllBtn.visible: false
menuBtn.visible: false
headerBarRight: BabeButton
headBar.rightContent: Maui.ToolButton
{
id: menuBtn
iconName: "application-menu"
......@@ -300,7 +300,7 @@ Page
}
BabeButton
Maui.ToolButton
{
Layout.rightMargin: contentMargins
iconName: "edit-clear"
......
......@@ -4,6 +4,7 @@ import QtQuick.Layouts 1.3
import "../../view_models"
import org.kde.kirigami 2.2 as Kirigami
import org.kde.maui 1.0 as Maui
Page
{
......@@ -30,7 +31,7 @@ Page
id: headerBar
anchors.fill: parent
BabeButton
Maui.ToolButton
{
Layout.alignment : Qt.AlignLeft
Layout.leftMargin: contentMargins
......@@ -53,7 +54,7 @@ Page
verticalAlignment : Text.AlignVCenter
}
BabeButton
Maui.ToolButton
{
Layout.alignment : Qt.AlignLeft
width: rowHeight
......@@ -61,7 +62,7 @@ Page
onClicked: webView.url = currentYt.url.replace("embed/", "watch?v=")
}
BabeButton
Maui.ToolButton
{
Layout.alignment : Qt.AlignLeft
width: rowHeight
......@@ -70,7 +71,7 @@ Page
}
BabeButton
Maui.ToolButton
{
Layout.alignment : Qt.AlignLeft
Layout.rightMargin: contentMargins
......
import QtQuick 2.9
import "../utils/Icons.js" as MdiFont
Text
{
id: babeIcon
property string iconColor: foregroundColor
property int iconSize
property string icon
readonly property string defaultColor : iconColor
text: MdiFont.Babe[babeIcon.icon]
font.family: "Material Design Icons"
font.pixelSize: babeIcon.iconSize
anchors.centerIn: parent
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
color: babeIcon.iconColor
}
import QtQuick 2.9
import QtQuick.Controls 2.2
import "../utils"
import org.kde.kirigami 2.2 as Kirigami
import QtQuick.Controls.impl 2.3
ToolButton
{
id: babeButton
property string iconName
property int iconSize : 22
property color iconColor: textColor
readonly property string defaultColor : textColor
property bool anim : false
spacing: space.small
icon.name: babeButton.iconName
icon.width: babeButton.iconSize
icon.height: babeButton.iconSize
icon.color: down ? babeColor : (iconColor || defaultColor)
onClicked: if(anim) animIcon.running = true
flat: true
highlighted: false
contentItem: IconLabel
{
spacing: babeButton.spacing
mirrored: babeButton.mirrored
display: babeButton.display
icon: babeButton.icon
text: babeButton.text
font: babeButton.font
color: iconColor
}
SequentialAnimation
{
id: animIcon
PropertyAnimation
{
target: babeButton
property: "icon.color"
easing.type: Easing.InOutQuad
from: babeColor
to: iconColor
duration: 500
}
}
}
......@@ -3,8 +3,9 @@ import QtQuick.Controls 2.2
import QtQuick.Layouts 1.3
import org.kde.kirigami 2.2 as Kirigami
import QtQuick.Controls.Material 2.1
import org.kde.maui 1.0 as Maui
Page
Maui.Page
{
id: babeListRoot
......@@ -16,147 +17,70 @@ Page
property alias currentItem : babeList.currentItem
property alias holder : holder
property alias section : babeList.section
property alias headerBarRight : headerBarActionsRight.children
property alias headerBarLeft : headerBarActionsLeft.children
property bool headerBarVisible: true
property string headerBarTitle
property bool headerBarExit : true
property string headerBarExitIcon : "window-close"
property color headerBarColor : backgroundColor
property color labelColor : textColor
property bool wasPulled : false
signal pulled()
signal exit()
focus: true
margins: 0
function clearTable()
{
list.model.clear()
}
BabeHolder
Maui.Holder
{
id: holder
anchors.fill: parent
visible: babeList.count === 0
color : labelColor
focus: true
}
ColumnLayout
ListView
{
id: babeList
anchors.fill: parent
spacing: 0
clip: true
highlight: Rectangle
{
width: babeList.width
height: babeList.currentItem.height
color: highlightColor
}
ToolBar
focus: true
interactive: true
highlightFollowsCurrentItem: true
highlightMoveDuration: 0
keyNavigationWraps: true
keyNavigationEnabled : true
Keys.onUpPressed: decrementCurrentIndex()
Keys.onDownPressed: incrementCurrentIndex()
Keys.onReturnPressed: rowClicked(currentIndex)
Keys.onEnterPressed: quickPlayTrack(currentIndex)
boundsBehavior: !isMobile? Flickable.StopAtBounds : Flickable.DragAndOvershootBounds
flickableDirection: Flickable.AutoFlickDirection
snapMode: ListView.SnapToItem
addDisplaced: Transition
{
id: headerRoot
width: parent.width
height: visible ? headerRoot.implicitHeight : 0
Layout.fillWidth: true
visible: headerBarVisible
focus: true
RowLayout
{
id: headerBar
anchors.fill: parent
BabeButton
{
Layout.alignment : Qt.AlignLeft
// Layout.leftMargin: contentMargins
width: rowHeight
visible: headerBarExit
anim : true
iconName : headerBarExitIcon //"dialog-close"
onClicked : exit()
}
Row
{
id: headerBarActionsLeft
Layout.alignment : Qt.AlignLeft
// Layout.leftMargin: headerBarExit ? 0 : contentMargins
}
Label
{
text : headerBarTitle || babeList.count +" tracks"
Layout.fillHeight : true
Layout.fillWidth : true
Layout.alignment : Qt.AlignCenter
elide : Text.ElideRight
font.bold : false
color : labelColor
font.pointSize: fontSizes.big
horizontalAlignment : Text.AlignHCenter
verticalAlignment : Text.AlignVCenter
}
Row
{
id: headerBarActionsRight
Layout.alignment : Qt.AlignRight
// Layout.rightMargin: contentMargins
}
}
NumberAnimation { properties: "x,y"; duration: 100 }
}
ListView
ScrollBar.vertical:BabeScrollBar { }
onContentYChanged:
{
id: babeList
Layout.fillHeight: true
Layout.fillWidth: true
clip: true
highlight: Rectangle
{
width: babeList.width
height: babeList.currentItem.height
color: highlightColor
}
focus: true
interactive: true
highlightFollowsCurrentItem: true
highlightMoveDuration: 0
keyNavigationWraps: true
keyNavigationEnabled : true
Keys.onUpPressed: decrementCurrentIndex()
Keys.onDownPressed: incrementCurrentIndex()
Keys.onReturnPressed: rowClicked(currentIndex)
Keys.onEnterPressed: quickPlayTrack(currentIndex)
boundsBehavior: !isMobile? Flickable.StopAtBounds : Flickable.DragAndOvershootBounds
flickableDirection: Flickable.AutoFlickDirection
snapMode: ListView.SnapToItem
addDisplaced: Transition
{
NumberAnimation { properties: "x,y"; duration: 100 }
}
ScrollBar.vertical:BabeScrollBar { }
onContentYChanged:
{
if(contentY < -120)
wasPulled = true
if(contentY == 0 && wasPulled)
{ pulled(); wasPulled = false}
}
if(contentY < -120)
wasPulled = true
if(contentY == 0 && wasPulled)
{ pulled(); wasPulled = false}
}
}
}
......@@ -2,6 +2,7 @@ import QtQuick 2.9
import QtQuick.Controls 2.2
import QtQuick.Layouts 1.3
import org.kde.kirigami 2.2 as Kirigami
import org.kde.maui 1.0 as Maui
import "../../utils/Player.js" as Player
import ".."
......@@ -11,8 +12,6 @@ BabeList
id: babeTableRoot
holder.message: "<h2>This list is empty</h2><p>You can sdd new music sources from the settings</p>"
// cacheBuffer : 300
headerBarColor: backgroundColor
labelColor: textColor
focus: true
......@@ -43,27 +42,27 @@ BabeList
signal playAll()
signal appendAll()
headerBarLeft: BabeButton
headBar.leftContent: Maui.ToolButton
{
id : playAllBtn
visible : headerBarVisible && count > 0
visible : headBarVisible && count > 0
anim : true
iconName : "media-playlist-play"
onClicked : playAll()
}
headerBarRight: [
headBar.rightContent: [
BabeButton
Maui.ToolButton
{
id: appendBtn
visible: headerBarVisible && count > 0
visible: headBarVisible && count > 0
anim : true
iconName : "media-playlist-append"//"media-repeat-track-amarok"
onClicked: appendAll()
},
BabeButton
Maui.ToolButton
{
id: menuBtn
iconName: /*"application-menu"*/ "overflow-menu"
......@@ -113,7 +112,6 @@ BabeList
trackDurationVisible : trackDuration
trackRatingVisible : trackRating
menuItem: menuItemVisible
bgColor: headerBarColor
remoteArtwork: isArtworkRemote
playingIndicator: showIndicator
......
import QtQuick 2.0
import QtQuick.Controls 2.2
import org.kde.kirigami 2.2 as Kirigami
import org.kde.maui 1.0 as Maui
import QtQuick.Layouts 1.3
import "../../view_models/BabeDialog"
......@@ -27,7 +28,7 @@ BabeDialog
Layout.fillHeight: true
Layout.fillWidth: true
headerBarVisible: false
headBarVisible: false
holder.message: "<h2>There's not playlists</h2><br><p>Create a new one and start adding tracks to it<p/>"
ListModel { id: listModel }
model: listModel
......@@ -71,7 +72,7 @@ BabeDialog
}
}
BabeButton
Maui.ToolButton
{
iconName: "checkbox"
iconColor: textColor
......
......@@ -235,7 +235,7 @@ SwipeDelegate
height: parent.height
Layout.leftMargin: space.small
BabeButton
Maui.ToolButton
{
id: playBtn
anchors.centerIn: parent
......@@ -457,7 +457,7 @@ SwipeDelegate
onPositionChanged: swipe.position = Math.min(0, Math.max(-delegateRoot.width + height, delegateRoot.background.x - (startMouseX - mouse.x)));
BabeButton
Maui.ToolButton
{
id: menuBtn
visible: handle.pressed || swipe.position < 0
......
......@@ -8,6 +8,8 @@ import ".."
import "../../utils/Player.js" as Player
import "../../utils/Help.js" as H
import org.kde.maui 1.0 as Maui
BabeMenu
{
......@@ -64,58 +66,6 @@ BabeMenu
}
}
BabePopup
{
id: sendToPopup
parent: babeTableRoot
leftPadding: 1
rightPadding: 1
topPadding: contentMargins
bottomPadding: contentMargins
BabeList
{
id: sentToList
headerBarVisible: false
anchors.fill: parent
holder.message: qsTr("There's not avalible devices")
model: ListModel
{
id: model
}
delegate: BabeDelegate
{
id: delegate
label : name
Connections
{
target: delegate
onClicked:
{
sentToList.currentIndex = index
console.log(sentToList.model.get(index).name,sentToList.model.get(index).key)
bae.sendToDevice(sentToList.model.get(index).name,
sentToList.model.get(index).key,
babeTableRoot.model.get(babeTableRoot.currentIndex).url)
}
}
}
}
onOpened:
{
sentToList.clearTable()
var devices = bae.getDevices()
for( var i in devices)
sentToList.model.append({name: devices[i].name, key: devices[i].key })
}
}
Label
{
id: titleLabel
......@@ -182,11 +132,11 @@ BabeMenu
BabeMenuItem
{
text: "Send to..."
text: "Share..."
onTriggered:
{
isAndroid ? bae.sendTrack(list.model.get(list.currentIndex).url) :
sendToPopup.open()
isAndroid ? Maui.Android.shareDialog