From 0f1cbf3ac73b0fb2f8406c0ebc59743b9b770f0b Mon Sep 17 00:00:00 2001 From: Konstantin Bulenkov Date: Mon, 8 Dec 2014 16:06:58 +0100 Subject: [PATCH] spacing for action toolbar buttons --- .../openapi/actionSystem/impl/ActionButton.java | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/platform/platform-impl/src/com/intellij/openapi/actionSystem/impl/ActionButton.java b/platform/platform-impl/src/com/intellij/openapi/actionSystem/impl/ActionButton.java index dae10849c07e..ba93f8f3e1c5 100644 --- a/platform/platform-impl/src/com/intellij/openapi/actionSystem/impl/ActionButton.java +++ b/platform/platform-impl/src/com/intellij/openapi/actionSystem/impl/ActionButton.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2011 JetBrains s.r.o. + * Copyright 2000-2014 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -25,8 +25,7 @@ import com.intellij.openapi.actionSystem.ex.CustomComponentAction; import com.intellij.openapi.keymap.KeymapUtil; import com.intellij.openapi.util.Getter; import com.intellij.openapi.util.IconLoader; -import com.intellij.util.ui.EmptyIcon; -import com.intellij.util.ui.UIUtil; +import com.intellij.util.ui.*; import org.jetbrains.annotations.NonNls; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -38,11 +37,11 @@ import java.beans.PropertyChangeEvent; import java.beans.PropertyChangeListener; public class ActionButton extends JComponent implements ActionButtonComponent, AnActionHolder { - private static final Insets ICON_INSETS = new Insets(2, 2, 2, 2); + private static final Insets ICON_INSETS = new JBInsets(2, 2, 2, 2); private static final Icon ourEmptyIcon = EmptyIcon.ICON_18; - private Dimension myMinimumButtonSize; + private JBDimension myMinimumButtonSize; private PropertyChangeListener myActionButtonSynchronizer; private Icon myDisabledIcon; private Icon myIcon; @@ -72,7 +71,7 @@ public class ActionButton extends JComponent implements ActionButtonComponent, A myPlace = place; setFocusable(false); enableEvents(AWTEvent.MOUSE_EVENT_MASK); - myMinimumButtonSize = minimumSize; + myMinimumButtonSize = JBDimension.create(minimumSize); putClientProperty(UIUtil.CENTER_TOOLTIP_DEFAULT, Boolean.TRUE); } @@ -82,7 +81,7 @@ public class ActionButton extends JComponent implements ActionButtonComponent, A } public void setMinimumButtonSize(@NotNull Dimension size) { - myMinimumButtonSize = size; + myMinimumButtonSize = JBDimension.create(size); } public void paintChildren(Graphics g) {} @@ -213,7 +212,7 @@ public class ActionButton extends JComponent implements ActionButtonComponent, A public void setIconInsets(@Nullable Insets insets) { - myInsets = insets != null ? insets : new Insets(0,0,0,0); + myInsets = insets != null ? JBUI.insets(insets) : new Insets(0,0,0,0); } public Dimension getMinimumSize() {