Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

progressmeter step size

3 views
Skip to first unread message

Jaroslav Záruba

unread,
Nov 9, 2009, 10:57:04 AM11/9/09
to
Hello
Am I doing something wrong or are there some steps defined on
progressmeter which prevent it from progressing pixel by pixel?

Igor Tandetnik

unread,
Nov 9, 2009, 11:55:26 AM11/9/09
to
Jaroslav Záruba <jarosla...@gmail.com> wrote:
> Am I doing something wrong or are there some steps defined on
> progressmeter which prevent it from progressing pixel by pixel?

The "value" property of progress meter is a percentage, so it can't advance by less than 1/100 of its length. I guess yours is wider than 100 pixels.

Igor Tandetnik

Neil Deakin

unread,
Nov 9, 2009, 12:15:31 PM11/9/09
to
Igor Tandetnik wrote:

You can change the maximum by using max="1000" for example.

Igor Tandetnik

unread,
Nov 9, 2009, 12:30:55 PM11/9/09
to
Neil Deakin <ennd...@sympatico.ca> wrote:
> Igor Tandetnik wrote:

>> Jaroslav Záruba <jarosla...@gmail.com> wrote:
>>> Am I doing something wrong or are there some steps defined on
>>> progressmeter which prevent it from progressing pixel by pixel?
>>
>> The "value" property of progress meter is a percentage, so it can't
>> advance by less than 1/100 of its length. I guess yours is wider
>> than 100 pixels.
>
> You can change the maximum by using max="1000" for example.

Are you sure? I'm looking at the XBL binding, and I see 100 hardcoded everywhere, and nary a "max" in sight:

http://mxr.mozilla.org/mozilla/source/toolkit/content/widgets/progressmeter.xml

Igor Tandetnik

Message has been deleted

Jaroslav Záruba

unread,
Nov 11, 2009, 4:25:52 AM11/11/09
to
On Nov 9, 6:30 pm, "Igor Tandetnik" <itandet...@mvps.org> wrote:

> Neil Deakin <enndea...@sympatico.ca> wrote:
> > Igor Tandetnik wrote:
> >> Jaroslav Záruba <jaroslav.zar...@gmail.com> wrote:
> >>> Am I doing something wrong or are there some steps defined on
> >>> progressmeter which prevent it from progressing pixel by pixel?
>
> >> The "value" property of progress meter is a percentage, so it can't
> >> advance by less than 1/100 of its length. I guess yours is wider
> >> than 100 pixels.  
>
> > You can change the maximum by using max="1000" for example.
>
> Are you sure? I'm looking at the XBL binding, and I see 100 hardcoded everywhere, and nary a "max" in sight:
>
> http://mxr.mozilla.org/mozilla/source/toolkit/content/widgets/progres...
>
> Igor Tandetnik

That seems to be the answer. Somehow I expected the progressmeter to
accept floats. Obviously I was wrong. :)
Thanks Igor!

Jaroslav Záruba

unread,
Nov 11, 2009, 4:27:30 AM11/11/09
to
On Nov 11, 10:25 am, Jaroslav Záruba <jaroslav.zar...@gmail.com>
wrote:

I must be doing something wrong. The progressmeter is 130px long and
the steps are like 3-4px.
I will try to isolate that to find out where did I messed it.

Neil

unread,
Nov 11, 2009, 10:43:17 AM11/11/09
to
Igor Tandetnik wrote:

>Jaroslav Z�ruba <jarosla...@gmail.com> wrote:
>
>
>>Am I doing something wrong or are there some steps defined on progressmeter which prevent it from progressing pixel by pixel?
>>
>>
>The "value" property of progress meter is a percentage, so it can't advance by less than 1/100 of its length.
>

Worse, the progressmeter is "rate-limited" so you can only progress by
at least 4 since the last progress.

--
Warning: May contain traces of nuts.

Igor Tandetnik

unread,
Nov 11, 2009, 12:24:11 PM11/11/09
to
Jaroslav Záruba <jarosla...@gmail.com> wrote:
> On Nov 11, 10:25 am, Jaroslav Záruba <jaroslav.zar...@gmail.com>
> wrote:
>> On Nov 9, 6:30 pm, "Igor Tandetnik" <itandet...@mvps.org> wrote:
>>> Are you sure? I'm looking at the XBL binding, and I see 100
>>> hardcoded everywhere, and nary a "max" in sight:
>>
>>> http://mxr.mozilla.org/mozilla/source/toolkit/content/widgets/progres...
>>
> I must be doing something wrong. The progressmeter is 130px long and
> the steps are like 3-4px.

If you look at the binding, there's this code:

var delta = p - c;
if (delta < 0)
delta = -delta;
if (delta > 3 || p == 0 || p == 100) {
this.setAttribute("value", p);
...
}

so it only actually progresses by three ticks at a time. You can probably fool it by going 4 ticks backward then 5 ticks forward, or something along these lines.

Igor Tandetnik

Tei

unread,
Nov 11, 2009, 12:48:07 PM11/11/09
to dev-te...@lists.mozilla.org


uh.. ugly.

or since seems a "simple" feature, implement it yourself. It has to
be easy to.. I don't know, move a red box inside a white box, or
something.


maybe, even ripping some code from the xbl itself.. (but removing
everything you don't understand)
<xul:stack class="progress-remainder" flex="1" anonid="stack"
style="overflow: -moz-hidden-unscrollable;">
<xul:spacer class="progress-bar" anonid="spacer" top="0"
style="margin-right: -1000px;"/>
</xul:stack>

--
--
ℱin del ℳensaje.

0 new messages