Discussion:
[patch] Scrollbar thickness from dillorc
podarcis
2013-01-20 15:01:11 UTC
Permalink
Scrollbars currently have the hardcoded thickness 15. This can be too
small to operate dillo on large screens or with fingers on a touch
screen.

The supplied patch does the following:

- Adds the prefence "scrollbar_tickness" to dillorc.

- Reads the value into the prefences
(Note: added a type UINT32 to prefsparse.cc)

- Sets this value to the FltkViewport with the new
method FltkViewport::setScrollbarThickness().

Note: I deliberately did no check for value 0, which can therefore be
used to make the scrollbars invisible. Scrolling can then still be
achieved with the cursor keys. This could be called a feature.

Cheers,
podarcis
corvid
2013-01-20 18:06:13 UTC
Permalink
Post by podarcis
Scrollbars currently have the hardcoded thickness 15. This can be too
small to operate dillo on large screens or with fingers on a touch
screen.
- Adds the prefence "scrollbar_tickness" to dillorc.
- Reads the value into the prefences
(Note: added a type UINT32 to prefsparse.cc)
- Sets this value to the FltkViewport with the new
method FltkViewport::setScrollbarThickness().
Note: I deliberately did no check for value 0, which can therefore be
used to make the scrollbars invisible. Scrolling can then still be
achieved with the cursor keys. This could be called a feature.
Just curious whether you've experimented with incorporating
Fl::scrollbar_size() into this.


Aside: A few years ago, there was a little bit of discussion now and
then about improving the UI for touch, but unfortunately it would all
die down without us getting much further than "Hmm, that's an
interesting idea..."
podarcis
2013-01-20 18:42:35 UTC
Permalink
Post by corvid
Just curious whether you've experimented with incorporating
Fl::scrollbar_size() into this.
My initial idea was indeed to just set Fl::scrollbar_size() from the
prefences and use it from the rest of the code.

But then I decided against, because of several reasons:
- there is code in FltkViewport that (though unused) tries to make
different vertical/horizontal scrollbar widths possible.
- the current code seems not to use any of the FLTK scrollbar_size()
methods, not even Fl_Scrollbar::scrollbar_size(), so I thought this is
intentional.
- anyway I wanted the change to be small and close to the existing
implementation.
Post by corvid
Aside: A few years ago, there was a little bit of discussion now and
then about improving the UI for touch, but unfortunately it would all
die down without us getting much further than "Hmm, that's an
interesting idea..."
Yes, of course, if you want to make the rest of the UI also fit for
touchscreen then there's much to do. All those tiny buttons are
unsuitable.
I mostly intend to use dillo in fullscreen mode, where all controls are
hidden, so scrollbars are nearly the only problem.

Cheers,
podarcis
Johannes Hofmann
2013-01-21 21:09:33 UTC
Permalink
Post by podarcis
Scrollbars currently have the hardcoded thickness 15. This can be too
small to operate dillo on large screens or with fingers on a touch
screen.
- Adds the prefence "scrollbar_tickness" to dillorc.
- Reads the value into the prefences
(Note: added a type UINT32 to prefsparse.cc)
- Sets this value to the FltkViewport with the new
method FltkViewport::setScrollbarThickness().
Note: I deliberately did no check for value 0, which can therefore be
used to make the scrollbars invisible. Scrolling can then still be
achieved with the cursor keys. This could be called a feature.
I like the idea and want to commit this if no one objects.
Some issues I see with the current patch:

* I would rather drop PREFS_UINT32 and simply use
PREFS_INT32 instead. But if we want to keep it, it should warn if
a negative value is assigned to a PREFS_UINT32 variable.
* Similarily in dw/* I would use int instead of size_t. We also use
int for width and height as does fltk.
* In C++ code we use camel cased variables and paramters, so it
should be scrollbarThickness in dw/*.
* I'd make the scrollbarThickness member in FltkViewport non-static
and it should be private.

I especially like that one can set scrollbar_thickness to 0 in
dillorc.

Cheers,
Johannes
corvid
2013-01-21 23:00:06 UTC
Permalink
Post by Johannes Hofmann
Post by podarcis
Scrollbars currently have the hardcoded thickness 15. This can be too
small to operate dillo on large screens or with fingers on a touch
screen.
- Adds the prefence "scrollbar_tickness" to dillorc.
- Reads the value into the prefences
(Note: added a type UINT32 to prefsparse.cc)
- Sets this value to the FltkViewport with the new
method FltkViewport::setScrollbarThickness().
Note: I deliberately did no check for value 0, which can therefore be
used to make the scrollbars invisible. Scrolling can then still be
achieved with the cursor keys. This could be called a feature.
I like the idea and want to commit this if no one objects.
* I would rather drop PREFS_UINT32 and simply use
PREFS_INT32 instead. But if we want to keep it, it should warn if
a negative value is assigned to a PREFS_UINT32 variable.
* Similarily in dw/* I would use int instead of size_t. We also use
int for width and height as does fltk.
* In C++ code we use camel cased variables and paramters, so it
should be scrollbarThickness in dw/*.
* I'd make the scrollbarThickness member in FltkViewport non-static
and it should be private.
No objection to having the preference, although I note that, with the
patch as it is:

- if I set the thickness to something like fifty, there is text hidden
under the scrollbar that I can see if I drag the page.
Putting the setScrollbarThickness() earlier in UIcmd_tab_new() seems
to fix it.
- if I set the thickness to a negative number, dragging can make the
page unreadable if the page is narrow enough that it wants a horizontal
scrollbar (not that we'd permit negative values).

Loading...