From c2f77e0dc7703dfeed1274e06142fef160f51262 Mon Sep 17 00:00:00 2001 From: Dmitry Batkovich Date: Sat, 22 Nov 2014 11:00:48 +0300 Subject: [PATCH] inspection tree table: added right margin --- .../ui/inspectionsTree/InspectionsConfigTreeTable.java | 7 ++++++- .../ui/table/ThreeStateCheckBoxRenderer.java | 2 ++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/platform/lang-impl/src/com/intellij/profile/codeInspection/ui/inspectionsTree/InspectionsConfigTreeTable.java b/platform/lang-impl/src/com/intellij/profile/codeInspection/ui/inspectionsTree/InspectionsConfigTreeTable.java index 09162190c101..b7491c1373ce 100644 --- a/platform/lang-impl/src/com/intellij/profile/codeInspection/ui/inspectionsTree/InspectionsConfigTreeTable.java +++ b/platform/lang-impl/src/com/intellij/profile/codeInspection/ui/inspectionsTree/InspectionsConfigTreeTable.java @@ -28,6 +28,7 @@ import com.intellij.openapi.application.ModalityState; import com.intellij.openapi.diagnostic.Logger; import com.intellij.openapi.project.Project; import com.intellij.openapi.util.Comparing; +import com.intellij.openapi.util.SystemInfo; import com.intellij.openapi.util.text.StringUtil; import com.intellij.profile.codeInspection.ui.InspectionsAggregationUtil; import com.intellij.profile.codeInspection.ui.SingleInspectionProfilePanel; @@ -68,6 +69,10 @@ public class InspectionsConfigTreeTable extends TreeTable { private final static int SEVERITIES_COLUMN = 1; private final static int IS_ENABLED_COLUMN = 2; + public static int getAdditionalShift() { + return SystemInfo.isMac ? 10 : 0; + } + public static InspectionsConfigTreeTable create(final InspectionsConfigTreeTableSettings settings, Disposable parentDisposable) { return new InspectionsConfigTreeTable(new InspectionsConfigTreeTableModel(settings, parentDisposable)); } @@ -79,7 +84,7 @@ public class InspectionsConfigTreeTable extends TreeTable { severitiesColumn.setMaxWidth(20); final TableColumn isEnabledColumn = getColumnModel().getColumn(IS_ENABLED_COLUMN); - isEnabledColumn.setMaxWidth(20); + isEnabledColumn.setMaxWidth(20 + getAdditionalShift()); isEnabledColumn.setCellRenderer(new ThreeStateCheckBoxRenderer()); isEnabledColumn.setCellEditor(new ThreeStateCheckBoxRenderer()); diff --git a/platform/lang-impl/src/com/intellij/profile/codeInspection/ui/table/ThreeStateCheckBoxRenderer.java b/platform/lang-impl/src/com/intellij/profile/codeInspection/ui/table/ThreeStateCheckBoxRenderer.java index 9e2a4ead10f1..6cb2a2dc7ec5 100644 --- a/platform/lang-impl/src/com/intellij/profile/codeInspection/ui/table/ThreeStateCheckBoxRenderer.java +++ b/platform/lang-impl/src/com/intellij/profile/codeInspection/ui/table/ThreeStateCheckBoxRenderer.java @@ -15,6 +15,7 @@ */ package com.intellij.profile.codeInspection.ui.table; +import com.intellij.profile.codeInspection.ui.inspectionsTree.InspectionsConfigTreeTable; import com.intellij.util.SmartList; import com.intellij.util.ui.ThreeStateCheckBox; import com.intellij.util.ui.UIUtil; @@ -42,6 +43,7 @@ public class ThreeStateCheckBoxRenderer extends ThreeStateCheckBox implements Ta setThirdStateEnabled(false); setHorizontalAlignment(CENTER); setVerticalAlignment(CENTER); + setBorder(BorderFactory.createEmptyBorder(0, 0, 0, InspectionsConfigTreeTable.getAdditionalShiftIfMac())); addItemListener(new ItemListener() { @Override public void itemStateChanged(ItemEvent e) {