Commit d691cd64 authored by Camilo Higuita's avatar Camilo Higuita

getting babe ready for nomad qqc2 style and default dark scheme for mobile

parent 9dcfbce1
......@@ -52,7 +52,8 @@ int main(int argc, char *argv[])
Babe bae;
QFontDatabase::addApplicationFont(":/utils/materialdesignicons-webfont.ttf");
QQuickStyle::setStyle("Material");
qDebug()<<QQuickStyle::availableStyles();
QQmlApplicationEngine engine;
......@@ -68,6 +69,8 @@ int main(int argc, char *argv[])
#ifdef Q_OS_ANDROID
KirigamiPlugin::getInstance().registerTypes();
#else
QQuickStyle::setStyle("nomad");
#endif
engine.load(QUrl(QStringLiteral("qrc:/main.qml")));
......
......@@ -5,6 +5,7 @@ import QtGraphicalEffects 1.0
import QtQuick.Controls.Material 2.1
import org.kde.kirigami 2.2 as Kirigami
//import QtQuick.Controls.Imagine 2.3
import "utils"
......@@ -57,29 +58,18 @@ Kirigami.ApplicationWindow
/*THEMING*/
property string babeColor : bae.babeColor()
property string babeAltColor : bae.babeAltColor()
property string backgroundColor : bae.backgroundColor()
property string foregroundColor : bae.foregroundColor()
property string textColor : bae.textColor()
property string babeHighlightColor : bae.highlightColor()
property string highlightTextColor : bae.highlightTextColor()
property string backgroundColor : isMobile ? bae.backgroundColor() : Kirigami.Theme.backgroundColor
property string viewBackgroundColor : isMobile ? bae.backgroundColor() : Kirigami.Theme.viewBackgroundColor
property string foregroundColor : isMobile ? bae.foregroundColor() : Kirigami.Theme.textColor
property string textColor : isMobile ? bae.textColor() : Kirigami.Theme.textColor
property string babeHighlightColor : isMobile ? bae.highlightColor() : Kirigami.Theme.highlightColor
property string highlightTextColor : isMobile ? bae.highlightTextColor() : Kirigami.Theme.highlightedTextColor
property string midColor : bae.midColor()
property string midLightColor : bae.midLightColor()
property string midLightColor : isMobile? bae.midLightColor() : Kirigami.Theme.buttonBackgroundColor
property string darkColor : bae.darkColor()
property string baseColor : bae.baseColor()
property string altColor : bae.altColor()
property string shadowColor : bae.shadowColor()
readonly property string lightBackgroundColor : "#eff0f1"
readonly property string lightForegroundColor : "#31363b"
readonly property string lightTextColor : "#31363b"
readonly property string lightBabeHighlightColor : "#3daee9"
readonly property string lightHighlightTextColor : "#eff0f1"
readonly property string lightMidColor : "#cacaca"
readonly property string lightMidLightColor : "#dfdfdf"
readonly property string lightDarkColor : "#7f8c8d"
readonly property string lightBaseColor : "#fcfcfc"
readonly property string lightAltColor : "#eeeeee"
readonly property string lightShadowColor : "#868686"
property string shadowColor : bae.shadowColor()
readonly property string darkBackgroundColor : "#303030"
readonly property string darkForegroundColor : "#FAFAFA"
......@@ -95,7 +85,7 @@ Kirigami.ApplicationWindow
Material.theme: Material.Light
Material.accent: babeColor
Material.background: backgroundColor
Material.background: viewBackgroundColor
Material.primary: backgroundColor
Material.foreground: foregroundColor
......@@ -167,18 +157,18 @@ Kirigami.ApplicationWindow
onClosing: Player.savePlaylist()
pageStack.onCurrentIndexChanged:
{
if(pageStack.currentIndex === 0 && isMobile && !pageStack.wideMode)
{
bae.androidStatusBarColor(babeColor)
Material.background = babeColor
}else
{
bae.androidStatusBarColor(babeAltColor)
Material.background = babeAltColor
}
}
// pageStack.onCurrentIndexChanged:
// {
// if(pageStack.currentIndex === 0 && isMobile && !pageStack.wideMode)
// {
// bae.androidStatusBarColor(babeColor)
// Material.background = babeColor
// }else
// {
// bae.androidStatusBarColor(babeAltColor)
// Material.background = babeAltColor
// }
// }
onMissingAlert:
{
......@@ -207,12 +197,9 @@ Kirigami.ApplicationWindow
header: BabeBar
{
id: toolbar
height: toolBarHeight
// height: toolBarHeight
visible: true
currentIndex: currentView
bgColor: isMobile && pageStack.currentIndex === 0 && !pageStack.wideMode ? babeColor : babeAltColor
textColor: isMobile && pageStack.currentIndex === 0 && !pageStack.wideMode ? "#FFF" : bae.foregroundColor()
onSettingsViewClicked: settingsDrawer.visible ? settingsDrawer.close() : settingsDrawer.open()
onTracksViewClicked:
......@@ -252,14 +239,15 @@ Kirigami.ApplicationWindow
}
}
footer: Item
footer: ToolBar
{
id: playbackControls
anchors.horizontalCenter: parent.horizontalCenter
height: visible ? headerHeight : 0
width: root.width
visible: true
focus: true
position: ToolBar.Footer
FastBlur
{
anchors.fill: parent
......@@ -320,24 +308,7 @@ Kirigami.ApplicationWindow
implicitHeight: 10
width: progressBar.availableWidth
height: implicitHeight
color: "transparent"
Kirigami.Separator
{
visible: !isMobile
Rectangle
{
anchors.fill: parent
color: Kirigami.Theme.viewFocusColor
}
anchors
{
left: parent.left
right: parent.right
top: parent.top
}
}
color: "transparent"
Rectangle
{
......@@ -841,7 +812,9 @@ Kirigami.ApplicationWindow
Component.onCompleted:
{
if(isMobile) settingsDrawer.switchColorScheme(bae.loadSetting("THEME", "BABE", "Dark"))
// if(isMobile) settingsDrawer.switchColorScheme(bae.loadSetting("THEME", "BABE", "Dark"))
// console.log(Imagine.url, Imagine.path)
bae.androidStatusBarColor(backgroundColor)
}
/*CONNECTIONS*/
......
......@@ -71,7 +71,6 @@ void Pulpo::setRecursive(const RECURSIVE &state)
void Pulpo::initServices()
{
for(auto service : this->registeredServices)
switch (service)
{
case SERVICES::LastFm:
......
......@@ -29,7 +29,7 @@ function playTrack(track)
bae.notifySong(currentTrack.url)
}
bae.trackLyrics(currentTrack.url)
// bae.trackLyrics(currentTrack.url)
// root.mainPlaylist.infoView.wikiAlbum = bae.albumWiki(root.mainPlaylist.currentTrack.album,root.mainPlaylist.currentTrack.artist)
// root.mainPlaylist.infoView.wikiArtist = bae.artistWiki(root.mainPlaylist.currentTrack.artist)
......@@ -202,7 +202,7 @@ function savePlaylist()
function clearOutPlaylist()
{
mainPlaylist.tabe.clearTable()
mainPlaylist.table.clearTable()
stop()
}
......
......@@ -18,7 +18,8 @@ ToolButton
icon.color: isMobile ? "transparent" : (iconColor || defaultColor)
onClicked: if(anim) animIcon.running = true
flat: true
highlighted: false
// Kirigami.Icon
// {
// id: kirigamIcon
......
import QtQuick 2.9
import QtQuick.Layouts 1.3
import QtQuick.Controls 2.2
import org.kde.kirigami 2.2 as Kirigami
ItemDelegate
{
......@@ -19,8 +20,8 @@ ItemDelegate
Rectangle
{
anchors.fill: parent
color: isSection ? midLightColor : (index % 2 === 0 ? midColor : "transparent")
opacity: 0.3
color: isSection ? viewBackgroundColor : (index % 2 === 0 ? Qt.darker(backgroundColor) : "transparent")
opacity: 0.1
}
ColumnLayout
......@@ -42,6 +43,8 @@ ItemDelegate
text: labelTxt.text
elide: Text.ElideRight
color: textColor
font.pointSize: fontSizes.medium
font.bold: boldLabel
font.weight : boldLabel ? Font.Bold : Font.Normal
}
......
......@@ -5,7 +5,7 @@ import QtQuick.Controls.Material 2.1
Dialog
{
width: columnWidth * 0.9
height: isMobile ? parent.height*0.8 : parent.height*0.5
height: parent.height*0.5
x: (parent.width - width) / 2
y: (parent.height - height) / 2
......@@ -13,7 +13,9 @@ Dialog
modal: true
padding: 0
margins: 1
padding: 2
Material.accent: babeColor
Material.background: backgroundColor
......
......@@ -5,6 +5,9 @@ import QtQuick.Layouts 1.3
BabeDialog
{
id: babeMessageRoot
width: columnWidth * 0.9
height: parent.height*0.5
property string message
property string messageBody
standardButtons: Dialog.Yes | Dialog.No
......
......@@ -2,7 +2,7 @@ import QtQuick.Controls 2.2
import QtQuick 2.9
import ".."
Pane
Page
{
id: gridPage
padding: 20
......@@ -37,13 +37,6 @@ Pane
onWidthChanged: grid.forceLayout()
background: Rectangle
{
anchors.fill: parent
color: altColor
z: -999
}
function clearGrid()
{
gridModel.clear()
......
......@@ -2,8 +2,9 @@ import QtQuick 2.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
Item
Page
{
id: babeListRoot
property alias list : babeList
......@@ -22,7 +23,7 @@ Item
property bool headerBarExit : true
property string headerBarExitIcon : "window-close"
property color headerBarColor : "transparent"
property color headerBarColor : backgroundColor
property color textColor : foregroundColor
property bool wasPulled : false
......@@ -38,43 +39,19 @@ Item
list.model.clear()
}
ColumnLayout
{
anchors.fill: parent
spacing: 0
Item
ToolBar
{
id: headerRoot
width: parent.width
height: visible ? toolBarHeight : 0
Layout.fillWidth: true
visible: headerBarVisible
focus: true
Rectangle
{
anchors.fill: parent
color: headerBarColor
Kirigami.Separator
{
visible: !isMobile
Rectangle
{
anchors.fill: parent
color: Kirigami.Theme.viewFocusColor
}
anchors
{
left: parent.left
right: parent.right
bottom: parent.bottom
}
}
}
focus: true
RowLayout
{
......@@ -89,7 +66,6 @@ Item
anim : true
iconName : headerBarExitIcon //"dialog-close"
onClicked : exit()
iconColor: textColor
}
Row
......@@ -136,15 +112,6 @@ Item
width: babeList.width
height: babeList.currentItem.height
color: babeHighlightColor
// y: babeList.currentItem.y
// Behavior on y
// {
// SpringAnimation
// {
// spring: 3
// damping: 0.2
// }
// }
}
focus: true
......@@ -177,13 +144,6 @@ Item
focus: true
}
Rectangle
{
anchors.fill: parent
color: "transparent"
z: -999
}
ScrollBar.vertical:BabeScrollBar { }
......
......@@ -5,8 +5,8 @@ import QtQuick.Controls.Material 2.1
Popup
{
property int maxWidth : ApplicationWindow.overlay.width
property int maxHeight : ApplicationWindow.overlay.height
property int maxWidth : 200
property int maxHeight : 200
parent: ApplicationWindow.overlay
......@@ -30,8 +30,9 @@ Popup
focus: true
clip: true
padding: 0
margins: 0
margins: 1
padding: 2
enter: Transition
{
......
......@@ -11,7 +11,7 @@ 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: midLightColor
headerBarColor: backgroundColor
textColor: foregroundColor
property bool trackNumberVisible
......@@ -53,7 +53,6 @@ BabeList
anim : true
iconName : "media-playlist-append"//"media-repeat-track-amarok"
onClicked: appendAll()
iconColor: textColor
},
BabeButton
......@@ -61,7 +60,6 @@ BabeList
id: menuBtn
iconName: /*"application-menu"*/ "overflow-menu"
onClicked: headerMenu.popup()
iconColor: textColor
}
]
......
......@@ -4,6 +4,7 @@ import QtQuick.Controls 2.2
import "../../view_models"
import QtGraphicalEffects 1.0
import "../../utils/Help.js" as H
import org.kde.kirigami 2.2 as Kirigami
ItemDelegate
{
......@@ -12,6 +13,7 @@ ItemDelegate
width: parent.width
height: sameAlbum ? rowHeightAlt : rowHeight
clip: true
autoExclusive: true
signal play()
signal rightClicked()
......@@ -32,7 +34,7 @@ ItemDelegate
}else false
}
property color bgColor : midColor
property color bgColor : backgroundColor
property color color : foregroundColor
property color highlightColor : highlightTextColor
property string textColor: ListView.isCurrentItem ? highlightColor : color
......@@ -61,10 +63,10 @@ ItemDelegate
if(trackMood.length > 0)
Qt.lighter(trackMood)
else
index % 2 === 0 ? bgColor : "transparent"
index % 2 === 0 ? Qt.darker(bgColor) : "transparent"
}
opacity: 0.3
opacity: 0.1
}
MouseArea
......
......@@ -162,7 +162,7 @@ BabeMenu
onTriggered:
{
isMobile ?
!isMobile ?
bae.showFolder(list.model.get(list.currentIndex).url) :
bae.openFile(list.model.get(list.currentIndex).url)
close()
......
......@@ -18,7 +18,7 @@ Item
Layout.fillHeight: true
Layout.fillWidth: true
Layout.alignment: Qt.AlignCenter
flat: true
Rectangle
{
anchors.centerIn: parent
......@@ -38,6 +38,7 @@ Item
Layout.fillWidth: true
Layout.alignment: Qt.AlignCenter
flat: true
Rectangle
{
anchors.centerIn: parent
......@@ -56,7 +57,7 @@ Item
Layout.fillHeight: true
Layout.fillWidth: true
Layout.alignment: Qt.AlignCenter
flat: true
Rectangle
{
anchors.centerIn: parent
......@@ -75,7 +76,7 @@ Item
Layout.fillHeight: true
Layout.fillWidth: true
Layout.alignment: Qt.AlignCenter
flat: true
Rectangle
{
anchors.centerIn: parent
......@@ -95,7 +96,7 @@ Item
Layout.fillHeight: true
Layout.fillWidth: true
Layout.alignment: Qt.AlignCenter
flat: true
Rectangle
{
anchors.centerIn: parent
......
......@@ -74,12 +74,6 @@ BabeGrid
NumberAnimation { property: "opacity"; from: 1.0; to: 0.0 }
}
background: Rectangle
{
anchors.fill: parent
z: -999
color: altColor
}
BabeTable
{
......@@ -132,24 +126,7 @@ BabeGrid
drawer.close()
}
onExit: drawer.close()
Kirigami.Separator
{
visible: !isMobile
Rectangle
{
anchors.fill: parent
color: Kirigami.Theme.viewFocusColor
}
anchors
{
left: parent.left
right: parent.right
top: parent.top
}
}
onExit: drawer.close()
}
}
......
......@@ -73,14 +73,6 @@ BabeGrid
NumberAnimation { property: "opacity"; from: 1.0; to: 0.0 }
}
background: Rectangle
{
anchors.fill: parent
z: -999
color: altColor
}
BabeTable
{
id: drawerList
......@@ -126,24 +118,7 @@ BabeGrid
drawer.close()
}
onExit: drawer.close()
Kirigami.Separator
{
visible: !isMobile
Rectangle
{
anchors.fill: parent
color: Kirigami.Theme.viewFocusColor
}
anchors
{
left: parent.left
right: parent.right
top: parent.top
}
}
onExit: drawer.close()
}
}
......
......@@ -27,28 +27,13 @@ ToolBar
width: parent.width
id: babeBar
smooth: true
Rectangle
{
anchors.fill: parent
anchors.fill: isMobile ? parent : undefined
color: bgColor
Kirigami.Separator
{
visible: !isMobile
Rectangle
{
anchors.fill: parent
color: Kirigami.Theme.viewFocusColor
}
anchors
{
left: parent.left
right: parent.right
bottom: parent.bottom
}
}
visible: !isMobile
}
RowLayout
......
......@@ -16,12 +16,7 @@ Page
property int currentView : 0
clip: true
Rectangle
{
anchors.fill: parent
z: -999
color: darkDarkColor
}
SwipeView
{
......@@ -29,6 +24,10 @@ Page
anchors.fill: parent
currentIndex: currentView
background: Rectangle
{
color: darkDarkColor
}
Rectangle
{
......@@ -66,10 +65,10 @@ Page
verticalAlignment: Qt.AlignVCenter
textFormat: Text.RichText
wrapMode: Text.Wrap
activeFocusOnPress : true
selectByMouse : true
cursorPosition :0
cursorVisible: true
// activeFocusOnPress : true
// selectByMouse : true
// cursorPosition :0
// cursorVisible: true
}
}
......
......@@ -130,7 +130,7 @@ Item
anchors.fill: parent
color: darkDarkColor
opacity: opacityLevel
z: -999
z: -999
}
MouseArea
......@@ -276,6 +276,13 @@ Item
textColor: darkForegroundColor
Rectangle
{
anchors.fill: parent
z: -999
color: darkDarkColor
}
onRowClicked:
{
prevTrackIndex = currentTrackIndex
......@@ -293,39 +300,39 @@ Item
}
// Component.onCompleted:
// {
// var list = bae.lastPlaylist()
// var n = list.length
// if(n>0)
// {
// for(var i = 0; i < n; i++)
// {
// var where = "url = \""+list[i]+"\""
// var query = Q.GET.tracksWhere_.arg(where)
// var track = bae.get(query)
// Player.appendTrack(track[0])
// }
// }else
// {
// where = "babe = 1"
// query = Q.GET.tracksWhere_.arg(where)
// var tracks = bae.get(query)
// for(var pos=0; pos< tracks.length; pos++)
// Player.appendTrack(tracks[pos])
// }
// if(autoplay)
// Player.playAt(0)
// // var pos = bae.lastPlaylistPos()
// // console.log("POSSS:", pos)
// // list.currentIndex = pos
// // play(list.model.get(pos))
// }
Component.onCompleted:
{
var list = bae.lastPlaylist()
var n = list.length
if(n>0)
{
for(var i = 0; i < n; i++)
{
var where = "url = \""+list[i]+"\""
var query = Q.GET.tracksWhere_.arg(where)