Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#13496 closed bug (fixed)

The blue border for File Panel focus does not update correctly

Reported by: owenca Owned by: nobody
Priority: high Milestone: R1/beta1
Component: Kits/libtracker.so Version: R1/Development
Keywords: Tracker, BFilePanel Cc: axeld, waddlesplash, looncraz
Blocked By: Blocking:
Platform: All

Description

Press the Tab key to move the focus to the Cancel button: the blue border enclosing the file list does not disappear completely.

Now click another window to deactivate the file panel and then click the file panel to activate it again: the Cancel button still has the focus, but the file list is enclosed by the blue border as if it had the focus, too.

Please see the attached screenshots.

might be related to #12923

Attachments (8)

Expander 1.png (47.5 KB ) - added by owenca 8 years ago.
Expander 2.png (51.0 KB ) - added by owenca 8 years ago.
Save as.png (29.2 KB ) - added by owenca 8 years ago.
Expander now.png (24.8 KB ) - added by owenca 8 years ago.
Save as now.png (26.7 KB ) - added by owenca 8 years ago.
Expander new.png (24.8 KB ) - added by owenca 8 years ago.
Save as after FilePanelSettings removed.png (26.9 KB ) - added by owenca 8 years ago.
0001-Tracker-Fix-blue-border-for-focus-in-file-panel.patch (2.0 KB ) - added by owenca 8 years ago.

Download all attachments as: .zip

Change History (27)

by owenca, 8 years ago

Attachment: Expander 1.png added

by owenca, 8 years ago

Attachment: Expander 2.png added

comment:2 by owenca, 8 years ago

comment:3 by owenca, 8 years ago

Also, the Save File Panel has two blue bordered boxes (file list and file name) when first activated. Please see the attached screenshot.

by owenca, 8 years ago

Attachment: Save as.png added

comment:4 by looncraz, 8 years ago

Thanks for finding this.

This is easy to reproduce, but I can't see, yet, why it's happening.

BPoseView::MakeFocus() calls BorderedView::PoseViewFocused() whose logic works fine everywhere else (and is simple enough).

My only thought is that it is somehow not being called when focus is being lost when the view is part of the TFilePanel BWindow. I will continue to investigate this.

comment:5 by owenca, 8 years ago

patch: 01

comment:6 by owenca, 8 years ago

Fixed! Please see the attached patch.

by owenca, 8 years ago

Attachment: Expander now.png added

by owenca, 8 years ago

Attachment: Save as now.png added

by owenca, 8 years ago

Attachment: Expander new.png added

comment:7 by owenca, 8 years ago

Please see the attached screenshots after the fix.

comment:8 by looncraz, 8 years ago

Awesome! I was just refreshing to the latest hrev and you have a patch :p

BContainerWindow* window = dynamic_cast<BContainerWindow*>(Window());

If you're going to use dynamic_cast you should probably check for NULL. In this case, though, I'd think that static_cast would be more appropriate.

Also, the "Save as now" seems to be missing the border entirely, which might just be the color choice (probably changing color_which base = B_DOCUMENT_BACKGROUND_COLOR to B_PANEL_BACKGROUND_COLOR on line 4418 of ContainerWindow.cpp will resolve that).

in reply to:  8 ; comment:9 by owenca, 8 years ago

Replying to looncraz:

BContainerWindow* window = dynamic_cast<BContainerWindow*>(Window());

If you're going to use dynamic_cast you should probably check for NULL. In this case, though, I'd think that static_cast would be more appropriate.

I copied the code from BorderedView::PoseViewFocused() at line 4416 but forgot to copy the two lines below it that check for NULL. I will fix it. Should I still use dynamic_cast just to be consistent?

Also, the "Save as now" seems to be missing the border entirely, which might just be the color choice (probably changing color_which base = B_DOCUMENT_BACKGROUND_COLOR to B_PANEL_BACKGROUND_COLOR on line 4418 of ContainerWindow.cpp will resolve that).

I just tested it a little more, and this is what happens:

  • Remove ~/config/settings/Tracker/FilePanelSettings.
  • Run Pe and open the Save as... panel. The border is fine. See the attached screenshot "Save as after FilePanelSettings removed" below.
  • Now quit Pe and then run it again. The border in the Save as... panel is messed up as shown in the previously attached screenshot "Save as now".

This only occurs in Save file panel. The Open file panel has no problem.

in reply to:  9 ; comment:10 by looncraz, 8 years ago

Replying to owenca:

I copied the code from BorderedView::PoseViewFocused() at line 4416 but forgot to copy the two lines below it that check for NULL. I will fix it. Should I still use dynamic_cast just to be consistent?

I think that would be the way to go, it's just a minor run time penalty (a handful of cycles) in any event. If someone wants to improve efficiency, let them do that separately ;-)

I just tested it a little more, and this is what happens:

  • Remove ~/config/settings/Tracker/FilePanelSettings.
  • Run Pe and open the Save as... panel. The border is fine. See the attached screenshot "Save as after FilePanelSettings removed" below.
  • Now quit Pe and then run it again. The border in the Save as... panel is messed up as shown in the previously attached screenshot "Save as now".

This only occurs in Save file panel. The Open file panel has no problem.

Very strange. I will have to run some tests when you post an updated patch to wrap my mind around what you're describing.

in reply to:  10 comment:11 by owenca, 8 years ago

Very strange. I will have to run some tests when you post an updated patch to wrap my mind around what you're describing.

Do you want me to include in my next patch your suggestion of "changing color_which base = B_DOCUMENT_BACKGROUND_COLOR to B_PANEL_BACKGROUND_COLOR on line 4418 of ContainerWindow.cpp"?

comment:12 by owenca, 8 years ago

New patch attached, with B_DOCUMENT_BACKGROUND_COLOR changed to B_DOCUMENT_BACKGROUND_COLOR.

The border problem with Save file panel is still there.

in reply to:  9 ; comment:13 by humdinger, 8 years ago

Replying to owenca:

I just tested it a little more, and this is what happens:

  • Remove ~/config/settings/Tracker/FilePanelSettings.
  • Run Pe and open the Save as... panel. The border is fine. See the attached screenshot "Save as after FilePanelSettings removed" below.
  • Now quit Pe and then run it again. The border in the Save as... panel is messed up as shown in the previously attached screenshot "Save as now".

Sounds like what Giovanni reported in #13497.

in reply to:  13 ; comment:14 by owenca, 8 years ago

The broken border of the Save panel was in hrev51166 already, so it's not caused by the patch.

comment:15 by owenca, 8 years ago

Please see the latest patch above, with B_DOCUMENT_BACKGROUND_COLOR unchanged.

in reply to:  14 comment:16 by owenca, 8 years ago

Replying to owenca:

The broken border of the Save panel was in hrev51166 already, so it's not caused by the patch.

Also, it's likely that only Pe has this problem. StyleEdit is fine.

in reply to:  14 comment:17 by owenca, 8 years ago

Replying to owenca:

The broken border of the Save panel was in hrev51166 already, so it's not caused by the patch.

Created a ticket #13521

comment:18 by owenca, 8 years ago

looncraz: apply the patch and close this ticket?

comment:19 by waddlesplash, 8 years ago

Resolution: fixed
Status: newclosed

Applied in hrev51174. Thanks!

in reply to:  18 comment:20 by looncraz, 8 years ago

Replying to owenca:

looncraz: apply the patch and close this ticket?

Looks like waddlesplash beat me to it :p

Note: See TracTickets for help on using tickets.