@Override public void handleEvent(Event e) { Image image = Section.super.getBackgroundImage(); if (image != null) { FormImages.getInstance().markFinished(image, getDisplay()); } Section.super.setBackgroundImage(null); } };
@Override public void handleEvent(Event e) { if (gradientImage != null) { FormImages.getInstance().markFinished(gradientImage, getDisplay()); gradientImage = null; } } });
Section(Composite parent, int cstyle, int style) { super(parent, cstyle | getBackgroundStyle(style), style); int rtl = cstyle & SWT.RIGHT_TO_LEFT; if ((style & DESCRIPTION) != 0) { descriptionControl = new Label(this, SWT.WRAP | rtl); } if ((style & TITLE_BAR) != 0) { Listener listener = e -> { Image image = Section.super.getBackgroundImage(); if (image != null) { FormImages.getInstance().markFinished(image, getDisplay()); } Section.super.setBackgroundImage(null); }; addListener(SWT.Dispose, listener); addListener(SWT.Resize, listener); } }
private void updateHeaderImage(Color bg, Rectangle bounds, int theight, int realtheight) { Color gradient = getTitleBarGradientBackground() != null ? getTitleBarGradientBackground() : getBackground(); Image image = FormImages.getInstance().getSectionGradientImage(gradient, bg, realtheight, theight, marginHeight, getDisplay()); super.setBackgroundImage(image); }
private void updateHeaderImage(Color bg, Rectangle bounds, int theight, int realtheight) { Color gradient = getTitleBarGradientBackground() != null ? getTitleBarGradientBackground() : getBackground(); Image image = FormImages.getInstance().getSectionGradientImage(gradient, bg, realtheight, theight, marginHeight, getDisplay()); super.setBackgroundImage(image); }
private void updateGradientImage() { Rectangle rect = getBounds(); if (gradientImage != null) { FormImages.getInstance().markFinished(gradientImage, getDisplay()); gradientImage = null; } if (gradientInfo != null) { gradientImage = FormImages.getInstance().getGradient(gradientInfo.gradientColors, gradientInfo.percents, gradientInfo.vertical ? rect.height : rect.width, gradientInfo.vertical, getColor(COLOR_BASE_BG), getDisplay()); } else if (backgroundImage != null && !isBackgroundImageTiled()) { gradientImage = new Image(getDisplay(), Math.max(rect.width, 1), Math.max(rect.height, 1)); gradientImage.setBackground(getBackground()); GC gc = new GC(gradientImage); gc.drawImage(backgroundImage, 0, 0); gc.dispose(); } setBackgroundImage(gradientImage); }
private void updateGradientImage() { Rectangle rect = getBounds(); Image oldGradientImage = gradientImage; gradientImage = null; if (gradientInfo != null) { gradientImage = FormImages.getInstance().getGradient(gradientInfo.gradientColors, gradientInfo.percents, gradientInfo.vertical ? rect.height : rect.width, gradientInfo.vertical, getColor(COLOR_BASE_BG), getDisplay()); } else if (backgroundImage != null && !isBackgroundImageTiled()) { gradientImage = new Image(getDisplay(), Math.max(rect.width, 1), Math.max(rect.height, 1)); gradientImage.setBackground(getBackground()); GC gc = new GC(gradientImage); gc.drawImage(backgroundImage, 0, 0); gc.dispose(); } if (oldGradientImage != null) { FormImages.getInstance().markFinished(oldGradientImage, getDisplay()); } setBackgroundImage(gradientImage); }
public void setTextBackground(Color[] gradientColors, int[] percents, boolean vertical) { if (gradientColors != null) { gradientInfo = new GradientInfo(); gradientInfo.gradientColors = gradientColors; gradientInfo.percents = percents; gradientInfo.vertical = vertical; setBackground(null); updateGradientImage(); } else { // reset gradientInfo = null; if (gradientImage != null) { FormImages.getInstance().markFinished(gradientImage, getDisplay()); gradientImage = null; setBackgroundImage(null); } } }
public void setTextBackground(Color[] gradientColors, int[] percents, boolean vertical) { if (gradientColors != null) { gradientInfo = new GradientInfo(); gradientInfo.gradientColors = gradientColors; gradientInfo.percents = percents; gradientInfo.vertical = vertical; setBackground(null); updateGradientImage(); } else { // reset gradientInfo = null; if (gradientImage != null) { FormImages.getInstance().markFinished(gradientImage, getDisplay()); gradientImage = null; setBackgroundImage(null); } } }
addListener(SWT.Dispose, e -> { if (gradientImage != null) { FormImages.getInstance().markFinished(gradientImage, getDisplay()); gradientImage = null;