Re: [PATCH] Toolbar button to control zoom level

[email protected]
Newsgroups gmane.comp.web.dillo.devel
Message-ID <[email protected]>
Hi Rodrigo and alex,

both your patches work on fresh source
and the zoom button works nicely  (left mouse click for zoom out  and right mouse click for zoom in

Rodrigos patch   applied in dillo-3.1.1
patching file src/bw.c
patching file src/bw.h
patching file src/keys.cc
patching file src/keys.hh
patching file src/prefs.c
patching file src/prefs.h
patching file src/styleengine.cc
patching file src/ui.cc
Reversed (or previously applied) patch detected!  Assume -R? [n] n
Apply anyway? [n] n
Skipping patch.
2 out of 2 hunks ignored -- saving rejects to file src/ui.cc.rej

alex's patch   applied in dillo-3.1.1/src
patching file src/uicmd.cc
patching file src/uicmd.hh
patching file pixmaps.h
patching file ui.cc
patching file ui.hh

all that is needed now is the 'magnifying glass' icon above the word Zoom 'borrowed' from the 'search button' :)


On Sun, 7 Jul 2024 21:02:19 +0200
<[email protected]> wrote:

> Hi,
>
> Here is an updated patch with a better icon and fixed tooltip.
> Hopefully somebody finds it useful :)
>
>
> diff -u ./pixmaps.h mod/pixmaps.h
> --- ./pixmaps.h	Sat Jul  6 18:03:43 2024
> +++ mod/pixmaps.h	Sat Jul  6 18:23:27 2024
> @@ -1410,6 +1410,28 @@
>  };
>
>  /* XPM */
> +static const char *const zoom_xpm[] = {
> +"16 16 2 1",
> +"       c None",
> +"@      c gray70",
> +"		  ",
> +"     @@@@@@	  ",
> +"    @      @    ",
> +"   @        @   ",
> +"  @	 @@    @  ",
> +" @	 @@	@ ",
> +" @	 @@	@ ",
> +" @  @@@@@@@@  @ ",
> +" @  @@@@@@@@  @ ",
> +" @	 @@	@ ",
> +"  @	 @@    @  ",
> +"   @   @@   @   ",
> +"    @      @@@@ ",
> +"     @@@@@@  @@@",
> +"		@@",
> +"		  "};
> +
> +/* XPM */
>  static const char *const new_s_xpm[] = {
>  "11 11 35 1",
>  "       c None",
> diff -u ./ui.cc mod/ui.cc
> --- ./ui.cc	Sat Jul  6 18:26:52 2024
> +++ mod/ui.cc	Sat Jul  6 18:03:57 2024
> @@ -38,7 +38,7 @@
>
>  struct iconset {
>     Fl_Image *ImgMeterOK, *ImgMeterBug,
> -            *ImgHome, *ImgReload, *ImgSave, *ImgBook, *ImgTools,
> +            *ImgHome, *ImgReload, *ImgSave, *ImgBook, *ImgTools, *ImgZoom,
>              *ImgClear,*ImgSearch, *ImgHelp, *ImgLeft, *ImgLeftIn,
>              *ImgRight, *ImgRightIn, *ImgStop, *ImgStopIn;
>  };
> @@ -51,6 +51,7 @@
>     new Fl_Pixmap(save_xpm),
>     new Fl_Pixmap(bm_xpm),
>     new Fl_Pixmap(tools_xpm),
> +   new Fl_Pixmap(zoom_xpm),
>     new Fl_Pixmap(new_s_xpm),
>     new Fl_Pixmap(search_xpm),
>     new Fl_Pixmap(help_xpm),
> @@ -70,6 +71,7 @@
>     new Fl_Pixmap(save_s_xpm),
>     new Fl_Pixmap(bm_s_xpm),
>     new Fl_Pixmap(tools_s_xpm),
> +   new Fl_Pixmap(zoom_xpm),
>     new Fl_Pixmap(new_s_xpm),
>     standard_icons.ImgSearch,
>     standard_icons.ImgHelp,
> @@ -356,6 +358,13 @@
>                         wid->y() + wid->h());
>        }
>        break;
> +   case UI_ZOOM:
> +      if (b == FL_LEFT_MOUSE) {
> +         a_UIcmd_zoom_in(a_UIcmd_get_bw_by_widget(wid));
> +      } else if (b == FL_RIGHT_MOUSE) {
> +         a_UIcmd_zoom_out(a_UIcmd_get_bw_by_widget(wid));
> +      }
> +      break;
>     default:
>        break;
>     }
> @@ -433,6 +442,7 @@
>     Stop = make_button("Stop", icons->ImgStop, icons->ImgStopIn, UI_STOP);
>     Bookmarks = make_button("Book", icons->ImgBook, NULL, UI_BOOK);
>     Tools = make_button("Tools", icons->ImgTools, NULL, UI_TOOLS);
> +   Zoom = make_button("Zoom", icons->ImgZoom, NULL, UI_ZOOM);
>
>     Back->set_tooltip("Previous page");
>     Forw->set_tooltip("Next page");
> @@ -442,6 +452,7 @@
>     Stop->set_tooltip("Stop loading");
>     Bookmarks->set_tooltip("View bookmarks");
>     Tools->set_tooltip("Settings");
> +   Zoom->set_tooltip("Zoom in: left-click, Zoom out: right-click");
>  }
>
>  /**
> diff -u ./ui.hh mod/ui.hh
> --- ./ui.hh	Sat Jul  6 18:03:43 2024
> +++ mod/ui.hh	Sat Jul  6 18:03:57 2024
> @@ -23,6 +23,7 @@
>     UI_STOP,
>     UI_BOOK,
>     UI_TOOLS,
> +   UI_ZOOM,
>     UI_CLEAR,
>     UI_SEARCH
>  } UIButton;
> @@ -125,7 +126,7 @@
>
>     CustGroupVertical *TopGroup;
>     CustButton *Back, *Forw, *Home, *Reload, *Save, *Stop, *Bookmarks,
> -              *Tools, *Clear, *Search, *Help, *BugMeter, *FileButton;
> +              *Tools, *Zoom, *Clear, *Search, *Help, *BugMeter, *FileButton;
>     CustGroupHorizontal *LocBar, *NavBar, *StatusBar;
>     Fl_Input *Location;
>     CustProgressBox *PProg, *IProg;
>
>
> -Alex
_______________________________________________
Dillo-dev mailing list -- dillo-dev-lx9mn2B4QYRWk0Htik3J/[email protected]
To unsubscribe send an email to dillo-dev-leave-lx9mn2B4QYRWk0Htik3J/[email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.