Opened 12 years ago

Closed 11 years ago

#1816 closed bug (fixed)

Tracker doesn't properly redraw modified date column when date&time format changed (seems easy)

Reported by: hma Owned by: aldeck
Priority: normal Milestone: R1
Component: Applications/Tracker Version: R1/pre-alpha1
Keywords: Cc:
Blocked By: Blocking: #2608
Has a Patch: no Platform: x86


Set a Tracker window so that you can see the modified date & time column. Go to preferences / Date time and change date or time format.

Tracker draws new date and time on top of previous date and time.

Attachments (1)

tracker_date-time.diff (1.4 KB ) - added by herdemir 11 years ago.

Download all attachments as: .zip

Change History (12)

comment:1 by mmlr, 11 years ago

See the duplicate ticket #2553 for a screenshot.

comment:2 by axeld, 11 years ago

Blocking: 2608 added

(In #2608) Duplicate of #1816.

comment:3 by ekdahl, 11 years ago

It applies to the other columns as well. You can see that the text edges get darker in the name column after the change, ie it draws over the old text.

by herdemir, 11 years ago

Attachment: tracker_date-time.diff added

comment:4 by herdemir, 11 years ago

Here is a patch that fixes it. Please review.

comment:5 by aldeck, 11 years ago

Thanks, having a look :)

comment:6 by aldeck, 11 years ago

Owner: changed from stippi to aldeck
Status: newassigned

Works great, it even solves a similar text drawing issue (and maybe more) when enlarging a tracker window when the view is already scrolled fully to the right or bottom :)

Calling Invalidate(columnRect) after DrawViewCommon(columnRect, true) in PoseView.cpp would redraw twice since Invalidate() triggers a Draw(). That could be solved by modifying the way the recalculateText thing works, ex: by adding a fUpdateTextWidgets boolean flag to PoseView . Then a simple call to Invalidate(columnRect) would suffice.

Other than that, i'm just missing a short explanation of what was causing the problem and your solution to it :) For example, i'm not sure why you set the mode to B_OP_OVER line 556.

Best regards.

comment:7 by aldeck, 11 years ago

Component: User InterfaceApplications/Tracker

comment:8 by herdemir, 11 years ago

Sorry for not to be clear. The problem lies completely in TextWidget::Draw(). When it draws directly it does not erase the background except for selected item(s). So the changed texts overlaps. I thought of erasing backgrounds for every Pose but that may have caused flickering for non-doublebuffered systems. So I just tried to Invalidate(columnRect) with proper changes to TextWidget or Invalidate() PoseView completely without changing any code in TextWidget. So i did go with first one.

Actually I'm new to BeOS/Haiku programming, so the patch may be not clean. Since I was using "code & trial" method (best way for learning IMO :P), I may have forgotten to change/remove some (extra) lines. So please remove the line 556 :).


in reply to:  6 comment:9 by diver, 11 years ago

Replying to aldeck:

Works great, it even solves a similar text drawing issue (and maybe more) when enlarging a tracker window when the view is already scrolled fully to the right or bottom :)

Do you mean #1849 by any chance?

comment:10 by aldeck, 11 years ago

replying to herdemir: Ok, thanks for the description :) i just wanted to know a bit more about the cause and the solution to speed up my understanding of your patch. In any case, your work is very apreciated, i'll have another "more in depth" look and apply it (maybe with a few small changes) tomorrow probably :) Thanks a lot!

replying to diver: Yes that's the one, thanks for the pointer :)

comment:11 by aldeck, 11 years ago

Resolution: fixed
Status: assignedclosed

Well, in the end, it took me several days to have a complete understanding of the problem(s), as it's often the case, there was a problem deeper in tracker (was here since the R5 days). Your patch apparently worked but there was a bug left (updating only visible poses), and it would sometimes leave the DrawingMode in a wrong mode, producing side effects (ex. drawing with OP_COPY when theres a background image)

The Invalidate() you added was enough to apparently fix the problem (although redrawing twice), in fact, your DrawingMode modifications had no effect on this even if it was a good starting point to try understanding #1849 :)

closing with hrev28402

Note: See TracTickets for help on using tickets.