Make labels in header bar clickeable
ClosedPublic

Authored by januz on Jul 9 2018, 11:28 PM.

Details

Summary

This patch makes it possible to click on the song/album/artist name to enter the Now Playing/Album/Artist view in the corresponding album or artist.

Diff Detail

Repository
R255 Elisa
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
januz requested review of this revision.Jul 9 2018, 11:28 PM
januz created this revision.
januz added a reviewer: Elisa.Jul 9 2018, 11:28 PM
januz added a project: Elisa.
januz added a comment.EditedJul 9 2018, 11:32 PM

This patch isn't finished yet. I've come across a problem with the album view: the openOneAlbum() function requires a databaseID to get the album data but I have no way of getting that in the header bar. I looked around the headerbarmanager code for a bit but I have no idea how we could fetch that. Everything else works.

januz edited the summary of this revision. (Show Details)Jul 9 2018, 11:32 PM

This patch isn't finished yet. I've come across a problem with the album view: the openOneAlbum() function requires a databaseID to get the album data but I have no way of getting that in the header bar. I looked around the headerbarmanager code for a bit but I have no idea how we could fetch that. Everything else works.

I will take care of that hopefully before the end of the week. I have started working on it.

This patch isn't finished yet. I've come across a problem with the album view: the openOneAlbum() function requires a databaseID to get the album data but I have no way of getting that in the header bar. I looked around the headerbarmanager code for a bit but I have no idea how we could fetch that. Everything else works.

Did you continue working on this ?

januz updated this revision to Diff 40372.Aug 24 2018, 3:13 PM
  • Use new AlbumId data
januz added a comment.Aug 24 2018, 3:14 PM

This is mostly done too but there's still one small bug: when I go to the now playing view and then click on the album name it doesn't open the album, but only switches to the album view.
Still trying to figure this out

This is mostly done too but there's still one small bug: when I go to the now playing view and then click on the album name it doesn't open the album, but only switches to the album view.
Still trying to figure this out

@januz, @astippich does one of you want to finish this development ? That would be very nice to see it in the next version.

I'm currently quite busy with other things and would like to finish more of that before adding stuff to my todo list again...

I'll try to look into this again next weekend. I think Elisa was missing some way to go properly from Now Playing to a specific album view, so it went straight to all albums.

I tried to take another look at this, but after rebasing on master I started getting an error when building:

/home/januz/code/elisa/autotests/qabstractitemmodeltester.cpp:43:31: fatal error: private/qobject_p.h: No such file or directory
compilation terminated.
autotests/CMakeFiles/allalbumsmodeltest.dir/build.make:62: recipe for target 'autotests/CMakeFiles/allalbumsmodeltest.dir/qabstractitemmodeltester.cpp.o' failed

I think you need to install the Qt5CorePrivate development files

mgallien updated this revision to Diff 54676.Mar 24 2019, 1:41 PM
  • use current API to switch views

Update it to work with current ViewManager class

mgallien updated this revision to Diff 54677.Mar 24 2019, 1:49 PM
  • do not expand labels in header bar but let them grow with the text

avoid having the MouseArea zone expand longer than the text

mgallien accepted this revision.Mar 24 2019, 1:50 PM

@januz are you OK with me landing your patch ?

This revision is now accepted and ready to land.Mar 24 2019, 1:50 PM
mgallien retitled this revision from [WIP] Make labels in header bar clickeable to Make labels in header bar clickeable.Mar 24 2019, 1:50 PM
januz added a comment.Mar 24 2019, 9:47 PM

@mgallien Hey, sure! Thanks for finishing it

This revision was automatically updated to reflect the committed changes.

@mgallien Hey, sure! Thanks for finishing it

Thanks for your contribution. It is nice to have and made me fix quite some bugs in ViewManager class.