Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 378835 - Toggle Toolbar Visibility missing in 4.2
Summary: Toggle Toolbar Visibility missing in 4.2
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: IDE (show other bugs)
Version: 4.2   Edit
Hardware: PC Mac OS X
: P3 normal with 1 vote (vote)
Target Milestone: 4.3   Edit
Assignee: Platform-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 380864 384573 386608 (view as bug list)
Depends on: 380864
Blocks: 383914
  Show dependency tree
 
Reported: 2012-05-08 09:26 EDT by Markus Keller CLA
Modified: 2013-11-10 22:31 EST (History)
12 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Markus Keller CLA 2012-05-08 09:26:22 EDT
3.8 has a context menu on the workbench window toolbar and offers "Hide Toolbar". When the toolbar is hidden, a menu item "Window > Show Toolbar" magically appears.

On the Mac before 10.7, the window title bar showed a "pill" in the upper right corner that also allowed to toggle the tool bar (with caveats: bug 332519).

In 4.2 M7, several features are broken:
- tool bar always shows up after restart
- Quick Access (Command+3) always makes the tool bar visible
- toolbar cannot easily be shown/hidden, since there's no context menu and no action in the Window menu (but the "pill" still works, as well as the unbound "Toggle Toolbar Visibility" command)
Comment 1 Paul Webster CLA 2012-05-08 10:41:40 EDT
Except for the pill (mac specific) I see the same behaviour on linux.

PW
Comment 2 Brian de Alwis CLA 2012-05-09 19:12:06 EDT
Weird: I fixed the state persisting in bug 320749.
Comment 3 Brian de Alwis CLA 2012-05-28 17:48:45 EDT
Looked into this further:

  * The state persisting hack from bug 320749 was "broken" by Remy's fix for bug 355059 which modified WorkbenchWindow#populateTopTrimContributions() to force the topTrim's toBeRendered to true (my mistake — I should have noted why we commented out the toBeRendered()).  I say "broken" as it was a bit of a hack anyways, and seemingly caused issues.

  * WorkbenchWindow's cool-bar-visible and perspective-bar-visible properties are divorced from reality: (1) WW#setCoolBarVisible() and WW#setPerspectiveBarVisible() doesn't actually have any effect, and (2) WW#toggleToolbarVisibility() (called by the handler for the org.eclipse.ui.ToggleCoolbarAction / "Toggle Toolbar Visibility" command) doesn't use the cool-bar-visible or perspective-bar-visible values

  * And since the command handler for org.eclipse.ui.ToggleCoolbarAction determines its visibility and menu text from the WW's cool-bar-visible and perspective-bar-visible properties it too doesn't actually match reality.

And there's actually two regressions here: 

  1. When the intro view is shown full-screen, apparently the toolbar should be hidden.  It does call WW#set{Cool,Perspective}BarVisible() to properly disable and then re-enable the visibility, but since they have no effect, the toolbar remains open.   And if you start from a fresh workspace or open Help > Welcome, you'll find Window > Show Toolbar, even though the toolbar is visible; triggering is causes the toolbar to hide.

  2. If the window configurer says show-{cool,perspective}-bar = false, we can still show the toolbar

Fixing this is a bit complicated as:

  * the toolbar visibility is further controlled by the window configurer, whose desires should be (but currently aren't) taken into account

  * we don't have the ability to toggle the perspective bar independently from the remainder of the toolbar


So my suggestion for 4.2.1 or 4.3 (?) is:

  * make the Toggle Toolbar menu definition always visible (as with Markus, I never understood the rationale in bug 173927 as to why it is hidden when the toolbar was visible)

  * add new method WorkbenchWindow#isToolbarVisible() which is used by ToggleToolbarHandler rather than checking the cool-bar-visible and perspective-bar-visible directly

  * cause the top-trim to be displayed if ether the cool- or perspective-bar are to be visible, and hidden otherwise
Comment 4 Paul Webster CLA 2012-07-09 09:30:16 EDT
*** Bug 384573 has been marked as a duplicate of this bug. ***
Comment 5 Brian de Alwis CLA 2012-08-04 11:14:58 EDT
*** Bug 386608 has been marked as a duplicate of this bug. ***
Comment 6 Brian de Alwis CLA 2012-08-07 10:33:52 EDT
Fixed in master (commit 84edf132dc2e2c63217434e92fdb5ee597b25516)
Comment 7 Brian de Alwis CLA 2012-08-07 10:34:32 EDT
*** Bug 380864 has been marked as a duplicate of this bug. ***
Comment 8 Brian de Alwis CLA 2012-08-09 12:35:21 EDT
Oops, fixed properly with commit 3e023ab79c7705d10115d3d136cdf8617a139887