diff options
author | Lars Vogel | 2017-05-03 13:49:31 +0000 |
---|---|---|
committer | Lars Vogel | 2017-05-03 13:53:44 +0000 |
commit | 9402543634c86e5fc7f1652abc12f1c5816ab816 (patch) | |
tree | a9a3ec193a710d04d0e5063a5c585a0e146a72ec | |
parent | 73ff2c16d11d91e0ca6c479cf07cb665309d3bbd (diff) | |
download | eclipse.platform.text-9402543634c86e5fc7f1652abc12f1c5816ab816.tar.gz eclipse.platform.text-9402543634c86e5fc7f1652abc12f1c5816ab816.tar.xz eclipse.platform.text-9402543634c86e5fc7f1652abc12f1c5816ab816.zip |
Bug 515836 - Search Dialog labels have different colors in dark themeY20170504-1000I20170504-2000I20170503-2000
The status label gets styled dynamically if regular expressions are
used. To avoid that the label uses its styling information we use the
foreground color of another label to set its foreground color back to
the color from the styling.
Change-Id: I3b18830eaf3e8ba496490dcbacc0814c4c468571
Signed-off-by: Lars Vogel <Lars.Vogel@vogella.com>
-rw-r--r-- | org.eclipse.search/search/org/eclipse/search/internal/ui/text/TextSearchPage.java | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/org.eclipse.search/search/org/eclipse/search/internal/ui/text/TextSearchPage.java b/org.eclipse.search/search/org/eclipse/search/internal/ui/text/TextSearchPage.java index abe628986c7..fd14647febd 100644 --- a/org.eclipse.search/search/org/eclipse/search/internal/ui/text/TextSearchPage.java +++ b/org.eclipse.search/search/org/eclipse/search/internal/ui/text/TextSearchPage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2015 IBM Corporation and others. + * Copyright (c) 2000, 2017 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -140,6 +140,7 @@ public class TextSearchPage extends DialogPage implements ISearchPage, IReplaceP * @since 3.6 */ private String[] fPreviousExtensions; + private Label fFileNamePatternDescription; private static class SearchPatternData { @@ -749,11 +750,10 @@ public class TextSearchPage extends DialogPage implements ISearchPage, IReplaceP fFileTypeEditor= new FileTypeEditor(fExtensions, button); - // Text line which explains the special characters - Label description= new Label(group, SWT.LEAD); - description.setText(SearchMessages.SearchPage_fileNamePatterns_hint); - description.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 2, 1)); - description.setFont(group.getFont()); + fFileNamePatternDescription = new Label(group, SWT.LEAD); + fFileNamePatternDescription.setText(SearchMessages.SearchPage_fileNamePatterns_hint); + fFileNamePatternDescription.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 2, 1)); + fFileNamePatternDescription.setFont(group.getFont()); Group searchInGroup= new Group(group, SWT.NONE); @@ -903,10 +903,13 @@ public class TextSearchPage extends DialogPage implements ISearchPage, IReplaceP private void statusMessage(boolean error, String message) { fStatusLabel.setText(message); - if (error) + if (error) { fStatusLabel.setForeground(JFaceColors.getErrorText(fStatusLabel.getDisplay())); - else - fStatusLabel.setForeground(null); + } + else { + // use same color as another label to respect styling + fStatusLabel.setForeground(fFileNamePatternDescription.getForeground()); + } } } |