Commit 11455cc0 authored by Camilo Higuita's avatar Camilo Higuita

put together missing ui parts

parent a0503784
......@@ -31,10 +31,11 @@ Kirigami.ApplicationWindow
/*PLAYBACK*/
property bool shuffle : false
property var currentTrack : ({babe:0, stars: 0})
property var currentTrack : ({babe: "0", stars: "0"})
property int currentTrackIndex : 0
property int prevTrackIndex : 0
property string currentArtwork
property bool currentBabe : currentTrack.babe == "0" ? false : true
property bool timeLabels : false
......@@ -156,10 +157,7 @@ Kirigami.ApplicationWindow
if(isMobile) settingsDrawer.switchColorScheme(bae.loadSetting("THEME", "BABE", "Dark"))
}
BabeNotify
{
id: babeNotify
}
BabeNotify { id: babeNotify }
BabeMessage
{
......@@ -230,13 +228,15 @@ Kirigami.ApplicationWindow
bgColor: isMobile && pageStack.currentIndex === 0 && !pageStack.wideMode ? babeColor : babeAltColor
textColor: isMobile && pageStack.currentIndex === 0 && !pageStack.wideMode ? "#FFF" : bae.foregroundColor()
onPlaylistViewClicked:
{
if(!isMobile && pageStack.wideMode)
root.width = columnWidth
// onPlaylistViewClicked:
// {
// if(!isMobile && pageStack.wideMode)
// root.width = columnWidth
pageStack.currentIndex = 0
}
// pageStack.currentIndex = 0
// }
onSettingsViewClicked: settingsDrawer.visible ? settingsDrawer.close() :settingsDrawer.open()
onTracksViewClicked:
{
......@@ -304,8 +304,6 @@ Kirigami.ApplicationWindow
height: visible ? headerHeight : 0
visible: true
FastBlur
{
width: parent.width
......@@ -324,6 +322,23 @@ Kirigami.ApplicationWindow
color: midLightColor
opacity: opacityLevel
z: -999
Kirigami.Separator
{
Rectangle
{
anchors.fill: parent
color: Kirigami.Theme.viewFocusColor
}
anchors
{
left: parent.left
right: parent.right
top: parent.top
}
}
}
Slider
......@@ -346,17 +361,17 @@ Kirigami.ApplicationWindow
background: Rectangle
{
x: progressBar.leftPadding
y: progressBar.topPadding + progressBar.availableHeight / 2 - height / 2
y: progressBar.y
implicitWidth: 200
implicitHeight: 1
implicitHeight: 4
width: progressBar.availableWidth
height: implicitHeight
color: Kirigami.Theme.viewFocusColor
color: "transparent"
Rectangle
{
width: progressBar.visualPosition * parent.width
height: 2
height: 4
color: babeColor
}
}
......@@ -364,17 +379,17 @@ Kirigami.ApplicationWindow
handle: Rectangle
{
x: progressBar.leftPadding + progressBar.visualPosition * (progressBar.availableWidth - width)
y: progressBar.topPadding + progressBar.availableHeight / 2 - height / 2
implicitWidth: progressBar.pressed ? 16 : 0
implicitHeight: progressBar.pressed ? 16 : 0
radius: progressBar.pressed ? 16 : 0
y: progressBar.y-(height/2)
implicitWidth: 16
implicitHeight: 16
radius: 16
color: babeColor
}
Label
{
id: progressTime
anchors.top: parent.bottom
anchors.top: parent.top
anchors.right: parent.right
visible: timeLabels
horizontalAlignment: Qt.AlignHCenter
......@@ -382,7 +397,7 @@ Kirigami.ApplicationWindow
text: progressTimeLabel +" / "+durationTimeLabel
color: foregroundColor
font.pointSize: 6.5
padding: 2
padding: 0
elide: Text.ElideRight
}
}
......@@ -392,17 +407,20 @@ Kirigami.ApplicationWindow
anchors.fill: parent
width: parent.width
height: parent.height
Item
Rectangle
{
Layout.fillHeight: true
visible: (!pageStack.wideMode && pageStack.currentIndex !== 0) || !mainPlaylist.cover.visible
height: headerHeight
width: headerHeight
Image
{
visible: (!pageStack.wideMode && pageStack.currentIndex !== 0) || !mainPlaylist.cover.visible
height: parent.height
width: parent.height
anchors.verticalCenter: parent.verticalCenter
height: headerHeight
width: headerHeight
anchors.left: parent.left
anchors.verticalCenter: parent.verticalCenter
source:
{
if(currentArtwork)
......@@ -412,22 +430,36 @@ Kirigami.ApplicationWindow
fillMode: Image.PreserveAspectFit
cache: false
antialiasing: true
MouseArea
{
anchors.fill: parent
onClicked:
{
if(!isMobile && pageStack.wideMode)
root.width = columnWidth
pageStack.currentIndex = 0
}
}
}
}
Item
{
Layout.fillWidth: true
}
BabeButton
{
id: babeBtnIcon
iconName: "love" //"love-amarok"
iconColor: currentTrack.babe == "1" ? babeColor : defaultColor
iconColor: currentBabe ? babeColor : defaultColor
onClicked:
{
var value = mainPlaylist.list.contextMenu.babeIt(currentTrackIndex)
// iconColor = value ? babeColor : foregroundColor
currentTrack["babe"] = value ? "1" : "0"
currentTrack.babe = value ? "1" : "0"
currentBabe = value
}
}
......@@ -469,8 +501,6 @@ Kirigami.ApplicationWindow
{
Layout.fillWidth: true
}
}
}
......
......@@ -1674,7 +1674,7 @@ var Babe = {
"library-music": Icon.libraryMusic,
"view-media-playlist" : Icon.libraryMusic,
"application-menu": Icon.dotsVertical,
"application-menu": Icon.menu,
"games-config-options" : Icon.settings,
/*playback bar*/
......@@ -1696,7 +1696,6 @@ var Babe = {
"arrow-left":"\uf04D",
"overflow-menu": Icon.dotsVertical,
"application-menu" : Icon.dotsVertical,
"player-time": "\uf40C",
"search" : Icon.magnify,
"edit-find" : Icon.magnify,
......
......@@ -67,7 +67,7 @@ function nextTrack()
if(root.mainPlaylist.list.count>0)
{
var next = 0
if(root.mainPlaylist.shuffle)
if(root.shuffle)
next = shuffle()
else
next = root.mainPlaylist.list.currentIndex+1 >= root.mainPlaylist.list.count? 0 : root.mainPlaylist.list.currentIndex+1
......@@ -104,8 +104,7 @@ function playAt(index)
function quickPlay(track)
{
root.pageStack.currentIndex = 0
// root.pageStack.currentIndex = 0
appendTrack(track)
playAt(root.mainPlaylist.list.count-1)
root.mainPlaylist.list.positionViewAtEnd()
......
......@@ -25,6 +25,7 @@ ToolButton
height: iconSize
visible: !isMobile
source: isMobile ? "" : iconName
isMask: false
color: iconColor || defaultColor
}
......
......@@ -19,12 +19,12 @@ ListView
width: babeList.width
height: babeList.currentItem.height
color: babeHighlightColor
y: babeList.currentItem.y
// y: babeList.currentItem.y
}
focus: true
interactive: true
highlightFollowsCurrentItem: false
highlightFollowsCurrentItem: true
keyNavigationWraps: !isMobile
keyNavigationEnabled : !isMobile
......
......@@ -9,17 +9,17 @@ ScrollBar
active: true
focus: true
// visible: !root.isMobile
background : Rectangle
{
radius: 12
color: backgroundColor
}
// background : Rectangle
// {
// radius: 12
// color: backgroundColor
// }
contentItem: Rectangle
{
implicitWidth: 6
implicitHeight: 100
radius: width / 2
color: scrollBar.pressed ? babeHighlightColor: darkColor
}
// contentItem: Rectangle
// {
// implicitWidth: 6
// implicitHeight: 100
// radius: width / 2
// color: scrollBar.pressed ? babeHighlightColor: darkColor
// }
}
......@@ -146,12 +146,11 @@ ItemDelegate
Layout.margins: contentMargins
anchors.verticalCenter: parent.verticalCenter
GridLayout
{
anchors.fill: parent
rows:2
columns: sameAlbum ? 5 : 4
columns: sameAlbum ? 4 : 3
Label
{
......@@ -264,8 +263,9 @@ ItemDelegate
Layout.fillWidth: true
Layout.fillHeight: true
Layout.row: 1
Layout.column: trackDurationVisible && sameAlbum ? 5 : 4
Layout.column: trackDurationVisible && sameAlbum ? 4 : 3
horizontalAlignment: Qt.AlignRight
verticalAlignment: Qt.AlignVCenter
text: babe == "1" ? "\uf2D1" : ""
......@@ -312,7 +312,7 @@ ItemDelegate
Layout.fillHeight: true
Layout.alignment: Qt.AlignRight
Layout.row: trackRatingVisible && sameAlbum ? 1 : 2
Layout.column: 4
Layout.column: 3
// Layout.columnSpan: trackRatingVisible && sameAlbum ? 4 : 3
horizontalAlignment: Qt.AlignRight
verticalAlignment: Qt.AlignVCenter
......
......@@ -20,8 +20,9 @@ ToolBar
signal artistsViewClicked()
signal playlistsViewClicked()
signal babeViewClicked()
signal playlistViewClicked()
// signal playlistViewClicked()
signal searchViewClicked()
signal settingsViewClicked()
width: parent.width
id: babeBar
......@@ -53,20 +54,18 @@ ToolBar
{
anchors.fill: parent
BabeButton
{
id: playlistView
iconName: /*"headphones"*/ "media-optical-audio"
iconColor: (pageStack.wideMode || pageStack.currentIndex === 0 ) && !isMobile ? accentColor : textColor
onClicked: playlistViewClicked()
id: settingsView
iconName: /*"headphones"*/ /*"media-optical-audio"*/ "application-menu"
iconColor: settingsDrawer.visible ? babeColor : textColor/*(pageStack.wideMode || pageStack.currentIndex === 0 ) && !isMobile ? accentColor : textColor*/
onClicked: settingsViewClicked()/*playlistViewClicked()*/
hoverEnabled: !isMobile
ToolTip.delay: 1000
ToolTip.timeout: 5000
ToolTip.visible: hovered && !isMobile
ToolTip.text: qsTr("Playlist")
ToolTip.text: qsTr("Settings")
}
Item
......
......@@ -31,7 +31,7 @@ Item
function clearSearch()
{
searchInput.clear()
clearTable()
searchTable.clearTable()
searchTable.headerTitle = ""
searchRes = []
}
......@@ -70,6 +70,7 @@ Item
{
id: searchBox
Layout.fillWidth: true
width: parent.width
height: toolBarHeight
color: searchInput.activeFocus ? midColor : midLightColor
......@@ -89,25 +90,27 @@ Item
}
}
TextInput
RowLayout
{
id: searchInput
color: foregroundColor
anchors.fill: parent
anchors.centerIn: parent
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
selectByMouse: !root.isMobile
selectionColor: babeHighlightColor
selectedTextColor: foregroundColor
TextInput
{
id: searchInput
color: foregroundColor
Layout.fillWidth: true
Layout.fillHeight: true
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
selectByMouse: !root.isMobile
selectionColor: babeHighlightColor
selectedTextColor: foregroundColor
onAccepted: runSearch()
onAccepted: runSearch()
}
BabeButton
{
anchors.right: parent.right
anchors.verticalCenter: parent.verticalCenter
Layout.fillHeight: true
visible: searchInput.activeFocus
iconName: "edit-clear"
onClicked: clearSearch()
......
......@@ -8,7 +8,7 @@ import org.kde.kirigami 2.2 as Kirigami
Kirigami.GlobalDrawer
{
id: settingsView
handleVisible: true
handleVisible: false
signal iconSizeChanged(int size)
readonly property bool activeBrainz : bae.brainzState()
......@@ -19,14 +19,15 @@ Kirigami.GlobalDrawer
// interactive: true
// focus: true
modal:true
dragMargin :0
// dragMargin :0
topPadding: 0
bottomPadding: 0
leftPadding: 0
rightPadding: 0
handle.anchors.verticalCenter: parent.verticalCenter
// handle.y : 64
// handle.anchors.verticalCenter: parent.verticalCenter
// handle.anchors.top: parent.bottom
// handle.focus: false
// handle.y : coverSize
......
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