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 141362 Details for
Bug 280969
Allow setting of individual foreground colours to CTabItem
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
CTabItem foreground colours patch v2
bug280969-patch-v2.txt (text/plain), 2.83 KB, created by
Remy Suen
on 2009-07-11 19:04:07 EDT
(
hide
)
Description:
CTabItem foreground colours patch v2
Filename:
MIME Type:
Creator:
Remy Suen
Created:
2009-07-11 19:04:07 EDT
Size:
2.83 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.118 >diff -u -r1.118 CTabItem.java >--- Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CTabItem.java 1 Jul 2009 14:49:33 -0000 1.118 >+++ Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CTabItem.java 11 Jul 2009 23:05:15 -0000 >@@ -44,6 +44,7 @@ > > // Appearance > Font font; >+ Color foreground; > Image disabledImage; > > Rectangle closeRect = new Rectangle(0, 0, 0, 0); >@@ -663,7 +664,7 @@ > Point extent = gc.textExtent(shortenedText, FLAGS); > int textY = y + (height - extent.y) / 2; > textY += parent.onBottom ? -1 : 1; >- gc.setForeground(parent.getForeground()); >+ gc.setForeground(foreground == null ? parent.getForeground() : foreground); > gc.drawText(shortenedText, xDraw, textY, FLAGS); > gc.setFont(gcFont); > } >@@ -735,6 +736,22 @@ > return parent.getFont(); > } > /** >+ * Returns the foreground color that the receiver will use to draw. >+ * >+ * @return the receiver's foreground color >+ * >+ * @exception SWTException <ul> >+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> >+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> >+ * </ul> >+ * >+ * @since 3.6 >+ */ >+public Color getForeground () { >+ checkWidget (); >+ return (foreground == null) ? parent.getForeground() : foreground; >+} >+/** > * Returns the receiver's parent, which must be a <code>CTabFolder</code>. > * > * @return the receiver's parent >@@ -953,6 +970,37 @@ > parent.redrawTabs(); > } > } >+/** >+ * Sets the receiver's foreground color to the color specified >+ * by the argument, or to the default system color for the item >+ * if the argument is null. >+ * >+ * @param color the new color (or null) >+ * >+ * @exception IllegalArgumentException <ul> >+ * <li>ERROR_INVALID_ARGUMENT - if the argument has been disposed</li> >+ * </ul> >+ * @exception SWTException <ul> >+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> >+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> >+ * </ul> >+ * >+ * @since 3.6 >+ */ >+public void setForeground (Color color){ >+ checkWidget (); >+ if (color != null && color.isDisposed ()) { >+ SWT.error (SWT.ERROR_INVALID_ARGUMENT); >+ } >+ Color oldColor = getForeground(); >+ if (color == null && oldColor == null) return; >+ if (color != null && color.equals(oldColor)) return; >+ foreground = color; >+ if (!parent.updateTabHeight(false)) { >+ parent.updateItems(); >+ parent.redrawTabs(); >+ } >+} > public void setImage (Image image) { > checkWidget(); > if (image != null && image.isDisposed ()) {
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 280969
:
139671
| 141362