Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 12968 Details for
Bug 60768
CBanner at top does vertical sizing based on left components
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Fix for UI Workbench
patch_60768_UIWorkbench.txt (text/plain), 3.77 KB, created by
Hanna Farah
on 2004-07-05 14:06:29 EDT
(
hide
)
Description:
Fix for UI Workbench
Filename:
MIME Type:
Creator:
Hanna Farah
Created:
2004-07-05 14:06:29 EDT
Size:
3.77 KB
patch
obsolete
>Index: Eclipse UI/org/eclipse/ui/internal/PerspectiveSwitcher.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/PerspectiveSwitcher.java,v >retrieving revision 1.17 >diff -u -r1.17 PerspectiveSwitcher.java >--- Eclipse UI/org/eclipse/ui/internal/PerspectiveSwitcher.java 29 Jun 2004 17:53:27 -0000 1.17 >+++ Eclipse UI/org/eclipse/ui/internal/PerspectiveSwitcher.java 5 Jul 2004 17:57:57 -0000 >@@ -185,6 +185,7 @@ > currentLocation = newLocation; > showPerspectiveBar(); > if(newLocation == TOP_LEFT || newLocation == TOP_RIGHT) { >+ updateCBannerHeight(); > updatePerspectiveBar(); > setCoolItemSize(coolItem); > } >@@ -345,7 +346,6 @@ > } > perspectiveBar.update(true); > setCoolItemSize(coolItem); >- > } > } > }; >@@ -416,18 +416,17 @@ > // there is no coolItem when the bar is on the left > if (currentLocation == LEFT) > return; >- >+ > ToolBar toolbar = perspectiveBar.getControl(); > if (toolbar == null) > return; >- >- int rowHeight = toolbar.getItem(0).getBounds().height; > >- // This gets the height of the tallest item. >- for (int i = 1; i < perspectiveBar.getControl().getItemCount(); i++) { >- rowHeight = Math.max(rowHeight, perspectiveBar.getControl().getItem(i).getBounds().height); >+ int rowHeight = 0; >+ ToolItem[] toolItems = perspectiveBar.getControl().getItems(); >+ for (int i = 0; i < toolItems.length; i++) { >+ rowHeight = Math.max(rowHeight, toolItems[i].getBounds().height); > } >- >+ > Rectangle area = perspectiveCoolBar.getClientArea(); > int rows = rowHeight <= 0 ? 1 : (int)Math.max(1, Math.floor(area.height / rowHeight)); > if (rows == 1 || (toolbar.getStyle() & SWT.WRAP) == 0 || currentLocation == TOP_LEFT) { >@@ -671,9 +670,29 @@ > IContributionItem [] items = perspectiveBar.getItems(); > for( int i = 0; i < items.length; i++ ) > items[i].update(); >+ > // make sure the selected item is visible > perspectiveBar.arrangeToolbar(); >+ setCoolItemSize(coolItem); > perspectiveBar.getControl().redraw(); > } > >+ /** >+ * Updates the height of the CBanner if the perspective bar >+ * is docked on the top right >+ */ >+ public void updateCBannerHeight() { >+ if (topBar == null || perspectiveBar == null || perspectiveBar.getControl() == null || >+ currentLocation != TOP_RIGHT) >+ return; >+ // This gets the height of the tallest tool item. >+ int maxRowHeight = 0; >+ ToolItem[] toolItems = perspectiveBar.getControl().getItems(); >+ for (int i = 0; i < toolItems.length; i++) { >+ maxRowHeight = Math.max(maxRowHeight, toolItems[i].getBounds().height); >+ } >+ // This sets the CBanner's minimum height to support large fonts >+ topBar.setMinRightHeight(maxRowHeight); >+ LayoutUtil.resize(perspectiveBar.getControl()); >+ } > } >Index: Eclipse UI/org/eclipse/ui/internal/WorkbenchWindow.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/WorkbenchWindow.java,v >retrieving revision 1.237 >diff -u -r1.237 WorkbenchWindow.java >--- Eclipse UI/org/eclipse/ui/internal/WorkbenchWindow.java 17 Jun 2004 17:56:06 -0000 1.237 >+++ Eclipse UI/org/eclipse/ui/internal/WorkbenchWindow.java 5 Jul 2004 17:57:57 -0000 >@@ -513,8 +513,10 @@ > int result = super.open(); > getWorkbenchImpl().fireWindowOpened(this); > getAdvisor().postWindowOpen(getWindowConfigurer()); >- if (perspectiveSwitcher != null) >- perspectiveSwitcher.updatePerspectiveBar(); >+ if (perspectiveSwitcher != null) { >+ perspectiveSwitcher.updateCBannerHeight(); >+ perspectiveSwitcher.updatePerspectiveBar(); >+ } > return result; > } >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 60768
:
12920
|
12921
| 12968