Browse Source

Formatting.

pull/170/head
weisj 5 years ago
parent
commit
8e4ce7dc1f
  1. 3
      core/src/main/java/com/github/weisj/darklaf/components/color/PopupColorChooser.java
  2. 12
      core/src/main/java/com/github/weisj/darklaf/components/text/SearchTextFieldWithHistory.java
  3. 3
      core/src/main/java/com/github/weisj/darklaf/components/tooltip/ToolTipContext.java
  4. 6
      core/src/test/java/ui/button/ButtonDemo.java
  5. 4
      core/src/test/java/ui/label/LoadIndicatorDemo.java

3
core/src/main/java/com/github/weisj/darklaf/components/color/PopupColorChooser.java

@ -129,8 +129,7 @@ public class PopupColorChooser extends JToolTip {
} }
protected ToolTipContext createToolTipContext() { protected ToolTipContext createToolTipContext() {
return new ToolTipContext() return new ToolTipContext().setAlignment(Alignment.CENTER)
.setAlignment(Alignment.CENTER)
.setCenterAlignment(Alignment.SOUTH) .setCenterAlignment(Alignment.SOUTH)
.setUseBestFit(true) .setUseBestFit(true)
.setToolTipInsets(new Insets(2, 2, 2, 2)) .setToolTipInsets(new Insets(2, 2, 2, 2))

12
core/src/main/java/com/github/weisj/darklaf/components/text/SearchTextFieldWithHistory.java

@ -24,6 +24,9 @@
*/ */
package com.github.weisj.darklaf.components.text; package com.github.weisj.darklaf.components.text;
import com.github.weisj.darklaf.ui.text.DarkTextFieldUI;
import com.github.weisj.darklaf.ui.text.DarkTextUI;
import java.util.List; import java.util.List;
import javax.swing.text.Document; import javax.swing.text.Document;
@ -64,7 +67,7 @@ public class SearchTextFieldWithHistory extends SearchTextField {
public SearchTextFieldWithHistory(final Document doc, final String text, final int columns) { public SearchTextFieldWithHistory(final Document doc, final String text, final int columns) {
super(doc, text, columns); super(doc, text, columns);
history = new TextFieldHistoryPopup(this, 100, 800); history = new TextFieldHistoryPopup(this, 100, 800);
putClientProperty("JTextField.Search.FindPopup", history); putClientProperty(DarkTextFieldUI.KEY_FIND_POPUP, history);
} }
/** /**
@ -169,11 +172,4 @@ public class SearchTextFieldWithHistory extends SearchTextField {
public int getLength() { public int getLength() {
return history.getLength(); return history.getLength();
} }
public void setHistoryLength(final int length) {
if (length < 0) throw new IllegalArgumentException("History can't have negative size");
if (length == 0) {
putClientProperty("JTextField.Search.FindPopup", null);
}
}
} }

3
core/src/main/java/com/github/weisj/darklaf/components/tooltip/ToolTipContext.java

@ -413,8 +413,7 @@ public class ToolTipContext {
* @see #setInsideArea(Area) * @see #setInsideArea(Area)
*/ */
public ToolTipContext setInsideArea(final Rectangle insideRect) { public ToolTipContext setInsideArea(final Rectangle insideRect) {
this.hotSpotArea = new Area(insideRect); return setInsideArea(new Area(insideRect));
return this;
} }
/** /**

6
core/src/test/java/ui/button/ButtonDemo.java

@ -122,12 +122,10 @@ public class ButtonDemo implements ComponentDemo {
controlPanel = panel.addControls(); controlPanel = panel.addControls();
controlPanel.add(new QuickColorChooser(DarkButtonUI.KEY_HOVER_COLOR, Color.BLACK, controlPanel.add(new QuickColorChooser(DarkButtonUI.KEY_HOVER_COLOR, Color.BLACK,
(b, c) -> button (b, c) -> button.putClientProperty(DarkButtonUI.KEY_HOVER_COLOR,
.putClientProperty(DarkButtonUI.KEY_HOVER_COLOR,
b ? c : null))); b ? c : null)));
controlPanel.add(new QuickColorChooser(DarkButtonUI.KEY_HOVER_COLOR, Color.BLACK, controlPanel.add(new QuickColorChooser(DarkButtonUI.KEY_HOVER_COLOR, Color.BLACK,
(b, c) -> button (b, c) -> button.putClientProperty(DarkButtonUI.KEY_CLICK_COLOR,
.putClientProperty(DarkButtonUI.KEY_CLICK_COLOR,
b ? c : null))); b ? c : null)));
controlPanel = panel.addControls(); controlPanel = panel.addControls();

4
core/src/test/java/ui/label/LoadIndicator.java → core/src/test/java/ui/label/LoadIndicatorDemo.java

@ -32,10 +32,10 @@ import ui.DemoResources;
import com.github.weisj.darklaf.components.loading.LoadingIndicator; import com.github.weisj.darklaf.components.loading.LoadingIndicator;
public class LoadIndicator extends LabelDemoBase<LoadingIndicator> { public class LoadIndicatorDemo extends LabelDemoBase<LoadingIndicator> {
public static void main(final String[] args) { public static void main(final String[] args) {
ComponentDemo.showDemo(new LoadIndicator()); ComponentDemo.showDemo(new LoadIndicatorDemo());
} }
@Override @Override
Loading…
Cancel
Save