From: Marko Luukkainen Date: Thu, 4 Jun 2020 13:11:11 +0000 (+0300) Subject: NatTable based Graph Explorer styling fixes X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=commitdiff_plain;h=ea1129b29fa21633cfc1df0d6a04b4bcb521b008;p=simantics%2Fplatform.git 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 (cherry picked from commit d162802f90f0d913d53c0244505a023b6c0f08cd) --- 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));