Browse Source

Fixed button shadow size.

Signed-off-by: weisj <weisj@arcor.de>
pull/15/head
weisj 5 years ago
parent
commit
d44618f808
  1. 6
      build.gradle
  2. 1
      src/main/java/com/github/weisj/darklaf/ui/button/DarkButtonUI.java
  3. 1
      src/main/java/com/github/weisj/darklaf/ui/combobox/DarkComboBoxUI.java
  4. 4
      src/main/java/com/github/weisj/darklaf/ui/menu/DarkPopupMenuUI.java

6
build.gradle

@ -1,7 +1,5 @@
import org.gradle.internal.jvm.Jvm import org.gradle.internal.jvm.Jvm
plugins { plugins {
id 'com.github.johnrengelman.shadow' version '5.1.0' id 'com.github.johnrengelman.shadow' version '5.1.0'
id 'java' id 'java'
@ -15,7 +13,7 @@ repositories {
mavenLocal() mavenLocal()
mavenCentral() mavenCentral()
maven { maven {
url = 'http://repo.maven.apache.org/maven2' url = 'https://repo.maven.apache.org/maven2'
} }
} }
@ -50,7 +48,7 @@ publishing {
customizePom(pom) customizePom(pom)
groupId = 'com.github.weisj' groupId = 'com.github.weisj'
artifactId 'darklaf' artifactId 'darklaf'
version = '1.3.1.1' version = '1.3.1.2'
from components.java from components.java

1
src/main/java/com/github/weisj/darklaf/ui/button/DarkButtonUI.java

@ -161,6 +161,7 @@ public class DarkButtonUI extends BasicButtonUI {
if (isFullShadow(c)) { if (isFullShadow(c)) {
g.fillRect(0, 0, c.getWidth(), c.getHeight()); g.fillRect(0, 0, c.getWidth(), c.getHeight());
} else { } else {
margin.set(0, 0, 0, 0);
DarkUIUtil.fillRoundRect((Graphics2D) g, margin.left, margin.top, DarkUIUtil.fillRoundRect((Graphics2D) g, margin.left, margin.top,
c.getWidth() - margin.left - margin.right, c.getWidth() - margin.left - margin.right,
c.getHeight() - margin.top - margin.bottom, arc); c.getHeight() - margin.top - margin.bottom, arc);

1
src/main/java/com/github/weisj/darklaf/ui/combobox/DarkComboBoxUI.java

@ -58,7 +58,6 @@ public class DarkComboBoxUI extends BasicComboBoxUI implements Border {
private final MouseListener mouseListener = new MouseAdapter() { private final MouseListener mouseListener = new MouseAdapter() {
@Override @Override
public void mousePressed(final MouseEvent e) { public void mousePressed(final MouseEvent e) {
super.mousePressed(e);
comboBox.getEditor().getEditorComponent().requestFocus(); comboBox.getEditor().getEditorComponent().requestFocus();
} }
}; };

4
src/main/java/com/github/weisj/darklaf/ui/menu/DarkPopupMenuUI.java

@ -107,8 +107,8 @@ public class DarkPopupMenuUI extends BasicPopupMenuUI {
Field field = BasicPopupMenuUI.class.getDeclaredField("MOUSE_GRABBER_KEY"); Field field = BasicPopupMenuUI.class.getDeclaredField("MOUSE_GRABBER_KEY");
field.setAccessible(true); field.setAccessible(true);
Object value = field.get(null); Object value = field.get(null);
MouseGrabber mouseGrabber = (MouseGrabber) context.get(value); Object mouseGrabber = context.get(value);
if (mouseGrabber != null) { if (mouseGrabber instanceof MouseGrabber) {
Method method = mouseGrabber.getClass().getDeclaredMethod("uninstall"); Method method = mouseGrabber.getClass().getDeclaredMethod("uninstall");
method.setAccessible(true); method.setAccessible(true);
method.invoke(mouseGrabber); method.invoke(mouseGrabber);

Loading…
Cancel
Save