Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#11285 closed Bug Report - General (fixed)

Removing the last item in a MythUIButtonList doesn't update the display

Reported by: paulh <mythtv@…> Owned by: jpoet
Priority: minor Milestone: 0.27
Component: MythTV - User Interface Library Version: Master Head
Severity: medium Keywords:
Cc: Ticket locked: no

Description

If you remove items from a buttonlist by calling MythUIButtonList::RemoveItem?() everything updates properly up to removing the last item which gets removed but the screen doesn't update to reflect that.

Easiest way to reproduce is in MythMusics? playlist editor screen add a few tracks to the playlist and then remove them one by one.

I can work around this for now by calling MythUIButtonList::Reset() instead of RemoveItem?() if there is only one item left in the buttonlist but it would be nice to get this fixed. I'm 95% sure this is a regression.

Attachments (1)

11285_v1.diff (834 bytes) - added by paulh 11 years ago.
Proposed patch - if there are no items make all the buttons invisible

Download all attachments as: .zip

Change History (13)

comment:1 Changed 11 years ago by Kenni Lund [kenni a kelu dot dk]

Related to #8441?

comment:2 Changed 11 years ago by stuartm

Status: newaccepted

comment:3 Changed 11 years ago by stuartm

Milestone: unknown0.27
Status: acceptedinfoneeded

Paul I cannot reproduce in current master, I reverted the Reset() line in musiccommon.cpp so that it would only call RemoveItem?(). When I removed the last item it disappeared from screen.

Could you check whether this is still a problem for you?

comment:4 Changed 11 years ago by paulh

Status: infoneededassigned

Still behaves the same here with the Reset() removed the last item remains on screen after being removed from the list.

comment:5 Changed 11 years ago by stuartm

Which UI painter are you using?

comment:6 in reply to:  5 Changed 11 years ago by paulh

Replying to stuartm:

Which UI painter are you using?

OpenGL painter with MythCenter?-wide theme.

comment:7 Changed 11 years ago by paulh

My guess is you can't see it because your theme is using a different <arrange> method for the buttons. The fixed arrange method works all the others are broken.

The difference seems to be fixed calls CalculateButtonPositions?() which always makes sure any unused buttons are made invisible. The other arrange methods call DistributeButtons?() which doesn't always made unused buttons invisible.

Changed 11 years ago by paulh

Attachment: 11285_v1.diff added

Proposed patch - if there are no items make all the buttons invisible

comment:8 Changed 11 years ago by jpoet

Owner: changed from stuartm to jpoet
Status: assignedaccepted

comment:9 Changed 11 years ago by Paul Harrison <pharrison@…>

Resolution: fixed
Status: acceptedclosed

In d982be7d414da2678521137e08849186921a8369/mythtv:

MythUIButtonlist: fix removing the last item using RemoveItem?()

All arrange methods except the fixed one failed to make the last button
invisible when the last item was removed.

Fixes #11285.

comment:10 Changed 11 years ago by Paul Harrison <pharrison@…>

In fcfe312b33653772346012973282b5750f38d406/mythtv:

MythUIButtonlist: fix removing the last item using RemoveItem?()

All arrange methods except the fixed one failed to make the last button
invisible when the last item was removed.

Fixes #11285.

(cherry picked from commit d982be7d414da2678521137e08849186921a8369)

comment:11 Changed 11 years ago by Paul Harrison <pharrison@…>

In 2f3cd3cfc36a44c6676fcdb6e48437ef627b237c/mythtv:

MusicCommon?: remove the workaround to remove the last track

Refs #11285.

comment:12 Changed 11 years ago by Paul Harrison <pharrison@…>

In 5d4fb28fc096f950df3a6a56b81dc9456dcdf32c/mythtv:

MusicCommon?: remove the workaround to remove the last track

Refs #11285.

(cherry picked from commit 2f3cd3cfc36a44c6676fcdb6e48437ef627b237c)

Note: See TracTickets for help on using tickets.