From 97f154abdea7d1bafac9a0e88f1d16c88ec9edba Mon Sep 17 00:00:00 2001 From: hzzz Date: Fri, 4 Aug 2017 15:07:20 +0800 Subject: [PATCH] scroll bar --- designer_base/src/com/fr/design/constants/UIConstants.java | 6 +++--- .../src/com/fr/design/gui/icontainer/UIScrollPane.java | 4 ++++ .../src/com/fr/design/gui/icontainer/UIScrollPaneUI.java | 3 +++ .../src/com/fr/design/gui/iscrollbar/UIScrollBarUI.java | 3 +-- 4 files changed, 11 insertions(+), 5 deletions(-) diff --git a/designer_base/src/com/fr/design/constants/UIConstants.java b/designer_base/src/com/fr/design/constants/UIConstants.java index c956265661..1bfd9b7631 100644 --- a/designer_base/src/com/fr/design/constants/UIConstants.java +++ b/designer_base/src/com/fr/design/constants/UIConstants.java @@ -70,7 +70,7 @@ public interface UIConstants { public static final Color SHADOW_GREY = new Color(217, 218, 221); public static final Color SHADOW_CENTER = new Color(200, 200, 200); public static final Color SHADOW_PURPLE = new Color(255, 0, 255); - public static final Color FLESH_BLUE = new Color(70, 157, 246); + public static final Color FLESH_BLUE = new Color(65, 155, 249); public static final Color HOVER_BLUE = new Color(0xd2d2d2); public static final Color DOTTED_LINE_COLOR = new Color(35, 108, 184); public static final Color AUTHORITY_COLOR = new Color(88, 125, 153); @@ -142,9 +142,9 @@ public interface UIConstants { public static final Icon LIST_EDIT_WHITE_ICON = BaseUtils.readIcon("/com/fr/design/images/control/edit.png"); public static final Color PRESSED_DARK_GRAY = new Color(127, 127, 127); public static final Color GRDIENT_DARK_GRAY = new Color(45, 45, 45); - public static final Color BARNOMAL = new Color(153, 153, 153); + public static final Color BARNOMAL = new Color(232, 232, 233); public static final int ARC = 0; - public static final int LARGEARC = 0; + public static final int LARGEARC = 6; public static final Stroke BS = new BasicStroke(1f, BasicStroke.CAP_BUTT, BasicStroke.JOIN_ROUND, 2f, new float[]{3, 1}, 0); public static final Icon PREVIEW_DOWN = BaseUtils.readIcon("com/fr/design/images/buttonicon/prevew_down_icon.png"); public static final Icon CLOSE_OF_AUTHORITY = BaseUtils.readIcon("/com/fr/design/images/m_report/close.png"); diff --git a/designer_base/src/com/fr/design/gui/icontainer/UIScrollPane.java b/designer_base/src/com/fr/design/gui/icontainer/UIScrollPane.java index 5c71efc7a0..9f2808df89 100644 --- a/designer_base/src/com/fr/design/gui/icontainer/UIScrollPane.java +++ b/designer_base/src/com/fr/design/gui/icontainer/UIScrollPane.java @@ -19,6 +19,10 @@ public class UIScrollPane extends JScrollPane { this.setHorizontalScrollBar(createHorizontalScrollBar()); this.getVerticalScrollBar().setUnitIncrement(30); this.getVerticalScrollBar().setBlockIncrement(30); + this.getHorizontalScrollBar().setOpaque(true); + this.getHorizontalScrollBar().setBackground(Color.WHITE); + this.getVerticalScrollBar().setOpaque(true); + this.getVerticalScrollBar().setBackground(Color.WHITE); } @Override diff --git a/designer_base/src/com/fr/design/gui/icontainer/UIScrollPaneUI.java b/designer_base/src/com/fr/design/gui/icontainer/UIScrollPaneUI.java index 82d0363c70..20b7a43011 100644 --- a/designer_base/src/com/fr/design/gui/icontainer/UIScrollPaneUI.java +++ b/designer_base/src/com/fr/design/gui/icontainer/UIScrollPaneUI.java @@ -4,6 +4,7 @@ import javax.swing.*; import javax.swing.plaf.ComponentUI; import javax.swing.plaf.metal.MetalScrollBarUI; import javax.swing.plaf.metal.MetalScrollPaneUI; +import java.awt.*; import java.beans.PropertyChangeEvent; import java.beans.PropertyChangeListener; @@ -35,11 +36,13 @@ public class UIScrollPaneUI extends MetalScrollPaneUI implements PropertyChangeL // Note: It never happened before Java 1.5 that scrollbar is null JScrollBar sb = scrollpane.getHorizontalScrollBar(); if (sb != null) { + sb.setBackground(Color.red); sb.putClientProperty(MetalScrollBarUI.FREE_STANDING_PROP, Boolean.FALSE); } sb = scrollpane.getVerticalScrollBar(); if (sb != null) { + sb.setBackground(Color.red); sb.putClientProperty(MetalScrollBarUI.FREE_STANDING_PROP, Boolean.FALSE); } } diff --git a/designer_base/src/com/fr/design/gui/iscrollbar/UIScrollBarUI.java b/designer_base/src/com/fr/design/gui/iscrollbar/UIScrollBarUI.java index d039e81628..a640df9880 100644 --- a/designer_base/src/com/fr/design/gui/iscrollbar/UIScrollBarUI.java +++ b/designer_base/src/com/fr/design/gui/iscrollbar/UIScrollBarUI.java @@ -467,8 +467,7 @@ public class UIScrollBarUI extends ScrollBarUI implements LayoutManager, SwingCo g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); g2.translate(thumbBounds.x, thumbBounds.y); - Color color = isDragging ? UIConstants.LINE_COLOR : UIConstants.BARNOMAL; - color = isPressing ? UIConstants.LINE_COLOR : UIConstants.BARNOMAL; + Color color = isPressing ? UIConstants.LINE_COLOR : UIConstants.BARNOMAL; g2.setColor(color); g2.fillRoundRect(1, 1, width - 2, height - 2, UIConstants.LARGEARC, UIConstants.LARGEARC);