-
Notifications
You must be signed in to change notification settings - Fork 192
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Highlighting problem when using the dark theme on Windows eclipse-pla…
…tform/eclipse.platform.swt#811 JFace viewer are using OS selection color to highlight the selected item. On some OS this is not accessible. With this change, the selection color can be changed via color preference in the settings of eclipse. The colors are used to draw selection color for tree and table viewers. For Windows, the selection color in the dark theme is overwritten to fix the bad default coloring Fixes eclipse-platform/eclipse.platform.swt#811 Fixes #1688
- Loading branch information
1 parent
27a120d
commit 13922b5
Showing
20 changed files
with
626 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
63 changes: 63 additions & 0 deletions
63
...ce.text/src/org/eclipse/jface/internal/text/contentassist/CompletionTableDrawSupport.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2024 SAP SE. | ||
* | ||
* This program and the accompanying materials | ||
* are made available under the terms of the Eclipse Public License 2.0 | ||
* which accompanies this distribution, and is available at | ||
* https://www.eclipse.org/legal/epl-2.0/ | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
* | ||
* Contributors: | ||
* SAP SE - initial API and implementation | ||
*******************************************************************************/ | ||
package org.eclipse.jface.internal.text.contentassist; | ||
|
||
import org.eclipse.swt.custom.StyleRange; | ||
import org.eclipse.swt.graphics.Color; | ||
import org.eclipse.swt.widgets.Table; | ||
import org.eclipse.swt.widgets.TableItem; | ||
|
||
import org.eclipse.jface.internal.text.TableOwnerDrawSupport; | ||
|
||
/** | ||
* When a completion table (for example for code completion) is requested by the user, the user | ||
* needs to be able to continue typing in the linked text control. In such cases, the focus is not | ||
* on the completion table. To ensure the selected code completion proposal always displays in the | ||
* correct color, even if the completion table is not focused, the non-focused colors are overridden | ||
* with the focus colors. | ||
*/ | ||
public class CompletionTableDrawSupport extends TableOwnerDrawSupport { | ||
|
||
public static void install(Table table) { | ||
TableOwnerDrawSupport listener= new CompletionTableDrawSupport(table); | ||
installListener(table, listener); | ||
} | ||
|
||
/** | ||
* Stores the styled ranges in the given table item. See {@link TableOwnerDrawSupport} | ||
* | ||
* @param item table item | ||
* @param column the column index | ||
* @param ranges the styled ranges or <code>null</code> to remove them | ||
*/ | ||
public static void storeStyleRanges(TableItem item, int column, StyleRange[] ranges) { | ||
TableOwnerDrawSupport.storeStyleRanges(item, column, ranges); | ||
} | ||
|
||
|
||
private CompletionTableDrawSupport(Table table) { | ||
super(table); | ||
} | ||
|
||
@Override | ||
protected Color getSelectedRowBackgroundColorNoFocus() { | ||
return super.getSelectedRowBackgroundColor(); | ||
} | ||
|
||
@Override | ||
protected Color getSelectedRowForegroundColorNoFocus() { | ||
return super.getSelectedRowForegroundColor(); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.