PDA

View Full Version : ProgressBar text shadow off for progressbars that are initially hidden



maniac
15 Jul 2009, 5:17 AM
Hi,

I am currently trying to use a progress bar which is initially hidden and shown later on. When doing so, the shadow of the text in the progress bar is off because the div that contains it doesn't have the correct size. Example of generated HTML:


<div id="x-auto-111" class="x-progress-wrap x-progress ">
<div class="x-progress-inner">
<div class="x-progress-bar" style="width: 85px;">
<div class="x-progress-text " style="z-index: 99; width: 75px;">
<div>30%</div>
</div>
</div>
<div class="x-progress-text x-progress-text-back">
<div>30%</div>
</div>
</div>
</div>
You can see that x-progress-text has width 75, while x-progress-text-back has not.

The simplest test case I could come up with is this:


import com.extjs.gxt.ui.client.widget.Dialog;
import com.extjs.gxt.ui.client.widget.ProgressBar;
import com.google.gwt.user.client.Timer;

public class ProgressTestDialog extends Dialog {
private ProgressBar m_progress;

public ProgressTestDialog() {
setButtons(OKCANCEL);

m_progress = new ProgressBar();
m_progress.setVisible(false);
add(m_progress);
}

@Override
protected void onShow() {
Timer updateTimer = new Timer() {
float val = 0;

public void run() {
m_progress.updateProgress((double) val / 100, val + "%");
if (val < 100) {
val += 5;
}
}
};

updateTimer.scheduleRepeating(5000);

Timer showTimer = new Timer() {
public void run() {
m_progress.setVisible(true);
}
};

showTimer.schedule(4000);
}
}
My environment is Firefox 3.5 on Fedora 11. Any hints would be greatly appreciated.

Thanks,

Danny

Condor
15 Jul 2009, 6:21 AM
What happens if you set hideMode:'offsets' in the progressbar config?

maniac
15 Jul 2009, 11:38 PM
First, sorry for posting to the wrong forum. :">
Second, setting the hide mode to something else than DISPLAY (I tried VISIBILITY as well as OFFSETS) made the problem go away. This still feels like a Gxt bug to me, though... ;)

But anyway: Thanks!