Bug 212898 - [GTK] MiniBrowser: stop using GtkToolbar
Summary: [GTK] MiniBrowser: stop using GtkToolbar
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKitGTK (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: Gtk
Depends on: 212817
Blocks: GTK4 210276
  Show dependency treegraph
 
Reported: 2020-06-08 07:20 PDT by Carlos Garcia Campos
Modified: 2020-06-12 01:28 PDT (History)
2 users (show)

See Also:


Attachments
Patch (26.97 KB, patch)
2020-06-08 07:23 PDT, Carlos Garcia Campos
aperez: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Carlos Garcia Campos 2020-06-08 07:20:44 PDT
It's no longer available in GTK4. Use a GtkBox with buttons instead.
Comment 1 Carlos Garcia Campos 2020-06-08 07:23:35 PDT
Created attachment 401332 [details]
Patch
Comment 2 Adrian Perez 2020-06-11 07:42:46 PDT
Comment on attachment 401332 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=401332&action=review

> Tools/MiniBrowser/gtk/BrowserWindow.c:473
> +    return webkit_web_view_get_zoom_level(webView) != 1.0;

Comparing floating point numbers is usually a bad idea, due to rounding errors
and whatnot. Probably not much of an issue here, but the safest would be rounding
to the nearest integer and comparing that:

  return lrint(webkit_web_view_get_zoom_level(webView)) == 1;

No strong opinion, though. Feel free to leave the code as-is if you prefer.
Comment 3 Carlos Garcia Campos 2020-06-12 01:27:54 PDT
(In reply to Adrian Perez from comment #2)
> Comment on attachment 401332 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=401332&action=review
> 
> > Tools/MiniBrowser/gtk/BrowserWindow.c:473
> > +    return webkit_web_view_get_zoom_level(webView) != 1.0;
> 
> Comparing floating point numbers is usually a bad idea, due to rounding
> errors
> and whatnot. Probably not much of an issue here, but the safest would be
> rounding
> to the nearest integer and comparing that:
> 
>   return lrint(webkit_web_view_get_zoom_level(webView)) == 1;
> 
> No strong opinion, though. Feel free to leave the code as-is if you prefer.

I don't think it's a problem in this case because 1.0 is set when the load completes, which is what we want to check here.
Comment 4 Carlos Garcia Campos 2020-06-12 01:28:19 PDT
Committed r262938: <https://trac.webkit.org/changeset/262938>