diff options
author | Carolyn MacLeod <Carolyn_MacLeod@ca.ibm.com> | 2011-09-24 15:54:05 -0400 |
---|---|---|
committer | Carolyn MacLeod <Carolyn_MacLeod@ca.ibm.com> | 2011-09-24 15:56:39 -0400 |
commit | 8d66c54f1806e5f4886545c525b731676efd0ad4 (patch) | |
tree | c9950219609d611f38894e738b099ff99b950e93 /bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/DateTime.java | |
parent | b3289ecfc47e79e340ac862d8d53734bd3c6d2dd (diff) | |
download | eclipse.platform.swt-8d66c54f1806e5f4886545c525b731676efd0ad4.tar.gz eclipse.platform.swt-8d66c54f1806e5f4886545c525b731676efd0ad4.tar.xz eclipse.platform.swt-8d66c54f1806e5f4886545c525b731676efd0ad4.zip |
Bug 331948 - setBackground does not work in DateTime with SWT.CALENDAR
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/DateTime.java')
-rw-r--r-- | bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/DateTime.java | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/DateTime.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/DateTime.java index 948762cabf..0d8c8097a6 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/DateTime.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/DateTime.java @@ -17,7 +17,7 @@ import org.eclipse.swt.*; import org.eclipse.swt.events.*; import org.eclipse.swt.graphics.*; import org.eclipse.swt.accessibility.*; -import org.eclipse.swt.internal.gtk.OS; +import org.eclipse.swt.internal.gtk.*; /** * Instances of this class are selectable user interface @@ -460,6 +460,14 @@ String formattedStringValue(int fieldName, int value, boolean adjust) { return String.valueOf(value); } +GdkColor getBackgroundColor () { + if ((style & SWT.CALENDAR) != 0) { + return getBaseColor (); + } else { + return super.getBackgroundColor (); + } +} + String getComputeSizeString(int style) { if ((style & SWT.DATE) != 0) { return (style & SWT.SHORT) != 0 ? DEFAULT_SHORT_DATE_FORMAT : (style & SWT.LONG) != 0 ? DEFAULT_LONG_DATE_FORMAT : DEFAULT_MEDIUM_DATE_FORMAT; @@ -1061,11 +1069,22 @@ void sendSelectionEvent () { public void setBackground(Color color) { super.setBackground(color); + if (((style & SWT.CALENDAR) != 0) && color == null) { + OS.gtk_widget_modify_base(handle, 0, null); + } bg = color; if (text != null) text.setBackground(color); if (popupCalendar != null) popupCalendar.setBackground(color); } +void setBackgroundColor (GdkColor color) { + if ((style & SWT.CALENDAR) != 0) { + OS.gtk_widget_modify_base(handle, 0, color); + } else { + super.setBackgroundColor (color); + } +} + public void setEnabled (boolean enabled){ super.setEnabled(enabled); if ((style & SWT.CALENDAR) == 0) { |