Skip to content

Commit

Permalink
adjust column width of marker
Browse files Browse the repository at this point in the history
  • Loading branch information
d-akara committed May 13, 2018
1 parent e122088 commit 0005884
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion dakara.eclipse.commander.feature/feature.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<feature
id="dakara.eclipse.commander.feature"
label="Commander Feature"
version="1.2.0">
version="1.3.0">

<description url="https://github.com/dakaraphi/eclipse-plugin-commander">
1) Commander - a more powerful version of quick access
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ protected void paint(Event event, Object element) {

gc.setForeground(fromRegistry(markerColor));
gc.setBackground(fromRegistry(markerColor));
gc.fillRectangle(bounds.x, bounds.y + 2, 3, bounds.height - 4);
gc.fillRectangle(bounds.x, bounds.y + 2, getAdjustmentForMarkerWidth(), bounds.height - 4);
}
super.paint(event, element);
}
Expand Down Expand Up @@ -182,10 +182,12 @@ private String getColumnIdFromColumnIndex(int columnIndex) {
}

private StyleRange[] createStyles(List<Integer> matches) {
List<StyleRange> styles = new ArrayList<StyleRange>();
for (Integer match : matches) {
styles.add(new StyleRange(match, 1, null, fromRegistry(new RGB(150,190,255))));
}
return styles.toArray(new StyleRange[]{});
List<StyleRange> styles = new ArrayList<StyleRange>();
for (Integer match : matches) {
styles.add(new StyleRange(match, 1, null, fromRegistry(new RGB(150,190,255))));
}
return styles.toArray(new StyleRange[]{});
}

private int getAdjustmentForMarkerWidth() {return SWT.getPlatform().equals("win32") ? 3 : 2;}
}

0 comments on commit 0005884

Please sign in to comment.