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

work on settings drawer an initial work on babe platform integration

parent 28b29d8d
......@@ -370,24 +370,24 @@ QString Babe::hightlightTextColor()
QString Babe::midColor()
{
#if defined(Q_OS_ANDROID)
return "#3e444b";
return "#1f2226";
#elif defined(Q_OS_LINUX)
QWidget widget;
return widget.palette().color(QPalette::Mid).name();
#elif defined(Q_OS_WIN32)
return "#3e444b";
return "#1f2226";
#endif
}
QString Babe::midLightColor()
{
#if defined(Q_OS_ANDROID)
return "#3e444b";
return "#434951";
#elif defined(Q_OS_LINUX)
QWidget widget;
return widget.palette().color(QPalette::Midlight).name();
#elif defined(Q_OS_WIN32)
return "#3e444b";
return "#434951";
#endif
}
......
......@@ -9,8 +9,10 @@ import "db/Queries.js" as Q
import "utils/Player.js" as Player
import "utils"
import "widgets"
import "widgets/MyBeatView"
import "widgets/PlaylistsView"
import "widgets/MainPlaylist"
import "widgets/SettingsView"
import "view_models"
Kirigami.ApplicationWindow
......@@ -171,15 +173,12 @@ Kirigami.ApplicationWindow
size: toolBarIconSize
currentIndex: currentView
backgroundColor: pageStack.currentIndex === 0 && !pageStack.wideMode ? bae.babeColor() : bae.backgroundColor()
textColor: pageStack.currentIndex === 0 && !pageStack.wideMode ? "#FFF" : bae.foregroundColor()
onPlaylistViewClicked:
{
if(!isMobile && pageStack.wideMode)
root.width = columnWidth
else if(!isMobile && !pageStack.wideMode)
root.width = wideSize
pageStack.currentIndex = 0
}
......@@ -252,42 +251,71 @@ Kirigami.ApplicationWindow
}
}
TextInput
RowLayout
{
id: searchInput
anchors.fill: parent
anchors.centerIn: parent
color: bae.foregroundColor()
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
selectByMouse: !root.isMobile
selectionColor: bae.hightlightColor()
selectedTextColor: bae.foregroundColor()
property string placeholderText: "Search..."
onAccepted: runSearch()
BabeButton
{
id: searchBtn
anchors.centerIn: parent
visible: !(searchInput.focus || searchInput.text)
Layout.fillHeight: true
iconColor: currentView === 5 ? bae.babeColor() : bae.foregroundColor()
// visible: !(searchInput.focus || searchInput.text)
iconName: "edit-find" //"search"
onClicked:
{
searchInput.forceActiveFocus()
if(searchView.count>0)
{
currentView = 5
pageStack.currentIndex = 1
}else
searchInput.forceActiveFocus()
}
}
Item
{
Layout.fillHeight: true
Layout.fillWidth: true
TextInput
{
id: searchInput
color: bae.foregroundColor()
anchors.fill: parent
anchors.centerIn: parent
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
selectByMouse: !root.isMobile
selectionColor: bae.hightlightColor()
selectedTextColor: bae.foregroundColor()
property string placeholderText: "Search..."
onAccepted: runSearch()
BabeButton
{
anchors.right: parent.right
visible: searchInput.activeFocus
iconName: "edit-clear"
onClicked: clearSearch()
}
}
}
BabeButton
{
anchors.right: parent.right
visible: searchInput.activeFocus
iconName: "edit-clear"
onClicked: clearSearch()
id: settingsIcon
Layout.fillHeight: true
iconName: "games-config-options"
iconColor: settingsDrawer.visible ? bae.babeColor() : bae.foregroundColor()
onClicked: settingsDrawer.visible ? settingsDrawer.close() : settingsDrawer.open()
}
}
}
......@@ -408,7 +436,7 @@ Kirigami.ApplicationWindow
}
}
Item
LogginForm
{
id: babeView
}
......
......@@ -11,7 +11,6 @@
<file>assets/cover.png</file>
<file>data_models/db_model.qml</file>
<file>db/script.sql</file>
<file>widgets/SettingsView.qml</file>
<file>utils/Player.js</file>
<file>assets/face.png</file>
<file>view_models/BabeHolder.qml</file>
......@@ -51,5 +50,13 @@
<file>assets/face-sleeping.png</file>
<file>assets/face-hug.png</file>
<file>org.kde.babe.desktop</file>
<file>widgets/SettingsView/SettingsView.qml</file>
<file>widgets/MyBeatView/LogginForm.qml</file>
<file>assets/music_img.jpg</file>
<file>assets/beat.png</file>
<file>assets/beat-banner3.png</file>
<file>assets/beat-banner2.png</file>
<file>assets/beat-banner.png</file>
<file>assets/beat2.png</file>
</qresource>
</RCC>
......@@ -55,6 +55,8 @@ void Brain::setInterval(const uint &value)
void Brain::setInfo(DB_LIST dataList, ONTOLOGY ontology, QList<SERVICES> services, INFO info, RECURSIVE recursive, void (*cb)(DB))
{
if(!go) return;
this->pulpo.registerServices(services);
this->pulpo.setOntology(ontology);
this->pulpo.setInfo(info);
......@@ -63,13 +65,12 @@ void Brain::setInfo(DB_LIST dataList, ONTOLOGY ontology, QList<SERVICES> service
for(auto data : dataList)
{
if(!go) return;
if (cb != nullptr) cb(data);
this->pulpo.feed(data, recursive);
this->t.msleep(this->interval);
if(this->go)
{
if (cb != nullptr) cb(data);
this->pulpo.feed(data, recursive);
this->t.msleep(this->interval);
}
}
}
......
......@@ -6,7 +6,7 @@ ToolButton
{
id: babeButton
property string iconName
property int iconSize : isMobile ? 24 : 22
property int iconSize : toolBarIconSize
property string iconColor: bae.foregroundColor()
readonly property string defaultColor : bae.foregroundColor()
......
......@@ -12,7 +12,7 @@ Pane
{
if(!isMobile)
{
Math.sqrt(screenSize)*0.15
Math.sqrt(screenSize)*0.15 > 150 ? 150 : Math.sqrt(screenSize)*0.15
}else
{
......
import QtQuick 2.9
import QtQuick.Controls 2.2
import QtQuick.Layouts 1.3
import QtGraphicalEffects 1.0
Item
{
Rectangle
{
anchors.fill: parent
z: -999
color: bae.midLightColor()
// Image
// {
// id: musicBg
// source: "qrc:/assets/music_img.jpg"
// smooth: true
// visible: false
// anchors.fill: parent
// }
// FastBlur
// {
// anchors.fill: musicBg
// source: musicBg
// radius: 64
// }
}
ColumnLayout
{
anchors.fill: parent
Item
{
id: banner
Layout.fillWidth: true
anchors.top: parent.top
height: 64
width: parent.width
Rectangle
{
anchors.fill: parent
z: -999
color: "#dedede"
opacity: 0.5
}
Item
{
anchors.centerIn: parent
width: parent.width * 0.3
height: parent.height *0.5
Image
{
anchors.centerIn: parent
sourceSize.width: parent.width
sourceSize.height: parent.height
fillMode: Image.Pad
smooth: true
mipmap: true
source: "qrc:/assets/beat2.png"
horizontalAlignment: Qt.AlignHCenter
}
}
}
Item
{
Layout.fillWidth: true
Layout.fillHeight: true
ColumnLayout
{
width: parent.width *0.4
height: parent.height *0.4
anchors.centerIn: parent
Item
{
width: parent.width
Layout.fillWidth: true
Layout.alignment: Qt.AlignCenter
height: 48
TextField
{
id: nickId
anchors.fill: parent
anchors.centerIn: parent
placeholderText: "nick or email"
color: bae.foregroundColor()
}
}
Item
{
width: parent.width
Layout.fillWidth: true
Layout.alignment: Qt.AlignCenter
height: 48
TextField
{
id: password
anchors.fill: parent
anchors.centerIn: parent
placeholderText: "password"
color: bae.foregroundColor()
}
}
Button
{
width: parent.width
Layout.fillWidth: true
Layout.alignment: Qt.AlignCenter
id: loginBtn
background: Rectangle
{
color: bae.babeColor()
radius: 3
}
contentItem: Text
{
text: "Login"
horizontalAlignment: Qt.AlignHCenter
verticalAlignment: Qt.AlignVCenter
color: bae.hightlightTextColor()
font.bold: true
font.pointSize: 11
}
}
}
}
}
}
......@@ -4,25 +4,25 @@ import QtQuick.Controls 2.2
import Qt.labs.platform 1.0
import org.kde.kirigami 2.2 as Kirigami
import "../view_models"
import "../view_models/FolderPicker"
import "../../view_models"
import "../../view_models/FolderPicker"
Kirigami.GlobalDrawer
{
id: settingsView
handleVisible: true
handleVisible: false
signal iconSizeChanged(int size)
readonly property bool activeBrainz : bae.brainzState()
y: header.height
height: parent.height - header.height - footer.height
// width: root.pageStack.wideMode ? views.width -1: root.width
// width: root.pageStack.wideMode ? views.width -1: root.width
edge: Qt.RightEdge
// // interactive: true
// focus: true
// modal:true
// dragMargin :0
// // interactive: true
// focus: true
// modal:true
// dragMargin :0
topPadding: 0
bottomPadding: 0
......@@ -30,7 +30,7 @@ Kirigami.GlobalDrawer
rightPadding: 0
Kirigami.Theme.inherit: false
Kirigami.Theme.colorSet: Kirigami.Theme.Complementary
// Kirigami.Theme.colorSet: Kirigami.Theme.Complementary
function scanDir(folderUrl)
......@@ -38,12 +38,12 @@ Kirigami.GlobalDrawer
bae.scanDir(folderUrl)
}
// background: Rectangle
// {
// anchors.fill: parent
// color: bae.backgroundColor()
// z: -999
// }
background: Rectangle
{
anchors.fill: parent
color: bae.backgroundColor()
z: -999
}
// contentItem: Text
// {
......@@ -84,7 +84,7 @@ Kirigami.GlobalDrawer
}
topContent: ColumnLayout
topContent: ColumnLayout
{
width: settingsView.width
height: settingsView.height * 0.5
......@@ -180,15 +180,9 @@ Kirigami.GlobalDrawer
}
}
Kirigami.Separator
{
Layout.fillWidth: true
Layout.maximumHeight: 1//implicitHeight
}
}
actions: [
Kirigami.Action
{
......@@ -210,21 +204,41 @@ Kirigami.GlobalDrawer
},
Kirigami.Action
{
text: "Toolbar icon size"
Kirigami.Action
{
text: "16"
onTriggered : iconSizeChanged(text)
}
text: "Appearance"
Kirigami.Action
{
text: "24"
onTriggered : iconSizeChanged(text)
text: "Toolbar icon size"
Kirigami.Action
{
text: "16"
onTriggered : iconSizeChanged(text)
}
Kirigami.Action
{
text: isMobile ? "24" : "22"
onTriggered : iconSizeChanged(text)
}
Kirigami.Action
{
text: "32"
onTriggered : iconSizeChanged(text)
}
}
Kirigami.Action
{
text: "32"
onTriggered : iconSizeChanged(text)
text: "Theme"
Kirigami.Action
{
text: "Light"
onTriggered : iconSizeChanged(text)
}
Kirigami.Action
{
text: "Dark"
onTriggered : iconSizeChanged(text)
}
}
}
]
......
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