Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit c821476a authored by Camilo Higuita's avatar Camilo Higuita

updated video bg

parent 72b842fa
......@@ -630,8 +630,6 @@ QVariantList Babe::searchFor(const QStringList &queries)
bool hasKey = false;
for(auto searchQuery : queries)
{
searchQuery = searchQuery.toLower();
if(searchQuery.contains(BAE::SearchTMap[BAE::SearchT::LIKE]+":") || searchQuery.startsWith("#"))
{
if(searchQuery.startsWith("#"))
......
......@@ -659,7 +659,7 @@ QVariantList CollectionDB::getSearchedTracks(const KEY &where, const QString &se
else if(where == KEY::SQL)
queryTxt = search;
else
queryTxt = QString("SELECT t.*, al.artwork FROM %1 t inner join albums al on al.album = t.album and t.artist = al.artist WHERE %2 LIKE \"%%3%\" ORDER BY strftime(\"%s\", t.addDate) desc LIMIT 1000").arg(TABLEMAP[TABLE::TRACKS],
queryTxt = QString("SELECT t.*, al.artwork FROM %1 t inner join albums al on al.album = t.album and t.artist = al.artist WHERE t.%2 LIKE \"%%3%\" ORDER BY strftime(\"%s\", t.addDate) desc LIMIT 1000").arg(TABLEMAP[TABLE::TRACKS],
KEYMAP[where],
search);
......
......@@ -44,11 +44,12 @@ Kirigami.ApplicationWindow
property var currentTrack : ({babe: "0", stars: "0"})
property int currentTrackIndex : 0
property int prevTrackIndex : 0
property string currentArtwork
property string currentArtwork : mainPlaylist.table.count > 0 ? mainPlaylist.list.model.get(0).artwork : ""
property bool currentBabe : currentTrack.babe == "0" ? false : true
property string durationTimeLabel : "00:00"
property string progressTimeLabel : "00:00"
property bool isPlaying : false
property bool autoplay : bae.loadSetting("AUTOPLAY", "BABE", false) === "true" ? true : false
/*THEMING*/
property string babeColor : bae.babeColor()
......@@ -324,7 +325,7 @@ Kirigami.ApplicationWindow
target: footerBg
property: "color"
easing.type: Easing.InOutQuad
from: darkMidColor
from: darkBaseColor
to: darkDarkColor
duration: 500
}
......
......@@ -9,7 +9,7 @@ Item
property string message
clip: true
property color color : foregroundColor
focus: true
anchors.fill: parent
GridLayout
......
......@@ -50,7 +50,7 @@ Item
height: visible ? toolBarHeight : 0
Layout.fillWidth: true
visible: headerBarVisible
focus: true
Rectangle
{
anchors.fill: parent
......@@ -127,7 +127,6 @@ Item
id: babeList
Layout.fillHeight: true
Layout.fillWidth: true
clip: true
highlight: Rectangle
......@@ -173,6 +172,7 @@ Item
id: holder
visible: babeList.count === 0
color : textColor
focus: true
}
Rectangle
......
......@@ -8,6 +8,8 @@ Popup
property int maxWidth : ApplicationWindow.overlay.width
property int maxHeight : ApplicationWindow.overlay.height
parent: ApplicationWindow.overlay
width: parent === ApplicationWindow.overlay ? (root.pageStack.wideMode ? parent.width * 0.4 :
(isMobile ? parent.width * 0.8 :
parent.width * 0.7)) :
......@@ -19,19 +21,18 @@ Popup
parent.height * 0.7 > maxHeight ? maxHeight :
parent.height * 0.7
padding: 0
margins: 0
x: parent.width / 2 - width / 2
y: parent.height / 2 - height / 2
parent: ApplicationWindow.overlay
z: 999
modal: true
focus: true
clip: true
padding: 0
margins: 0
enter: Transition
{
NumberAnimation { property: "opacity"; from: 0.0; to: 1.0; duration: 150 }
......
......@@ -105,12 +105,11 @@ ItemDelegate
{
id: artworkCover
anchors.fill: parent
source:
{
if(artwork)
(artwork.length > 0 && artwork !== "NONE")? "file://"+encodeURIComponent(artwork) : "qrc:/assets/cover.png"
else "qrc:/assets/cover.png"
}
source: typeof artwork === 'undefined' ?
"qrc:/assets/cover.png" :
(artwork && artwork.length > 0 && artwork !== "NONE")? "file://"+encodeURIComponent(artwork) : "qrc:/assets/cover.png"
fillMode: Image.PreserveAspectFit
cache: false
antialiasing: false
......
......@@ -31,7 +31,7 @@ Item
signal coverDoubleClicked(var tracks)
signal coverPressed(var tracks)
focus: true
PlaylistMenu
{
......@@ -241,6 +241,7 @@ Item
Layout.fillWidth: true
Layout.fillHeight: true
anchors.top: mainlistContext.bottom
focus: true
// anchors.bottom: mainPlaylistRoot.searchBox
StackView
{
......@@ -353,7 +354,9 @@ Item
Player.appendTrack(tracks[pos])
}
Player.playAt(0)
if(autoplay)
Player.playAt(0)
// var pos = bae.lastPlaylistPos()
// console.log("POSSS:", pos)
......
......@@ -17,13 +17,12 @@ Page
Rectangle
{
visible: logginDialog.visible && !isMobile
anchors.fill: parent
z: -999
visible: logginDialog.visible
width: parent.width
height: parent.height
z: 999
color: darkColor
opacity: 0.5
height: root.height - playbackControls.height - toolbar.height
y: toolbar.height
}
ColumnLayout
......
......@@ -12,7 +12,7 @@ BabePopup
padding: contentMargins*3
maxHeight: loginLayout.implicitHeight+64
maxWidth: loginLayout.implicitWidth+64
// modal: false
modal: false
// closePolicy: Popup.NoAutoClose
ScrollView
......
import QtQuick 2.0
import "../../view_models"
import "../../db/Queries.js" as Q
BabePopup
{
id: searchSuggestionsRoot
property alias model : suggestionsList.model
leftPadding: 1
rightPadding: 1
topPadding: contentMargins
bottomPadding: contentMargins
BabeList
{
id: suggestionsList
anchors.fill: parent
headerBarVisible: false
model: ListModel {id: suggestionsModel}
delegate: BabeDelegate
......@@ -26,23 +32,59 @@ BabePopup
onClicked:
{
suggestionsList.currentIndex = index
searchInput.text = suggestionsList.model.get(index).suggestion
runSearch()
runSearch(suggestionsList.model.get(index).suggestion)
close()
}
}
}
}
onOpened:
onOpened: updateSuggestions()
function updateSuggestions()
{
suggestionsList.clearTable()
var qq = bae.loadSetting("QUERIES", "BABE", {})
savedQueries = qq.split(",")
for(var i=0; i < 5; i++)
if(i < savedQueries.length )
suggestionsList.model.append({suggestion: savedQueries[i]})
if(searchInput.text.length>3 && searchInput.text.indexOf(":") < 0)
{
// var similar = bae.get('select distinct * from tracks where title LIKE "%'+searchInput.text+'%" or artist LIKE "%'+searchInput.text+'%" or album LIKE "%'+searchInput.text+'%" limit 5')
var similarArtist = bae.get('select distinct * from tracks where artist LIKE "%'+searchInput.text+'%" limit 3')
var similarAlbum= bae.get('select distinct * from tracks where album LIKE "%'+searchInput.text+'%" limit 3')
var similarTracks = bae.get('select distinct * from tracks where title LIKE "%'+searchInput.text+'%" limit 3')
var checkList = []
for(var i in similarArtist)
if(checkList.indexOf("artist: "+similarArtist[i].artist) < 0)
{
checkList.push("artist: "+similarArtist[i].artist)
suggestionsList.model.append({suggestion: "artist: "+similarArtist[i].artist})
}
for(i in similarAlbum)
if(checkList.indexOf("album: "+similarAlbum[i].album) < 0)
{
checkList.push("album: "+similarAlbum[i].album)
suggestionsList.model.append({suggestion: "album: "+similarAlbum[i].album})
}
for(i in similarTracks)
if(checkList.indexOf("title: "+similarTracks[i].title) < 0)
{
checkList.push("title: "+similarTracks[i].title)
suggestionsList.model.append({suggestion: "title: "+similarTracks[i].title})
}
}
if(savedQueries.length>0)
for(i=0; i < 3; i++)
if(i < savedQueries.length )
suggestionsList.model.append({suggestion: savedQueries[i]})
}
}
......@@ -15,24 +15,24 @@ Item
property var searchRes : []
property var savedQueries : []
function runSearch()
function runSearch(searchTxt)
{
if(searchInput.text)
if(searchInput.text !== searchTable.headerBarTitle)
if(searchTxt)
if(searchTxt !== searchTable.headerBarTitle)
{
suggestionsPopup.close()
if(savedQueries.indexOf(searchInput.text) < 0)
if(savedQueries.indexOf(searchTxt) < 0)
{
savedQueries.unshift(searchInput.text)
// suggestionsPopup.model.insert(0, {suggestion: searchInput.text})
savedQueries.unshift(searchTxt)
// suggestionsPopup.model.insert(0, {suggestion: searchInput.text})
bae.saveSetting("QUERIES", savedQueries.join(","), "BABE")
}
var query = searchInput.text
searchTable.headerBarTitle = '"'+query+"'"
var queries = query.split(",")
searchTable.headerBarTitle = searchTxt
var queries = searchTxt.split(",")
searchRes = bae.searchFor(queries)
populate(searchView.searchRes)
searchTable.forceActiveFocus()
suggestionsPopup.close()
}
}
......@@ -64,6 +64,17 @@ Item
y: -(height+contentMargins*2)
}
Rectangle
{
visible: suggestionsPopup.visible
width: parent.width
height: parent.height-searchBox.height
color: darkDarkColor
z: 999
opacity: 0.5
}
Rectangle
{
anchors.fill: parent
......@@ -81,12 +92,13 @@ Item
Layout.fillWidth: true
trackNumberVisible: false
headerBarVisible: true
headerBarExit: false
headerBarExit: true
headerBarExitIcon: "edit-clear"
holder.message: "No search results!"
coverArtVisible: true
trackDuration: true
trackRating: true
onExit: clearSearch()
}
Rectangle
......@@ -121,7 +133,7 @@ Item
Layout.leftMargin: contentMargins
visible: true
iconName: "view-filter"
onClicked: {}
onClicked: suggestionsPopup.visible ? suggestionsPopup.close() : suggestionsPopup.open()
}
TextInput
......@@ -135,18 +147,20 @@ Item
selectByMouse: !root.isMobile
selectionColor: babeHighlightColor
selectedTextColor: foregroundColor
//focus: true
focus: true
text: ""
wrapMode: TextEdit.Wrap
//activeFocusOnPress: true
onAccepted: runSearch()
onTextChanged: if(searchInput.text.length>0) suggestionsPopup.open()
onAccepted: runSearch(searchInput.text)
// onActiveFocusChanged: activeFocus ? suggestionsPopup.open() : suggestionsPopup.close()
onTextEdited: if(suggestionsPopup.visible) suggestionsPopup.updateSuggestions()
}
BabeButton
{
Layout.rightMargin: contentMargins
iconName: "edit-clear"
onClicked: clearSearch()
onClicked: searchInput.clear()
}
}
}
......
......@@ -9,6 +9,7 @@ import "../../view_models"
BabePopup
{
id: babeConsoleRoot
closePolicy: Popup.NoAutoClose
modal: false
......@@ -20,42 +21,57 @@ BabePopup
background: Rectangle
{
color: darkDarkColor
border.color: "#111"
color: darkDarkColor
border.color: "#111"
}
ColumnLayout
{
id: consoleLayout
anchors.fill: parent
spacing: 0
BabeButton
{
Layout.alignment: Qt.AlignLeft
Layout.margins: contentMargins
Layout.leftMargin: contentMargins
iconColor: darkForegroundColor
anim : true
iconName : "dialog-close"
onClicked : close()
}
TextArea
ScrollView
{
id: consoletext
Layout.fillHeight: true
Layout.fillWidth: true
readOnly: true
font.pointSize: fontSizes.small
background: Rectangle
{
color: darkDarkColor
implicitWidth: 200
implicitHeight: 40
}
Layout.fillHeight: true
Layout.margins: contentMargins
clip: true
contentWidth: babeConsoleRoot.width
contentHeight: consoletext.height
color: darkForegroundColor
ScrollBar.horizontal.policy: ScrollBar.AlwaysOff
TextArea
{
id: consoletext
width: babeConsoleRoot.width
Layout.fillHeight: true
Layout.fillWidth: true
readOnly: true
font.pointSize: fontSizes.small
wrapMode: TextEdit.WordWrap
background: Rectangle
{
color: darkDarkColor
implicitWidth: 200
implicitHeight: 40
}
color: darkForegroundColor
}
}
}
......
......@@ -157,6 +157,19 @@ Kirigami.GlobalDrawer
}
}
}
Kirigami.Action
{
text: "Autoplay"
checked: autoplay
checkable: true
onToggled:
{
autoplay = checked
bae.saveSetting("AUTOPLAY", autoplay ? true : false, "BABE")
}
}
},
Kirigami.Action
......
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