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 76437 Details for
Bug 199908
[Presentations] render last character of cut view tab titles with gray gradient
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
A quick hack
199908_hacked_patch.txt (text/plain), 2.65 KB, created by
Markus Keller
on 2007-08-20 05:52:50 EDT
(
hide
)
Description:
A quick hack
Filename:
MIME Type:
Creator:
Markus Keller
Created:
2007-08-20 05:52:50 EDT
Size:
2.65 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.swt >Index: Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CTabItem.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CTabItem.java,v >retrieving revision 1.105 >diff -u -r1.105 CTabItem.java >--- Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CTabItem.java 5 Jul 2007 18:27:13 -0000 1.105 >+++ Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CTabItem.java 20 Aug 2007 09:53:10 -0000 >@@ -11,9 +11,21 @@ > package org.eclipse.swt.custom; > > >-import org.eclipse.swt.*; >-import org.eclipse.swt.graphics.*; >-import org.eclipse.swt.widgets.*; >+import org.eclipse.swt.SWT; >+import org.eclipse.swt.SWTException; >+import org.eclipse.swt.graphics.Color; >+import org.eclipse.swt.graphics.Font; >+import org.eclipse.swt.graphics.GC; >+import org.eclipse.swt.graphics.Image; >+import org.eclipse.swt.graphics.Pattern; >+import org.eclipse.swt.graphics.Point; >+import org.eclipse.swt.graphics.RGB; >+import org.eclipse.swt.graphics.Rectangle; >+import org.eclipse.swt.graphics.TextLayout; >+import org.eclipse.swt.widgets.Control; >+import org.eclipse.swt.widgets.Display; >+import org.eclipse.swt.widgets.Item; >+import org.eclipse.swt.widgets.Widget; > > /** > * Instances of this class represent a selectable user interface object >@@ -402,12 +414,28 @@ > shortenedText = shortenText(gc, getText(), textWidth); > shortenedTextWidth = textWidth; > } >- Point extent = gc.textExtent(shortenedText, FLAGS); >+ int fadeChars= shortenedText.length() == getText().length() >+ ? 0 >+ : Math.min(4, shortenedText.length()); >+ String blackText= shortenedText.substring(0, shortenedText.length() - fadeChars); >+ Point extent = gc.textExtent(blackText, FLAGS); > int textY = y + (height - extent.y) / 2; > textY += parent.onBottom ? -1 : 1; > > gc.setForeground(parent.selectionForeground); >- gc.drawText(shortenedText, xDraw, textY, FLAGS); >+ gc.drawText(blackText, xDraw, textY, FLAGS); >+ if (fadeChars > 0) { >+ String fadeText= getText().substring(blackText.length(), blackText.length() + fadeChars); >+ int fadeTextWidth= gc.textExtent(fadeText, FLAGS).x; >+ Pattern pattern= new Pattern(gc.getDevice(), >+ xDraw + extent.x, 0, xDraw + extent.x + fadeTextWidth, 0, >+ parent.selectionForeground, 255, parent.selectionBackground, 128); >+ gc.setForegroundPattern(pattern); >+ gc.drawText(fadeText, >+ xDraw + extent.x, textY, FLAGS); >+ gc.setForegroundPattern(null); >+ pattern.dispose(); >+ } > gc.setFont(gcFont); > > // draw a Focus rectangle
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 199908
: 76437 |
76438
|
76549