Closed Bug 506574 Opened 15 years ago Closed 15 years ago

component.repaint() is not working for "nested" components

Categories

(Skywriter Graveyard :: Thunderhead, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: julian.viereck, Unassigned)

Details

User-Agent:       Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_7; de-de) AppleWebKit/530.19.2 (KHTML, like Gecko) Version/4.0.2 Safari/530.19
Build Identifier: Tip

If you have a component, that is not in the root panel of the scene, it is *not* repainted by calling component.repaint();

Reproducible: Always

Steps to Reproduce:
1. Open the file browser by CMD+O
2. Select a file in the list
3. Move up and down with the arrow keys
Actual Results:  
The item above/belog the current selection only gets highlighted if this is a folder. If this is a file, it is *not* highlighted.

Expected Results:  
The item above/belog the current selection should get highlighted

Let's see:
- the folder are highlighted, because we fetch aditional information to show the information of the subfolder, which brings up a new list in the HorizontalTree and makes the whole scene to be rendered. In this case things get repainted and we see the folder highlighted
- if you hit the up/down arrow key the files are selected internal within the list, they just don't get painted/highlighted; the function component.repaint() is called, which should repaint/highlight the component
- component.repaint() doesn't work if you have a component within many panels, for example

<scene>
  <panel>
     <panel>
       <input>
    </panel>
  </panel>
</scene>

but if you call 

  component.getScene().render();

this works. The problem about this is you have do a repaint over the entire scene, which is bad in the case of the file browser (as there are *many* components!).
I have a patch for this here:

http://bitbucket.org/j4c/th/changeset/997a596d1d1d/

The issue is that if you have a folder opened and move to a file by the arrow keys the folder content stays there. I'm not sure if there is a repaint missing or if this patch destroys something else. But it should give a hint where to search for if you want to solve this bug.
I worked a little bit more on this and got things working for the horizontal tree as well now. Take a look here:

   http://bitbucket.org/j4c/th/changeset/3647e79685ff/

There is one bug still to this. If you have component this component might paint over the border of its parent. With the current clipping implementation in scene.pain() we can't fix that. But to me this seems to be just a minor bug to be fixed.
An additional patch to fix the mentioned problem noted in comment #2:

   http://bitbucket.org/j4c/th/changeset/6c18c9d76186/
Status: UNCONFIRMED → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
I improved the patch within comment #3 to work now in general right:

    http://bitbucket.org/j4c/th/changeset/2cdb90b4b991/
You need to log in before you can comment on or make changes to this bug.