From 50136dd4c66ab4d3390299802788c958985f1d45 Mon Sep 17 00:00:00 2001 From: Hendrik Schreiber Date: Mon, 28 Nov 2016 10:38:07 +0100 Subject: [PATCH] Added missing UI for JToggleButton. --- build/darcula.jar | Bin 337102 -> 337657 bytes src/com/bulenkov/darcula/darcula.properties | 2 ++ .../bulenkov/darcula/ui/DarculaButtonUI.java | 6 ++-- .../darcula/ui/DarculaToggleButtonUI.java | 30 ++++++++++++++++++ 4 files changed, 35 insertions(+), 3 deletions(-) create mode 100755 src/com/bulenkov/darcula/ui/DarculaToggleButtonUI.java diff --git a/build/darcula.jar b/build/darcula.jar index 7e8c8de91edb501f62c4c5df1ba7fb6b88b1aaae..04c0b58985f830360e92d1499022e69ce2773876 100644 GIT binary patch delta 7865 zcmZvhc_38Z`^U|ldu?Nzu`k(`P_~dzvLs3jvQ)B#6e1-_NuQDws=-l`sHC*m6%t9S zvW2XnO-j}*g?{JG)qLvn{na0H->>I6&)J@{-0Rgdq3M@GyteDes1O?`Cnwt{`-n5V z`AYD|lI@RwD17$X6`+ngaRYl z;xyT{srr_er9Sm4$eGx54y23Mk4AOei#W=DHzRUgX{|+j^u%Yo69MwZ>ZTQT`610i z+nPT+ok_lAK2VXbmvzm}EzK-+AbD#5t*H`Sb3ay|n%u=kxNZ zzxo|le<78NP4InC-`{w*#xlzy|A_tsJNx5jHbK^Vg#)g8(v5eNZgrasEO+aj_5r&nQ<}XRMw8PcW<&~a+?o{eA;%U z<(KU`4$hn3ubMw)hvO^8sJD>2 zv4frL1l0o-R2p1rL1iP8oc6m*Z501yonN-A;N19Adg=X>MO_y<6ds+gPgV?&O)1o| z$ioU5U6xvdK6+nki>-|WgcGYJ6CP27Z*j`km9V~TQEB26SX-)x$0KUUEU$Jhh@Wo(_sk?;dd&3MkrVR!~#X94!@qh^m_XA zmVx+HQK)goB6h=qr&t_BjWu7dGxJyn?oQts9^s6wUbMdga`pPfWq=*gAJ3mx^ z3NCryX@5$+=c9b*Np&mj$;fBTt7X1D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7$k9dIGQHOWLGUd+OKJ0W(FggCg1i$y?sADIenNWxMEy8p&>pehBcj_vsy zOM=r2hqzb?#7INO!na%^0ork&>`$|ZwG6BuJ{z1-fb|Q2EE(uy zO9254I4+Q2z=a1GOuw>zM(CA!~Iif8}2!BcR&t51D z+~x3j6DMq`a&R@NOA%s34sL@Q(uB~JMdk3#lZkARCCD{-SY-%<5RpnK=f{B{ad%Y( znDmD-VOy(!IU=7_xq=roE5PoE&cTTqkY~czZ5J7C%bddP7%=n(6SsLI^}6^~74$G* zK!phqQN%ovLzXyH1S!_=yp*a4OL|~K5GN%}2n;J?i;(UGTw;ST78BxMCAb|Qv?oOJ z5>x{JMe_T$n#%CD6%IgI4L(%sl;JSkTtbL@%5WI$oC)FPhVlZ23TBKrE#ne8kez{f z(p4}9qUTQFMitB&F`L4lDf?8DP71UaAz*X#H;T&RQT7&ro)O$k$jRba6=_C_j_ z3E$Id@HwbtgM}KfG&gmO7fh?cMTi~a5*wuSI3Wtv@zSp1LIcn=;4{4|9~Ybt1z@)Z ie0Q=czzGf5rArl{NduD=8s{13@$ur}@vF!GVfcT!6Z1F# diff --git a/src/com/bulenkov/darcula/darcula.properties b/src/com/bulenkov/darcula/darcula.properties index ff27b66..5757c27 100755 --- a/src/com/bulenkov/darcula/darcula.properties +++ b/src/com/bulenkov/darcula/darcula.properties @@ -144,6 +144,8 @@ Button.darcula.selection.color2=233143 Button.darcula.selectedButtonForeground=bbbbbb Button.darcula.disabledText.shadow=00000000 +ToggleButtonUI=com.bulenkov.darcula.ui.DarculaToggleButtonUI + MenuItem.acceleratorForeground=eeeeee PopupMenu.translucentBackground=3c3f41 diff --git a/src/com/bulenkov/darcula/ui/DarculaButtonUI.java b/src/com/bulenkov/darcula/ui/DarculaButtonUI.java index 8aabf6d..35abf1c 100755 --- a/src/com/bulenkov/darcula/ui/DarculaButtonUI.java +++ b/src/com/bulenkov/darcula/ui/DarculaButtonUI.java @@ -45,11 +45,11 @@ public class DarculaButtonUI extends BasicButtonUI { final Border border = c.getBorder(); final GraphicsConfig config = GraphicsUtil.setupAAPainting(g); final boolean square = isSquare(c); - if (c.isEnabled() && border != null && ((JButton)c).isContentAreaFilled()) { + if (c.isEnabled() && border != null && ((AbstractButton)c).isContentAreaFilled()) { final Insets ins = border.getBorderInsets(c); final int yOff = (ins.top + ins.bottom) / 4; if (!square) { - if (((JButton)c).isDefaultButton()) { + if (c instanceof JButton && ((JButton)c).isDefaultButton() || c instanceof JToggleButton && ((JToggleButton)c).isSelected()) { ((Graphics2D)g).setPaint(new GradientPaint(0, 0, getSelectedButtonColor1(), 0, c.getHeight(), getSelectedButtonColor2())); } else { @@ -99,7 +99,7 @@ public class DarculaButtonUI extends BasicButtonUI { @Override public void update(Graphics g, JComponent c) { super.update(g, c); - if (((JButton)c).isDefaultButton() && !SystemInfo.isMac) { + if (c instanceof JButton && ((JButton)c).isDefaultButton() && !SystemInfo.isMac) { if (!c.getFont().isBold()) { c.setFont(c.getFont().deriveFont(Font.BOLD)); } diff --git a/src/com/bulenkov/darcula/ui/DarculaToggleButtonUI.java b/src/com/bulenkov/darcula/ui/DarculaToggleButtonUI.java new file mode 100755 index 0000000..bf64276 --- /dev/null +++ b/src/com/bulenkov/darcula/ui/DarculaToggleButtonUI.java @@ -0,0 +1,30 @@ +/* + * Copyright 2000-2016 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. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.bulenkov.darcula.ui; + +import javax.swing.*; +import javax.swing.plaf.ComponentUI; + +/** + * @author Konstantin Bulenkov + */ +public class DarculaToggleButtonUI extends DarculaButtonUI { + @SuppressWarnings("MethodOverridesStaticMethodOfSuperclass") + public static ComponentUI createUI(JComponent c) { + return new DarculaToggleButtonUI(); + } + +}