Custom scroll bar

* Added PrimaryScrollBar class
* Implemented PrimaryScrollBar in ChatWindow for the ScrollPanes
vertical scroll bar
This commit is contained in:
DieGurke
2019-12-14 19:10:45 +01:00
parent 12b0cc1d0b
commit 4a2d6f913b
2 changed files with 106 additions and 0 deletions

View File

@ -1,5 +1,6 @@
package envoy.client.ui;
import java.awt.Color;
import java.awt.ComponentOrientation;
import java.awt.Font;
import java.awt.GridBagConstraints;
@ -252,6 +253,16 @@ public class ChatWindow extends JFrame {
// scrollPane
scrollPane.setForeground(theme.getBackgroundColor());
scrollPane.setBackground(theme.getCellColor());
// scrollPane.getVerticalScrollBar()
// .setBackground(
// new Color(theme.getBackgroundColor().getRed() + 50,
// theme.getBackgroundColor().getGreen() + 50,
// theme.getBackgroundColor().getBlue() + 50));
scrollPane.getVerticalScrollBar().setBackground(theme.getCellColor());
scrollPane.getVerticalScrollBar()
.setUI(new PrimaryScrollBar(5, theme.getInteractableBackgroundColor(),
new Color(theme.getInteractableBackgroundColor().getRGB() - 50),
new Color(theme.getInteractableBackgroundColor().getRGB() + 170)));
// messageEnterTextArea
messageEnterTextArea.setCaretColor(theme.getTypingMessageColor());
messageEnterTextArea.setForeground(theme.getTypingMessageColor());