Fixed vertical scroll bar drawing on 4K monitors
This commit is contained in:
parent
0cd0380c87
commit
7de411f735
@ -195,7 +195,6 @@ public class ChatWindow extends JFrame {
|
||||
@SuppressWarnings("unchecked")
|
||||
final JList<User> selectedUserList = (JList<User>) listSelectionEvent.getSource();
|
||||
final User user = selectedUserList.getSelectedValue();
|
||||
client.setRecipient(user);
|
||||
|
||||
currentChat = localDB.getChats().stream().filter(chat -> chat.getRecipient().getID() == user.getID()).findFirst().get();
|
||||
|
||||
|
@ -68,7 +68,7 @@ public class PrimaryScrollBar extends BasicScrollBarUI {
|
||||
Color color;
|
||||
JScrollBar sb = (JScrollBar) c;
|
||||
|
||||
if (!sb.isEnabled() || (isVertical && r.width > r.height) || (!isVertical && r.width < r.height)) return;
|
||||
if (!sb.isEnabled()) return;
|
||||
|
||||
if (isDragging) color = draggingColor;
|
||||
else if (isThumbRollover()) color = hoverColor;
|
||||
@ -76,9 +76,9 @@ public class PrimaryScrollBar extends BasicScrollBarUI {
|
||||
|
||||
g2.setPaint(color);
|
||||
if (isVertical) {
|
||||
g2.fillRoundRect(r.x + 9, r.y, r.width - 10, r.height, arcSize, arcSize);
|
||||
g2.fillRoundRect(r.x - 9, r.y, r.width, r.height, arcSize, arcSize);
|
||||
g2.setPaint(Settings.getInstance().getThemes().get(Settings.getInstance().getCurrentTheme()).getCellColor());
|
||||
g2.drawRoundRect(r.x + 9, r.y, r.width - 10, r.height, arcSize, arcSize);
|
||||
g2.drawRoundRect(r.x - 9, r.y, r.width, r.height, arcSize, arcSize);
|
||||
} else {
|
||||
g2.fillRoundRect(r.x, r.y + 9, r.width, r.height - 10, arcSize, arcSize);
|
||||
g2.setPaint(Settings.getInstance().getThemes().get(Settings.getInstance().getCurrentTheme()).getCellColor());
|
||||
|
@ -21,7 +21,7 @@ public class PrimaryScrollPane extends JScrollPane {
|
||||
|
||||
/**
|
||||
* Styles the vertical and horizontal scroll bars.
|
||||
*
|
||||
*
|
||||
* @param theme
|
||||
* @since Envoy v0.2-alpha
|
||||
*/
|
||||
@ -31,6 +31,7 @@ public class PrimaryScrollPane extends JScrollPane {
|
||||
|
||||
getVerticalScrollBar().setBackground(theme.getCellColor());
|
||||
getVerticalScrollBar().setUI(new PrimaryScrollBar(theme, true));
|
||||
|
||||
getHorizontalScrollBar().setBackground(theme.getCellColor());
|
||||
getHorizontalScrollBar().setUI(new PrimaryScrollBar(theme, false));
|
||||
}
|
||||
@ -45,7 +46,7 @@ public class PrimaryScrollPane extends JScrollPane {
|
||||
* </br>
|
||||
* When rereading messages, the chat doesn't scroll down if new messages </br>
|
||||
* are added. (Besides see first point)
|
||||
*
|
||||
*
|
||||
* @since Envoy v0.2-alpha
|
||||
*/
|
||||
public void autoscroll() {
|
||||
|
Reference in New Issue
Block a user