Bug 121544

Summary: [GTK] The new web inspector can't be docked again once undocked
Product: WebKit Reporter: Carlos Garcia Campos <cgarcia>
Component: WebKitGTKAssignee: Gustavo Noronha (kov) <gns>
Status: RESOLVED FIXED    
Severity: Normal CC: bfulgham, gns, joepeck, timothy
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
A different approach using GTK+
none
Screenshot none

Description Carlos Garcia Campos 2013-09-18 00:49:00 PDT
The dock button in mac is in the window decoration, see:
https://developer.apple.com/technologies/safari/images/web-inspector.png

We should place the icon in the main toolbar to be able to dock the inspector again
Comment 1 Gustavo Noronha (kov) 2013-10-04 11:15:59 PDT
How do you undock it, btw?
Comment 2 Gustavo Noronha (kov) 2013-10-04 11:36:46 PDT
Looks like the only way to undock it atm is by having the webview that will be inspected be small enough that docking is not considered an option?
Comment 3 Gustavo Noronha (kov) 2013-10-04 15:02:02 PDT
Actually, there is a little button, I was not seeing it because I had an 'attach to right' button instead, looks like pressing shift/alt withthe inspector view focused changes which button will be there.
Comment 4 Gustavo Noronha (kov) 2013-11-10 13:39:53 PST
Created attachment 216537 [details]
Patch
Comment 5 Brent Fulgham 2013-11-19 17:43:01 PST
Joe -- I think this patch would also help the Windows port (which also suffers from this problem).  Could you review please?
Comment 6 Timothy Hatcher 2013-11-19 17:58:57 PST
Comment on attachment 216537 [details]
Patch

This looks good as-is. Though it likely would be better to have one button that toggles when the alt/option key is held down (like undockButtonNavigationItem.) So the buttons do not take up more rooms.
Comment 7 Joseph Pecoraro 2013-11-19 18:13:34 PST
Comment on attachment 216537 [details]
Patch

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

I agree with Timothy Hatcher's comment though. Is it conventional for the GTK port to toggle an alternate button when an "alt" key is down. Or would that be unconventional?

> Source/WebInspectorUI/UserInterface/Main.js:3
> + * Coprygith (C) 2013 Gustavo Noronha Silva <gns@gnome.org>

Typo: "Coprygith" => "Copyright"

> Source/WebInspectorUI/UserInterface/Main.js:224
> +    if (InspectorFrontendHost.platform() != "mac") {

Style: "==" => "==="
Comment 8 Gustavo Noronha (kov) 2013-12-07 02:51:42 PST
(In reply to comment #7)
> I agree with Timothy Hatcher's comment though. Is it conventional for the GTK port to toggle an alternate button when an "alt" key is down. Or would that be unconventional?

It is unconventional, it took me some time to figure out how to undock the inspector because I did not grasp how that worked at first.

In fact, one of the things I would like to do is to replace that behaviour in the docked state by showing both buttons, I can do the alt key thing work for the non-GTK case, though.

The other change I would like to do is to move the buttons (close in particular) to the right side of the toolbar where they make more sense for us. We'll be working at the WebKitGTK+ hackfest over the next few days, so I plan to take those on =)
Comment 9 Carlos Garcia Campos 2014-10-04 03:33:07 PDT
Created attachment 239276 [details]
A different approach using GTK+

Use a header bar when building with a recent enough GTK+.
Comment 10 Carlos Garcia Campos 2014-10-04 03:33:55 PDT
Created attachment 239277 [details]
Screenshot

This is how the inspector window looks with the header bar and dock buttons
Comment 11 Carlos Garcia Campos 2014-10-05 01:18:11 PDT
Committed r174327: <http://trac.webkit.org/changeset/174327>
Comment 12 Sergio Villar Senin 2014-12-03 03:55:22 PST
Comment on attachment 239276 [details]
A different approach using GTK+

Clearing the r+ flag in order not to appear in the review queue.
Comment 13 Sergio Villar Senin 2014-12-03 03:56:19 PST
Comment on attachment 216537 [details]
Patch

Clearing the r? flag. This landed some time ago.