Skip to content

Commit

Permalink
Minimize and Maximize button images needs to be created afresh when
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
deepika-u authored and niraj-modi committed Feb 1, 2024
1 parent 4aefc7a commit 37de57e
Showing 1 changed file with 22 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2729,6 +2729,8 @@ public void setForeground (Color color) {
// To apply the new foreground color the image must be recreated with new foreground color.
// redraw() alone would only redraw the cached image with old color.
updateChevronImage(true);
updateMaxImage();
updateMinImage();
redraw();
}
/**
Expand Down Expand Up @@ -4261,4 +4263,24 @@ public boolean getHighlightEnabled() {
checkWidget();
return highlightEnabled;
}
/**
* Update the cached minimize button image when color is changed.
*/
private void updateMinImage() {
if (showMin && minMaxTb != null && minItem != null) {
if (minImage != null) minImage.dispose();
minImage = createButtonImage(getDisplay(), CTabFolderRenderer.PART_MIN_BUTTON);
minItem.setImage(minImage);
}
}
/**
* Update the cached maximize button image when color is changed.
*/
private void updateMaxImage() {
if (showMax && minMaxTb != null && maxItem != null) {
if (maxImage != null) maxImage.dispose();
maxImage = createButtonImage(getDisplay(), CTabFolderRenderer.PART_MAX_BUTTON);
maxItem.setImage(maxImage);
}
}
}

0 comments on commit 37de57e

Please sign in to comment.