Commit 43541014 authored by Camilo higuita's avatar Camilo higuita

fix slide bar

parent acc7fae8
This diff is collapsed.
......@@ -346,3 +346,15 @@ bool TracksModel::countUp(const int &index)
return false;
}
bool TracksModel::remove(const int &index)
{
if(index >= this->list.size() || index < 0)
return false;
emit this->preItemRemoved(index);
this->list.removeAt(index);
emit this->postItemRemoved();
return true;
}
......@@ -64,6 +64,7 @@ public slots:
bool fav(const int &index, const bool &value);
bool rate(const int &index, const int &value);
bool countUp(const int &index);
bool remove(const int &index) override;
};
#endif // TRACKSMODEL_H
......@@ -238,7 +238,7 @@ BabeList
onRemoveClicked:
{
listModel.remove(listView.currentIndex)
list.remove(listView.currentIndex)
}
onRateClicked:
......
......@@ -16,9 +16,11 @@ ListView
currentIndex: currentTrackIndex
highlightFollowsCurrentItem: true
highlightMoveDuration: 0
snapMode:ListView.SnapToOneItem
snapMode: ListView.SnapToOneItem
model: mainPlaylist.listModel
highlightRangeMode: ListView.StrictlyEnforceRange
keyNavigationEnabled: true
keyNavigationWraps : true
onMovementEnded:
{
var index = indexAt(contentX, contentY)
......@@ -28,6 +30,8 @@ ListView
// positionViewAtIndex(index, ListView.Center)
}
// onCurrentIndexChanged: Player.playAt(currentIndex)
delegate: GridLayout
{
height: albumsRollRoot.height
......
......@@ -22,7 +22,6 @@ Maui.Page
property alias listModel: table.listModel
property alias listView : table.listView
property alias table: table
property alias progressBar: progressBar
property alias animFooter : animFooter
property alias menu : playlistMenu
......@@ -48,46 +47,12 @@ Maui.Page
footBar.visible: !mainlistEmpty
footBar.implicitHeight: toolBarHeight * 1.3
footBarItem: RowLayout
{
footBarItem: AlbumsRoll
{
anchors.fill : parent
anchors.rightMargin: space.small
anchors.leftMargin: space.small
AlbumsRoll
{
id: albumsRoll
Layout.fillHeight: true
Layout.fillWidth: true
}
// Maui.ToolButton
// {
// id: infoBtn
// iconName: "documentinfo"
// Layout.fillHeight: true
// onClicked:
// {
// if( stackView.currentItem !== table)
// {
// stackView.pop(table)
// albumsRoll.positionAlbum(currentTrackIndex)
// }else
// {
// stackView.push(infoView)
// }
// }
// }
// Maui.ToolButton
// {
// id: menuBtn
// iconName: "overflow-menu"
// onClicked: playlistMenu.popup()
// Layout.fillHeight: true
// }
anchors.rightMargin: space.small
id: albumsRoll
}
// footBar.rightContent: Maui.ToolButton
......@@ -234,60 +199,6 @@ Maui.Page
// list.currentIndex = pos
// play(list.model.get(pos))
}
}
Kirigami.Separator
{
Layout.fillWidth: true
color: borderColor
}
Slider
{
id: progressBar
height: unit * (isMobile ? 6 : 8)
width: parent.width
Layout.fillWidth: true
padding: 0
from: 0
to: 1000
value: player.pos
spacing: 0
focus: true
onMoved:
{
player.pos = value
}
background: Rectangle
{
implicitWidth: progressBar.width
implicitHeight: progressBar.height
width: progressBar.availableWidth
height: implicitHeight
color: "transparent"
Rectangle
{
width: progressBar.visualPosition * parent.width
height: progressBar.height
color: babeColor
}
}
handle: Rectangle
{
x: progressBar.leftPadding + progressBar.visualPosition
* (progressBar.availableWidth - width)
y: -(progressBar.height * 0.8)
implicitWidth: progressBar.pressed ? iconSizes.medium : 0
implicitHeight: progressBar.pressed ? iconSizes.medium : 0
radius: progressBar.pressed ? iconSizes.medium : 0
color: babeColor
}
}
Kirigami.Separator
......
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