Opened 8 years ago

Closed 8 years ago

#7035 closed bug (fixed)

BPictureButton Archiving is broken

Reported by: MrSunshine Owned by: stippi
Priority: normal Milestone: R1
Component: User Interface Version: R1/Development
Keywords: Cc:
Blocked By: Blocking:
Has a Patch: no Platform: All

Description

Was tinkering with BPictureButton archiving, and it seems that the archiving code is wrong.

when archiving using the disabled buttons pictures also all of the underlaying pictures gets a copy of the pictures above them

so _e_on will be fine,

_e_off will first have _e_on's data then _e_off data,

_d_on will have _e_on, _e_off, _d_on

_d_off will have _e_on, _e_off, _d_on, _d_off data

this results in after archiving and unarchiving a BPictureButton, allt he button states will have the picture of _e_on

http://haiku.it.su.se:8180/source/xref/src/kits/interface/PictureButton.cpp#82

here you might see what i mean, the pictureArchive is never cleared between the adds, so each AddMessage to it will just add another message, then there will be two, three, four messages and each time they are ALL added to the archive.

i hope i explained clearly enough what is happening here =)

Change History (5)

comment:1 Changed 8 years ago by MrSunshine

Just like i thought, adding a archivedPicture.MakeEmpty() between each of the buttons and it works flawlessly =) tho my fix might not be as you guys want it =)

comment:2 Changed 8 years ago by jackburton

You're definitely right. pictureArchive needs to be emptied after every AddMessage() call.

Last edited 8 years ago by jackburton (previous) (diff)

comment:3 Changed 8 years ago by jackburton

Should be fixed in hrev39981. Please check.

comment:4 Changed 8 years ago by MrSunshine

Exacly like ive done it in my haiku source and it works fine =)

comment:5 Changed 8 years ago by jackburton

Resolution: fixed
Status: newclosed

Let's close it, then.

Note: See TracTickets for help on using tickets.