Re: [Plib-devel] [RFC] changing slider behavior
Brought to you by:
sjbaker
From: Melchior F. <mf...@us...> - 2009-01-21 23:25:15
|
OK, so I've implemented both old and new ("modern") behavior. Actually, the former can be useful in some cases, where quick selection of an estimated value is desirable without having to grab a small slider handle. The old behavior is even default now. As the new behavior makes the slider position jump in fixed intervals, for which a new parameter was required, this parameter also decides whether old or new behavior should be used. In the Qt-Toolkit these big steps are called PageStep (while the small steps are called LineStep). I've used the same name: setPageStepSize(0); ... no step chosen -> use default (this is consistent with the already existing puRange::setStepSize(), where 0 also means to use a default) setPageStepSize(4); ... increase/decrease value by 4 if one clicks on the slider background rather than the slider handle setPageStepSize(-1); ... page steps disabled -> old behavior (this is default) The patch also fixes arrow highlighting in puaScrollBar. Somebody had started to implement that, but stopped half-way. This wasn't functional. Additionally, it reduced the slider minimum-width from 10px to 8px. (I had introduced the 10px a few years ago, but a bit smaller can't hurt.) Files on my homepage. I hope this helps to apply the changes, saving you from applying diffs manually. :-) ./src/pui/ http://members.aon.at/mfranz/plib/pu.h [45.2 kB] http://members.aon.at/mfranz/plib/puSlider.cxx [6.1 kB] ./src/puAux/ http://members.aon.at/mfranz/plib/puAuxScrollBar.cxx [9.3 kB] I'll submit the necessary changes do the HTML documentation in another patch. m. |