Skip to content

Commit 37de57e

Browse files
deepika-uniraj-modi
authored andcommitted
Minimize and Maximize button images needs to be created afresh when
foreground color change is done in CTabFolder. Fixes #832 @niraj-modi @sravanlakkimsetti @HeikoKlare @merks Can anyone of you review the changes and let me know your comments please. Addressed review comments.
1 parent 4aefc7a commit 37de57e

File tree

1 file changed

+22
-0
lines changed
  • bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom

1 file changed

+22
-0
lines changed

bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CTabFolder.java

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2729,6 +2729,8 @@ public void setForeground (Color color) {
27292729
// To apply the new foreground color the image must be recreated with new foreground color.
27302730
// redraw() alone would only redraw the cached image with old color.
27312731
updateChevronImage(true);
2732+
updateMaxImage();
2733+
updateMinImage();
27322734
redraw();
27332735
}
27342736
/**
@@ -4261,4 +4263,24 @@ public boolean getHighlightEnabled() {
42614263
checkWidget();
42624264
return highlightEnabled;
42634265
}
4266+
/**
4267+
* Update the cached minimize button image when color is changed.
4268+
*/
4269+
private void updateMinImage() {
4270+
if (showMin && minMaxTb != null && minItem != null) {
4271+
if (minImage != null) minImage.dispose();
4272+
minImage = createButtonImage(getDisplay(), CTabFolderRenderer.PART_MIN_BUTTON);
4273+
minItem.setImage(minImage);
4274+
}
4275+
}
4276+
/**
4277+
* Update the cached maximize button image when color is changed.
4278+
*/
4279+
private void updateMaxImage() {
4280+
if (showMax && minMaxTb != null && maxItem != null) {
4281+
if (maxImage != null) maxImage.dispose();
4282+
maxImage = createButtonImage(getDisplay(), CTabFolderRenderer.PART_MAX_BUTTON);
4283+
maxItem.setImage(maxImage);
4284+
}
4285+
}
42644286
}

0 commit comments

Comments
 (0)