Commit 3a6d706c authored by Camilo Higuita's avatar Camilo Higuita

cleaning up and start makig further use of mauikit

parent 6f22dced
......@@ -9,8 +9,6 @@
#include "babe.h"
#include "services/local/player.h"
#ifdef STATIC_KIRIGAMI
#include "./3rdparty/kirigami/src/kirigamiplugin.h"
#endif
......@@ -51,17 +49,13 @@ int main(int argc, char *argv[])
/*needed for mobile*/
if(BAE::isMobile())
{
int pressAndHoldInterval = 1000; // in [ms]
QGuiApplication::styleHints()->setMousePressAndHoldInterval(pressAndHoldInterval);
}
QGuiApplication::styleHints()->setMousePressAndHoldInterval(1000); // in [ms]
QCommandLineParser parser;
parser.setApplicationDescription("vvave music player");
const QCommandLineOption versionOption = parser.addVersionOption();
parser.process(app);
const QStringList args = parser.positionalArguments();
bool version = parser.isSet(versionOption);
if(version)
......
......@@ -25,24 +25,21 @@ import "services/web/Spotify"
import "view_models/BabeGrid"
import "db/Queries.js" as Q
import "utils/Player.js" as Player
import "utils/Help.js" as H
import "utils/Player.js" as Player
import org.kde.kirigami 2.2 as Kirigami
import org.kde.maui 1.0 as Maui
import Link.Codes 1.0
Maui.ApplicationWindow
{
id: root
// minimumWidth: !isMobile ? columnWidth : 0
// minimumHeight: !isMobile ? columnWidth + 64 : 0
// flags: Qt.FramelessWindowHint
// minimumWidth: !isMobile ? columnWidth : 0
// minimumHeight: !isMobile ? columnWidth + 64 : 0
// flags: Qt.FramelessWindowHint
title: qsTr("vvave")
// wideScreen: root.width > coverSize
/*ALIASES*/
property alias playIcon: playIcon
property alias babeBtnIcon: babeBtnIcon
......@@ -62,8 +59,7 @@ Maui.ApplicationWindow
property int currentTrackIndex: 0
property int prevTrackIndex: 0
property string currentArtwork: !mainlistEmpty ? mainPlaylist.list.model.get(
0).artwork : ""
property string currentArtwork: !mainlistEmpty ? mainPlaylist.list.model.get(0).artwork : ""
property bool currentBabe: currentTrack.babe == "0" ? false : true
property string durationTimeLabel: "00:00"
property string progressTimeLabel: "00:00"
......@@ -905,9 +901,9 @@ Maui.ApplicationWindow
id: views
headBarVisible: false
margins: 0
// focusPolicy: Qt.WheelFocus
// visualFocus: true
Column
{
anchors.fill: parent
......
<RCC>
<qresource prefix="/">
<file>main.qml</file>
<file>widgets/BabeBar.qml</file>
<file>utils/Icons.js</file>
<file>utils/materialdesignicons-webfont.ttf</file>
<file>widgets/TracksView.qml</file>
......@@ -11,7 +10,6 @@
<file>db/script.sql</file>
<file>utils/Player.js</file>
<file>assets/face.png</file>
<file>view_models/BabeHolder.qml</file>
<file>db/Queries.js</file>
<file>utils/Help.js</file>
<file>view_models/BabeScrollBar.qml</file>
......@@ -55,7 +53,6 @@
<file>assets/banner.png</file>
<file>assets/banner.svg</file>
<file>view_models/BabeTable/PlaylistDialog.qml</file>
<file>view_models/BabeDelegate.qml</file>
<file>view_models/BabeList.qml</file>
<file>view_models/BabeTable/HeaderMenu.qml</file>
<file>view_models/BabeNotify.qml</file>
......
......@@ -66,7 +66,7 @@ ColumnLayout
headBarExitIcon: "go-previous"
model : ListModel {}
delegate: BabeDelegate
delegate: Maui.LabelDelegate
{
id: delegate
label : tag
......@@ -113,12 +113,12 @@ ColumnLayout
menuBtn.visible: false
section.criteria: ViewSection.FullString
section.delegate: BabeDelegate
section.delegate: Maui.LabelDelegate
{
label: filterList.section.property === qsTr("stars") ? H.setStars(section) : section
isSection: true
boldLabel: true
fontFamily: "Material Design Icons"
labelTxt.font.family: "Material Design Icons"
}
......
......@@ -32,7 +32,7 @@ Linking::Linking(QObject *parent) : QObject(parent)
connect(&client, &QWebSocket::disconnected, this, &Linking::clientConDisconnected);
connect(&client, &QWebSocket::textMessageReceived, [this](QString msg)
{
auto decoded = decode(msg);
auto decoded = this->decode(msg);
qDebug()<<"client recived message"<<msg;
emit this->responseReady(decoded);
});
......@@ -113,7 +113,6 @@ void Linking::collectTrack(QString url)
QVariantMap Linking::decode(const QString &json)
{
bDebug::Instance()->msg("Decoding client msg");
QJsonParseError jsonParseError;
auto jsonResponse = QJsonDocument::fromJson(json.toUtf8(), &jsonParseError);
......
import QtQuick 2.9
import QtQuick.Layouts 1.3
import QtQuick.Controls 2.2
import org.kde.kirigami 2.2 as Kirigami
ItemDelegate
{
id: listItem
width: parent.width
height: rowHeightAlt
property bool isSection : false
property bool boldLabel : false
property alias label: labelTxt.text
property alias fontFamily: labelTxt.font.family
property string labelColor: ListView.isCurrentItem ? highlightedTextColor : textColor
Rectangle
{
anchors.fill: parent
color: isSection ? viewBackgroundColor : (index % 2 === 0 ? Qt.darker(backgroundColor) : "transparent")
opacity: 0.1
}
ColumnLayout
{
anchors.fill: parent
Label
{
id: labelTxt
Layout.margins: contentMargins
anchors.verticalCenter: parent.verticalCenter
width: parent.width
height: parent.height
horizontalAlignment: Qt.AlignLeft
verticalAlignment: Qt.AlignVCenter
text: labelTxt.text
elide: Text.ElideRight
color: labelColor
font.pointSize: fontSizes.default
font.bold: boldLabel
font.weight : boldLabel ? Font.Bold : Font.Normal
}
}
}
......@@ -2,6 +2,7 @@ import QtQuick.Controls 2.2
import QtQuick 2.9
import ".."
import org.kde.kirigami 2.0 as Kirigami
import org.kde.maui 1.0 as Maui
Pane
{
......@@ -37,7 +38,7 @@ Pane
onClicked: bgClicked()
}
BabeHolder
Maui.Holder
{
visible: grid.count === 0
message: "No albums..."
......
import QtQuick 2.9
import QtQuick.Controls 2.2
import QtQuick.Layouts 1.3
import QtGraphicalEffects 1.0
Item
{
property string emoji
property string message
clip: true
property color color : textColor
focus: true
anchors.fill: parent
GridLayout
{
id:placeHolder
anchors.fill: parent
columns: 1
rows: 2
Rectangle
{
anchors.fill: parent
Layout.row: 1
color: "transparent"
Image
{
id: imageHolder
anchors.centerIn: parent
width: iconSizes.large
height: iconSizes.large
source: emoji? emoji : "qrc:/assets/face.png"
horizontalAlignment: Qt.AlignHCenter
fillMode: Image.PreserveAspectFit
}
HueSaturation
{
anchors.fill: imageHolder
source: imageHolder
saturation: -1
lightness: 0.3
}
Label
{
id: textHolder
width: parent.width
anchors.top: imageHolder.bottom
opacity: 0.3
text: message ? qsTr(message) : qsTr("Nothing here...")
font.pointSize: fontSizes.default
padding: 10
font.bold: true
textFormat: Text.RichText
horizontalAlignment: Qt.AlignHCenter
elide: Text.ElideRight
color: textColor
}
}
}
}
......@@ -33,7 +33,7 @@ BabeDialog
ListModel { id: listModel }
model: listModel
delegate: BabeDelegate
delegate: Maui.LabelDelegate
{
id: delegate
label: playlist
......
......@@ -12,7 +12,7 @@ import "../../utils/Player.js" as PLAYER
SwipeDelegate
{
id: delegateRoot
id: delegateRoot
readonly property int altHeight : rowHeight * 1.2
readonly property bool sameAlbum :
......@@ -248,10 +248,9 @@ SwipeDelegate
{
Layout.fillHeight: true
Layout.fillWidth: true
Layout.alignment: Qt.AlignLeft
Layout.alignment: Qt.AlignLeft | Qt.AlignVCenter
Layout.margins: space.tiny
Layout.leftMargin: space.small * (quickPlay ? 1 : 2)
anchors.verticalCenter: parent.verticalCenter
GridLayout
{
......
import QtQuick 2.9
import QtQuick.Controls 2.2
import QtQuick.Layouts 1.3
import org.kde.kirigami 2.2 as Kirigami
//import Qt.labs.handlers 1.0
import "../utils"
import "../view_models"
ToolBar
{
position: ToolBar.Header
property alias babeBar : babeBar
property string accentColor : babeColor
property int currentIndex : 0
signal tracksViewClicked()
signal albumsViewClicked()
signal artistsViewClicked()
signal playlistsViewClicked()
// signal playlistViewClicked()
signal searchViewClicked()
signal settingsViewClicked()
id: babeBar
// TapHandler
// {
// onTapped: if (tapCount === 2) toggleMaximized()
// gesturePolicy: TapHandler.DragThreshold
// }
// DragHandler
// {
// grabPermissions: TapHandler.CanTakeOverFromAnything
// onGrabChanged:
// {
// if (active)
// {
// var position = parent.mapToItem(root.contentItem, point.position.x, point.position.y)
// root.startSystemMove(position);
// }
// }
// }
RowLayout
{
anchors.fill: parent
Item
{
Layout.alignment: Qt.AlignLeft
Layout.fillHeight: true
Layout.fillWidth: true
Layout.maximumWidth: toolBarIconSize*2
Layout.maximumHeight: toolBarIconSize
BabeButton
{
id: settingsView
anchors.centerIn: parent
anchors.left: parent.left
iconName: "application-menu"
iconColor: settingsDrawer.visible ? babeColor : textColor/*(pageStack.wideMode || pageStack.currentIndex === 0 ) && !isMobile ? accentColor : textColor*/
onClicked: settingsViewClicked()
hoverEnabled: !isMobile
ToolTip.delay: 1000
ToolTip.timeout: 5000
ToolTip.visible: hovered && !isMobile
ToolTip.text: qsTr("Settings")
}
}
Item
{
Layout.fillWidth: true
Layout.fillHeight: true
Layout.minimumWidth: 0
}
Item
{
Layout.fillHeight: true
Layout.fillWidth: true
Layout.maximumWidth: tracksView.implicitWidth * 1.3
Layout.maximumHeight: toolBarIconSize
}
Item
{
Layout.fillHeight: true
Layout.fillWidth: true
Layout.maximumWidth: albumsView.implicitWidth * 1.3
Layout.maximumHeight: toolBarIconSize
BabeButton
{
id: albumsView
anchors.centerIn: parent
hoverEnabled: true
ToolTip.delay: 1000
ToolTip.timeout: 5000
ToolTip.visible: hovered && !isMobile
ToolTip.text: qsTr("Albums")
}
}
Item
{
Layout.fillHeight: true
Layout.fillWidth: true
Layout.maximumWidth: artistsView.implicitWidth * 1.3
Layout.maximumHeight: toolBarIconSize
BabeButton
{
id: artistsView
anchors.centerIn: parent
onClicked: artistsViewClicked()
hoverEnabled: true
ToolTip.delay: 1000
ToolTip.timeout: 5000
ToolTip.visible: hovered && !isMobile
ToolTip.text: qsTr("Artists")
}
}
Item
{
Layout.fillHeight: true
Layout.fillWidth: true
Layout.maximumWidth: playlistsView.implicitWidth * 1.3
Layout.maximumHeight: toolBarIconSize
BabeButton
{
id: playlistsView
anchors.centerIn: parent
text: qsTr("Playlists")
iconName: "view-media-playlist"
iconColor: accent && currentIndex === viewsIndex.playlists ? accentColor : textColor
onClicked: playlistsViewClicked()
hoverEnabled: !isMobile
ToolTip.delay: 1000
ToolTip.timeout: 5000
ToolTip.visible: hovered && !isMobile
ToolTip.text: qsTr("Playlists")
}
}
Item
{
Layout.fillWidth: true
Layout.fillHeight: true
Layout.minimumWidth: 0
}
Item
{
Layout.alignment: Qt.AlignRight
Layout.fillHeight: true
Layout.fillWidth: true
Layout.maximumWidth: toolBarIconSize*2
Layout.maximumHeight: toolBarIconSize
BabeButton
{
id: searchView
anchors.centerIn: parent
// visible: !(searchInput.focus || searchInput.text)
iconColor: accent && currentIndex === viewsIndex.search ? accentColor : textColor
iconName: "edit-find" //"search"
onClicked: searchViewClicked()
hoverEnabled: !isMobile
ToolTip.delay: 1000
ToolTip.timeout: 5000
ToolTip.visible: hovered && !isMobile
ToolTip.text: qsTr("Search")
}
}
// Item
// {
// Layout.alignment: Qt.AlignRight
// Layout.fillHeight: true
// Layout.fillWidth: true
// Layout.maximumWidth: toolBarIconSize*2
// Layout.maximumHeight: toolBarIconSize
// BabeButton
// {
// id: closeBtn
// anchors.centerIn: parent
// // visible: !(searchInput.focus || searchInput.text)
// iconColor: down ? accentColor : textColor
// iconName: "window-close" //"search"
// onClicked: root.close()
// hoverEnabled: !isMobile
// ToolTip.delay: 1000
// ToolTip.timeout: 5000
// ToolTip.visible: hovered && !isMobile
// ToolTip.text: qsTr("Close")
// }
// }
}
}
......@@ -2,7 +2,7 @@ import QtQuick 2.9
import QtQuick.Controls 2.2
import QtQuick.Layouts 1.3
import QtGraphicalEffects 1.0
import org.kde.maui 1.0 as Maui
import "../../view_models"
Page
......@@ -33,11 +33,11 @@ Page
{
color: "transparent"
BabeHolder
Maui.Holder
{
id: lyricsHolder
color: darkTextColor
anchors.fill: parent
fgColor: darkTextColor
// anchors.fill: parent
visible: lyricsText.text.length > 0 ? false : true
message: "Couldn't find the lyrics!"
}
......@@ -78,7 +78,7 @@ Page
{
color: "transparent"
BabeHolder
Maui.Holder
{
id: wikiHolder
visible: wikiAlbumText.visible && wikiArtistText.visible ? false : true
......
......@@ -50,20 +50,17 @@ Item
// z: -999
// }
GridLayout
ColumnLayout
{
id: playlistLayout
anchors.fill: parent
width: parent.width
rowSpacing: 0
rows: 4
columns: 1
spacing: 0
Item
{
id: cover
Layout.row: 1
Layout.column: 1
Layout.fillWidth: true
Layout.preferredHeight: visible ? coverSize : 0
Layout.maximumHeight: coverSize
......@@ -122,8 +119,6 @@ Item
implicitHeight: toolBarHeightAlt
visible : !focusMode
Layout.row: 2
Layout.column: 1
Layout.fillWidth: true
MouseArea
......@@ -229,11 +224,10 @@ Item
id: mainPlaylistItem
visible : !focusMode
Layout.row: 4
Layout.column: 1
Layout.fillWidth: true
Layout.fillHeight: true
anchors.top: mainlistContext.bottom
anchors.bottom: parent.bottom
focus: true
// anchors.bottom: mainPlaylistRoot.searchBox
StackView
......
......@@ -2,6 +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 "../../view_models/BabeTable"
import "../../view_models/BabeMenu"
......@@ -65,7 +66,7 @@ Kirigami.PageRow
headBarExitIcon: "go-previous"
model : ListModel {}
delegate: BabeDelegate
delegate: Maui.LabelDelegate
{
id: delegate
label : tag
......@@ -164,12 +165,12 @@ Kirigami.PageRow
section.criteria: ViewSection.FullString
section.delegate: BabeDelegate
section.delegate: Maui.LabelDelegate
{
label: filterList.section.property === qsTr("stars") ? H.setStars(section) : section
isSection: true
boldLabel: true
fontFamily: "Material Design Icons"
labelTxt.font.family: "Material Design Icons"
}
......
......@@ -9,7 +9,6 @@ import "../../utils"
import "../../view_models"
import "../../db/Queries.js" as Q
import "../../utils/Help.js" as H
import Link.Codes 1.0
BabeList
{
......
import QtQuick 2.0
import QtQuick.Controls 2.2
import org.kde.maui 1.0 as Maui
import "../../view_models"
import "../../db/Queries.js" as Q
......@@ -17,14 +18,14 @@ BabePopup
model: ListModel {id: suggestionsModel}
section.property : "type"
section.delegate: BabeDelegate
section.delegate: Maui.LabelDelegate
{
label: section
isSection: true
boldLabel: true
}
delegate: BabeDelegate
delegate: Maui.LabelDelegate
{
id: delegate
label: suggestion
......
......@@ -47,7 +47,7 @@ BabePopup
model: listModel
delegate: BabeDelegate
delegate: Maui.LabelDelegate
{
id: delegate
label: url
......
import QtQuick 2.9
import org.kde.maui 1.0 as Maui
import "../view_models/BabeTable"
import "../view_models"
import "../db/Queries.js" as Q
......@@ -16,7 +17,7 @@ BabeTable
section.property : "album"
section.criteria: ViewSection.FullString
section.delegate: BabeDelegate
section.delegate: Maui.LabelDelegate
{
id: delegate
label: section
......
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