From d162802f90f0d913d53c0244505a023b6c0f08cd Mon Sep 17 00:00:00 2001 From: Marko Luukkainen Date: Thu, 4 Jun 2020 16:11:11 +0300 Subject: [PATCH] NatTable based Graph Explorer styling fixes * Do not use trim for cell content. * Use custom font for selected and hover cells. gitlab #547 Change-Id: I6d358f829e75a9bb0fd43efdbab9f1961e079f99 --- .../browsing/ui/nattable/GENatTableThemeConfiguration.java | 4 +++- .../src/org/simantics/browsing/ui/nattable/GEStyler.java | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/bundles/org.simantics.browsing.ui.nattable/src/org/simantics/browsing/ui/nattable/GENatTableThemeConfiguration.java b/bundles/org.simantics.browsing.ui.nattable/src/org/simantics/browsing/ui/nattable/GENatTableThemeConfiguration.java index 80882b46c..c1551274e 100644 --- a/bundles/org.simantics.browsing.ui.nattable/src/org/simantics/browsing/ui/nattable/GENatTableThemeConfiguration.java +++ b/bundles/org.simantics.browsing.ui.nattable/src/org/simantics/browsing/ui/nattable/GENatTableThemeConfiguration.java @@ -15,12 +15,14 @@ public class GENatTableThemeConfiguration extends ModernNatTableThemeConfigurati public GENatTableThemeConfiguration(GETreeData treeData, int style) { super(); + TextPainter cellTextPainter = new TextPainter(); + cellTextPainter.setTrimText(false); this.oddRowBgColor = GUIHelper.getColor(250, 250, 250); this.defaultCellPainter = new GEStyler(treeData, new GEIconPainter( new PaddingDecorator( - new TextPainter(), + cellTextPainter, 0, 5, 0, diff --git a/bundles/org.simantics.browsing.ui.nattable/src/org/simantics/browsing/ui/nattable/GEStyler.java b/bundles/org.simantics.browsing.ui.nattable/src/org/simantics/browsing/ui/nattable/GEStyler.java index c9c37ab50..e773ebb00 100644 --- a/bundles/org.simantics.browsing.ui.nattable/src/org/simantics/browsing/ui/nattable/GEStyler.java +++ b/bundles/org.simantics.browsing.ui.nattable/src/org/simantics/browsing/ui/nattable/GEStyler.java @@ -42,6 +42,8 @@ public class GEStyler extends CellPainterWrapper{ style.setAttributeValue(CellStyleAttributes.IMAGE, image); wrapper.setSpecificConfigAttribute(CellConfigAttributes.CELL_STYLE, DisplayMode.NORMAL, "BODY", style); + wrapper.setSpecificConfigAttribute(CellConfigAttributes.CELL_STYLE, DisplayMode.SELECT, "BODY", style); + wrapper.setSpecificConfigAttribute(CellConfigAttributes.CELL_STYLE, DisplayMode.SELECT_HOVER, "BODY", style); // wrapper.setSpecificConfigAttribute(CellStyleAttributes.FOREGROUND_COLOR, DisplayMode.NORMAL, "BODY", style.getAttributeValue(CellStyleAttributes.FOREGROUND_COLOR)); // wrapper.setSpecificConfigAttribute(CellStyleAttributes.BACKGROUND_COLOR, DisplayMode.NORMAL, "BODY", style.getAttributeValue(CellStyleAttributes.BACKGROUND_COLOR)); // wrapper.setSpecificConfigAttribute(CellStyleAttributes.FONT, DisplayMode.NORMAL, "BODY", style.getAttributeValue(CellStyleAttributes.FONT)); -- 2.43.2