mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
better look when table hasn't focus
This commit is contained in:
+5
-2
@@ -194,7 +194,7 @@ public class JavaChangeSignatureDialog extends ChangeSignatureDialogBase<Paramet
|
||||
}
|
||||
|
||||
@Override
|
||||
protected JComponent getRowPresentation(ParameterTableModelItemBase<ParameterInfoImpl> item, boolean selected, boolean focused) {
|
||||
protected JComponent getRowPresentation(ParameterTableModelItemBase<ParameterInfoImpl> item, boolean selected, final boolean focused) {
|
||||
final JPanel panel = new JPanel(new BorderLayout());
|
||||
final String typeText = item.typeCodeFragment.getText();
|
||||
final String separator = " ";StringUtil.repeatSymbol(' ', getTypesMaxLength() - typeText.length() + 1);
|
||||
@@ -219,11 +219,14 @@ public class JavaChangeSignatureDialog extends ChangeSignatureDialogBase<Paramet
|
||||
//final Font font = EditorColorsManager.getInstance().getGlobalScheme().getFont(EditorFontType.PLAIN);
|
||||
//field.setFont(font);
|
||||
|
||||
if (selected) {
|
||||
if (selected && focused) {
|
||||
panel.setBackground(UIUtil.getTableSelectionBackground());
|
||||
field.setAsRendererWithSelection(UIUtil.getTableSelectionBackground(), UIUtil.getTableSelectionForeground());
|
||||
} else {
|
||||
panel.setBackground(UIUtil.getTableBackground());
|
||||
if (selected && !focused) {
|
||||
panel.setBorder(new DottedBorder(UIUtil.getTableForeground()));
|
||||
}
|
||||
}
|
||||
panel.add(field, BorderLayout.CENTER);
|
||||
return panel;
|
||||
|
||||
@@ -387,14 +387,17 @@ public class JBTable extends JTable implements ComponentWithEmptyText, Component
|
||||
UIUtil.changeBackGround(this, UIUtil.getTreeTextBackground());
|
||||
}
|
||||
|
||||
if (!isCellSelected(row, column) && isTableDecorationSupported() && isStriped() && result instanceof JComponent) {
|
||||
if (isTableDecorationSupported() && isStriped() && result instanceof JComponent) {
|
||||
final Color bg = row % 2 == 1 ? getBackground() : DECORATED_ROW_BG_COLOR;
|
||||
final JComponent c = (JComponent)result;
|
||||
c.setOpaque(true);
|
||||
c.setBackground(bg);
|
||||
for (Component child : c.getComponents()) {
|
||||
child.setBackground(bg);
|
||||
}
|
||||
final boolean cellSelected = isCellSelected(row, column);
|
||||
if (!cellSelected || (!hasFocus() && !getSelectionBackground().equals(c.getBackground()))) {
|
||||
c.setOpaque(true);
|
||||
c.setBackground(bg);
|
||||
for (Component child : c.getComponents()) {
|
||||
child.setBackground(bg);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!selected) return result;
|
||||
|
||||
Reference in New Issue
Block a user