]> gerrit.simantics Code Review - simantics/platform.git/commitdiff
NatTable based Graph Explorer styling fixes 79/4279/1
authorMarko Luukkainen <marko.luukkainen@semantum.fi>
Thu, 4 Jun 2020 13:11:11 +0000 (16:11 +0300)
committerMarko Luukkainen <marko.luukkainen@semantum.fi>
Thu, 4 Jun 2020 13:20:45 +0000 (13:20 +0000)
* 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)

bundles/org.simantics.browsing.ui.nattable/src/org/simantics/browsing/ui/nattable/GENatTableThemeConfiguration.java
bundles/org.simantics.browsing.ui.nattable/src/org/simantics/browsing/ui/nattable/GEStyler.java

index 80882b46cc0148290c19309a16a9809ce346468d..c1551274e48902138de4286ffcb0db5aaf5ad922 100644 (file)
@@ -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,
index c9c37ab50b5d98494894af1c6507ee669df254c5..e773ebb004002822dd7f257d77422be7a51e3292 100644 (file)
@@ -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));