Thread: [Vimprobable-users] suggested changes to implement zoom commands
Vimprobable is a lean web browser optimised for full keyboard control
Brought to you by:
hanness
|
From: Marcos C. <vim...@pr...> - 2013-05-02 14:13:54
|
Hi all,
I miss Vimprobable's windows to open with a certain zoom level, because
usually I need a bigger font size. Keymaps let zoom in and out, and it's
possible to choose an alternative CSS too, but I miss a simpler
solution: zoom commands I could add to the config file (and beside, they
would let to config new keymaps for zooming, currently hardcoded).
I've been tinkering with the code in order to understand how it works
and to make the desired changes -- and it worked. My C experience is
basic, so please check if I'm missing or breaking something, though the
changes are very simple:
In vimprobable.h, I increased COMMANDSIZE from 43 to 47:
----8<----------------------------------------------------------
#define COMMANDSIZE 47
----8<----------------------------------------------------------
In config.h, I added four new elements to the command mapping:
----8<----------------------------------------------------------
{ "scrolldown",scroll,{ScrollMove|DirectionBottom|UnitLine}},
{ "zoomin", zoom,{ZoomIn | ZoomText} },
{ "zoomout",zoom,{ZoomOut | ZoomText} },
{ "zi",zoom,{ZoomIn | ZoomText} },
{ "zo",zoom,{ZoomOut | ZoomText} }
----8<----------------------------------------------------------
Finally, I simply added as many commands as needed to my vimprobablerc
file:
----8<----------------------------------------------------------
zoomin
zoomin
zoomin
zoomin
----8<----------------------------------------------------------
I didn't investigated yet how to create a command to set the zoom level
to a certain value, say "zoom 120", but maybe I will.
Do you find these commands useful enough to be included in a future
version?
Marcos
--
http://programandala.net
|
|
From: Hannes S. <ha...@yl...> - 2013-05-02 17:01:48
|
Hi Marcos!
Marcos Cruz <vim...@pr...> wrote:
> I miss Vimprobable's windows to open with a certain zoom level,
> because usually I need a bigger font size. Keymaps let zoom in and
> out, and it's possible to choose an alternative CSS too, but I miss a
> simpler solution: zoom commands I could add to the config file (and
> beside, they would let to config new keymaps for zooming, currently
> hardcoded).
>
> { "zoomin", zoom,{ZoomIn | ZoomText} },
> { "zoomout",zoom,{ZoomOut | ZoomText} },
> { "zi",zoom,{ZoomIn | ZoomText} },
> { "zo",zoom,{ZoomOut | ZoomText} }
I'm a but surprised to find "zi" and "zo" there, as the same
combinations already exist as keybindings by default. What would be the
benefit to define them for the command line as well? Apart
from /having/ any command for this, that is, but that is covered by
"zoomin" and "zoomout" already. I'd say either zoomin/zoomout *or*
zi/zo would be enough, because that would then enable any user to have
additional aliases in the config file.
Any opinions on which combination to make default?
> Do you find these commands useful enough to be included in a future
> version?
I'd say this cannot hurt!
Just for the record, in case you didn't notice yet or in case someone
else is looking for help on this subject later. There are two settings
which might also be of help for these problems:
- fontsize defines the default font size (surprise, surprise) to be
used for websites. I.e. this will be the base size for any website
which uses relative measures (like em or %). It will, unfortunately,
not help on websites which define their fonts in absolute sizes (like
px or pt). I can't think of any good reason to do that, but there are
many sites which do.
- minimumfontsize lets you specify... you know what. This will also
override definitions made in absolute units - try it out!
Again, this does not invalidate the usefulness of what you're proposing.
Hannes
|
|
From: matto f. <ma...@ma...> - 2013-05-04 15:57:09
|
Hi, On 2 May 2013 19:01, Hannes Schüller <ha...@yl...> wrote: > Just for the record, in case you didn't notice yet or in case someone > else is looking for help on this subject later. There are two settings > which might also be of help for these problems: > > - fontsize defines the default font size (surprise, surprise) to be > used for websites. I.e. this will be the base size for any website > which uses relative measures (like em or %). It will, unfortunately, > not help on websites which define their fonts in absolute sizes (like > px or pt). I can't think of any good reason to do that, but there are > many sites which do. > > - minimumfontsize lets you specify... you know what. This will also > override definitions made in absolute units - try it out! In the config.h file before compiling I usually change the monospace font into terminus. IMHO this increases the readability a lot. Do this for the urlboxfont, completionfont and statusfont. This is a matter of personal taste, offcourse :) Cheers, Matto |
|
From: Marcos C. <vim...@pr...> - 2013-05-02 18:54:16
|
En/Je/On 2013-05-02 19:01, Hannes Schüller escribió / skribis / wrote :
> > { "zoomin", zoom,{ZoomIn | ZoomText} },
> > { "zoomout",zoom,{ZoomOut | ZoomText} },
> > { "zi",zoom,{ZoomIn | ZoomText} },
> > { "zo",zoom,{ZoomOut | ZoomText} }
>
> I'm a but surprised to find "zi" and "zo" there, as the same
> combinations already exist as keybindings by default. What would be the
> benefit to define them for the command line as well?
Oops, you're right. I added them as shorter versions of the commands...
but there's no need to type them, because of the keybindings.
But would not be the same about "ba" and "fw" and other harcoded short
versions of some commands? I mean, they make it easier to type the
commands, but they have keybindings as well.
> Any opinions on which combination to make default?
I think "zoomin" and "zoomout" are clearer for the config file.
> - fontsize defines the default font size
> - minimumfontsize lets you specify... you know what.
Great, thank you! That is not in the vimprobablerc man page yet, and I
forgot to check the website. I will try them.
> Again, this does not invalidate the usefulness of what you're proposing.
But it's simpler to set the minimum font size than zooming in several
times. Beside, I realised the Vimprobable's start delays a bit (on my
Raspberry Pi) because of the four zoomin commands! The advantage of the
zoom commands is to let the user change its default keybindings.
Marcos
--
http://programandala.net
|
|
From: Daniel C. <dan...@gm...> - 2013-05-04 12:02:46
Attachments:
signature.asc
|
Marcos Cruz <vim...@pr...> wrote: > Hi all, > > I miss Vimprobable's windows to open with a certain zoom level, because > usually I need a bigger font size. Keymaps let zoom in and out, and it's > possible to choose an alternative CSS too, but I miss a simpler > solution: zoom commands I could add to the config file (and beside, they > would let to config new keymaps for zooming, currently hardcoded). If only the font is to small, it might be enought to increase the 'fontsize' or the 'minimumfontsize'. Daniel |
|
From: Daniel C. <dan...@gm...> - 2013-05-04 12:05:58
|
Daniel Carl <dan...@gm...> wrote: > If only the font is to small, it might be enought to increase the 'fontsize' > or the 'minimumfontsize'. Oh, sorry! That's not new. I answered the mails in wrong order. Daniel |
|
From: Hannes S. <ha...@yl...> - 2013-05-06 13:41:17
|
Marcos Cruz <vim...@pr...> wrote:
> > > { "zoomin", zoom,{ZoomIn | ZoomText} },
> > > { "zoomout",zoom,{ZoomOut | ZoomText} },
> > > { "zi",zoom,{ZoomIn | ZoomText} },
> > > { "zo",zoom,{ZoomOut | ZoomText} }
Thinking about this, I'd say it might be a good idea to have one
command for zooming just text (as above) and one for zooming the
complete page (i.e. including images) as well for full flexibility.
Would it be clear enough (documented, of course) to have zi/zo zoom
just the text and zoomin/zoomout to zoom the complete page?
Hannes
|
|
From: Jason R. <jas...@gm...> - 2013-05-06 18:14:01
|
On 06/05/13 at 03:41pm, Hannes Schüller wrote:
> Marcos Cruz <vim...@pr...> wrote:
> > > > { "zoomin", zoom,{ZoomIn | ZoomText} },
> > > > { "zoomout",zoom,{ZoomOut | ZoomText} },
> > > > { "zi",zoom,{ZoomIn | ZoomText} },
> > > > { "zo",zoom,{ZoomOut | ZoomText} }
>
> Thinking about this, I'd say it might be a good idea to have one
> command for zooming just text (as above) and one for zooming the
> complete page (i.e. including images) as well for full flexibility.
> Would it be clear enough (documented, of course) to have zi/zo zoom
> just the text and zoomin/zoomout to zoom the complete page?
>
It would be clearer, at least to me, to use zi/zo and pgzin/pgzout (or something
like that—where there is more of a delineation) eg..
{ "pgzin", pagezoom,{PageZoomIn | ZoomPage}
{ "pgzout",pagezoom,{PageZoomOut | ZoomPage}
{ "zi",zoom,{ZoomIn | ZoomText} },
{ "zo",zoom,{ZoomOut | ZoomText} }
/J
http://jasonwryan.com/ [GnuPG Key: B1BD4E40]
|
|
From: Marcos C. <vim...@pr...> - 2013-05-07 12:24:07
|
En/Je/On 2013-05-06 15:41, Hannes Schüller escribió / skribis / wrote :
> Marcos Cruz <vim...@pr...> wrote:
> > > > { "zoomin", zoom,{ZoomIn | ZoomText} },
> > > > { "zoomout",zoom,{ZoomOut | ZoomText} },
> > > > { "zi",zoom,{ZoomIn | ZoomText} },
> > > > { "zo",zoom,{ZoomOut | ZoomText} }
>
> Thinking about this, I'd say it might be a good idea to have one
> command for zooming just text (as above) and one for zooming the
> complete page (i.e. including images) as well for full flexibility.
It's a good idea.
> Would it be clear enough (documented, of course) to have zi/zo zoom
> just the text and zoomin/zoomout to zoom the complete page?
If "zoomin"/"zi" and "zoomout"/"zo" were used that way, it would be
easy to forget which command does what, especially if they're not used
everyday.
I think "zoomin" and "zoomout" are clear enough for zooming the whole
page, since, by default, zooming means zooming everything. "zoominpage"
and "zoomoutpage" would be clearer forms, but unnecessary.
As for text, I suggest "zoomtextin" and "zoomtextout".
I think commands that are easier to remember and easier to understand in
the config file are more preferable than ambiguous abbreviations. The
commands' length is not a problem, thanks to tab completion and keyboard
mapping.
Marcos
--
http://programandala.net
|