@ -0,0 +1,9 @@ |
|||||||
|
plugins { |
||||||
|
`java-library` |
||||||
|
} |
||||||
|
|
||||||
|
dependencies { |
||||||
|
implementation(project(":darklaf-utils")) |
||||||
|
implementation("com.formdev:svgSalamander") |
||||||
|
} |
||||||
|
|
@ -0,0 +1,29 @@ |
|||||||
|
/* |
||||||
|
* MIT License |
||||||
|
* |
||||||
|
* Copyright (c) 2020 Jannis Weis |
||||||
|
* |
||||||
|
* Permission is hereby granted, free of charge, to any person obtaining a copy |
||||||
|
* of this software and associated documentation files (the "Software"), to deal |
||||||
|
* in the Software without restriction, including without limitation the rights |
||||||
|
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
||||||
|
* copies of the Software, and to permit persons to whom the Software is |
||||||
|
* furnished to do so, subject to the following conditions: |
||||||
|
* |
||||||
|
* The above copyright notice and this permission notice shall be included in all |
||||||
|
* copies or substantial portions of the Software. |
||||||
|
* |
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
||||||
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
||||||
|
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
||||||
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
||||||
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
||||||
|
* SOFTWARE. |
||||||
|
*/ |
||||||
|
package com.github.weisj.darklaf.icons; |
||||||
|
|
||||||
|
public enum AwareIconStyle { |
||||||
|
DARK, |
||||||
|
LIGHT |
||||||
|
} |
@ -1,79 +0,0 @@ |
|||||||
/* |
|
||||||
* MIT License |
|
||||||
* |
|
||||||
* Copyright (c) 2020 Jannis Weis |
|
||||||
* |
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy |
|
||||||
* of this software and associated documentation files (the "Software"), to deal |
|
||||||
* in the Software without restriction, including without limitation the rights |
|
||||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
|
||||||
* copies of the Software, and to permit persons to whom the Software is |
|
||||||
* furnished to do so, subject to the following conditions: |
|
||||||
* |
|
||||||
* The above copyright notice and this permission notice shall be included in all |
|
||||||
* copies or substantial portions of the Software. |
|
||||||
* |
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
|
||||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
|
||||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
|
||||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
|
||||||
* SOFTWARE. |
|
||||||
*/ |
|
||||||
package com.github.weisj.darklaf.platform.windows.ui; |
|
||||||
|
|
||||||
import javax.swing.*; |
|
||||||
import javax.swing.plaf.basic.BasicButtonUI; |
|
||||||
import java.awt.*; |
|
||||||
|
|
||||||
/** |
|
||||||
* @author Jannis Weis |
|
||||||
*/ |
|
||||||
public class CloseButtonUI extends BasicButtonUI { |
|
||||||
|
|
||||||
protected static final Rectangle viewRect = new Rectangle(); |
|
||||||
protected static final Rectangle textRect = new Rectangle(); |
|
||||||
protected static final Rectangle iconRect = new Rectangle(); |
|
||||||
|
|
||||||
protected Color closeHover; |
|
||||||
protected Color closeClick; |
|
||||||
|
|
||||||
@Override |
|
||||||
protected void installDefaults(final AbstractButton b) { |
|
||||||
super.installDefaults(b); |
|
||||||
closeHover = UIManager.getColor("TitlePane.close.rollOverColor"); |
|
||||||
closeClick = UIManager.getColor("TitlePane.close.clickColor"); |
|
||||||
} |
|
||||||
|
|
||||||
protected String layout(final AbstractButton b, final JComponent c, final FontMetrics fm, |
|
||||||
final int width, final int height) { |
|
||||||
Insets i = b.getInsets(); |
|
||||||
viewRect.x = i.left; |
|
||||||
viewRect.y = i.top; |
|
||||||
viewRect.width = width - (i.right + viewRect.x); |
|
||||||
viewRect.height = height - (i.bottom + viewRect.y); |
|
||||||
|
|
||||||
textRect.x = textRect.y = textRect.width = textRect.height = 0; |
|
||||||
iconRect.x = iconRect.y = iconRect.width = iconRect.height = 0; |
|
||||||
|
|
||||||
// layout the text and icon
|
|
||||||
return SwingUtilities.layoutCompoundLabel( |
|
||||||
b, fm, b.getText(), b.getIcon(), |
|
||||||
b.getVerticalAlignment(), b.getHorizontalAlignment(), |
|
||||||
b.getVerticalTextPosition(), b.getHorizontalTextPosition(), |
|
||||||
viewRect, iconRect, textRect, |
|
||||||
b.getText() == null ? 0 : b.getIconTextGap()); |
|
||||||
} |
|
||||||
|
|
||||||
@Override |
|
||||||
public void paint(final Graphics g, final JComponent c) { |
|
||||||
g.setColor(getBackground((AbstractButton) c)); |
|
||||||
g.fillRect(0, 0, c.getWidth(), c.getHeight()); |
|
||||||
paintIcon(g, c, iconRect); |
|
||||||
} |
|
||||||
|
|
||||||
protected Color getBackground(final AbstractButton c) { |
|
||||||
return c.getModel().isArmed() ? closeClick : closeHover; |
|
||||||
} |
|
||||||
} |
|
Before Width: | Height: | Size: 4.0 KiB After Width: | Height: | Size: 4.0 KiB |
Before Width: | Height: | Size: 608 B After Width: | Height: | Size: 608 B |
Before Width: | Height: | Size: 612 B After Width: | Height: | Size: 612 B |
Before Width: | Height: | Size: 624 B After Width: | Height: | Size: 624 B |
Before Width: | Height: | Size: 477 B After Width: | Height: | Size: 477 B |
Before Width: | Height: | Size: 493 B After Width: | Height: | Size: 493 B |
Before Width: | Height: | Size: 435 B After Width: | Height: | Size: 435 B |
Before Width: | Height: | Size: 461 B After Width: | Height: | Size: 461 B |
Before Width: | Height: | Size: 702 B After Width: | Height: | Size: 702 B |
Before Width: | Height: | Size: 726 B After Width: | Height: | Size: 726 B |
@ -0,0 +1,50 @@ |
|||||||
|
# |
||||||
|
# MIT License |
||||||
|
# |
||||||
|
# Copyright (c) 2020 Jannis Weis |
||||||
|
# |
||||||
|
# Permission is hereby granted, free of charge, to any person obtaining a copy |
||||||
|
# of this software and associated documentation files (the "Software"), to deal |
||||||
|
# in the Software without restriction, including without limitation the rights |
||||||
|
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
||||||
|
# copies of the Software, and to permit persons to whom the Software is |
||||||
|
# furnished to do so, subject to the following conditions: |
||||||
|
# |
||||||
|
# The above copyright notice and this permission notice shall be included in all |
||||||
|
# copies or substantial portions of the Software. |
||||||
|
# |
||||||
|
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
||||||
|
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
||||||
|
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
||||||
|
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
||||||
|
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
||||||
|
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
||||||
|
# SOFTWARE. |
||||||
|
# |
||||||
|
TitlePane.minimize.icon = icons/windows/minimize.svg[themed] |
||||||
|
TitlePane.minimizeInactive.icon = icons/windows/minimizeInactive.svg[themed] |
||||||
|
TitlePane.maximize.icon = icons/windows/maximize.svg[themed] |
||||||
|
TitlePane.maximizeInactive.icon = icons/windows/maximizeInactive.svg[themed] |
||||||
|
TitlePane.restore.icon = icons/windows/restore.svg[themed] |
||||||
|
TitlePane.restoreInactive.icon = icons/windows/restoreInactive.svg[themed] |
||||||
|
TitlePane.close.icon = icons/windows/closeActive.svg[themed] |
||||||
|
TitlePane.closeInactive.icon = icons/windows/closeInactive.svg[themed] |
||||||
|
TitlePane.closeHover.icon = icons/windows/closeHover.svg[themed] |
||||||
|
|
||||||
|
TitlePane.close.clickColor = F1707A |
||||||
|
TitlePane.close.rollOverColor = E81123 |
||||||
|
|
||||||
|
TitlePane.icon = icons/duke.svg |
||||||
|
|
||||||
|
TitlePane.borderColor = %borderSecondary |
||||||
|
TitlePane.background = %background |
||||||
|
TitlePane.foreground = %textForegroundSecondary |
||||||
|
TitlePane.inactiveBackground = %background |
||||||
|
TitlePane.inactiveForeground = %textForegroundInactive |
||||||
|
|
||||||
|
OptionPane.errorDialog.titlePane.background = %background |
||||||
|
OptionPane.errorDialog.titlePane.foreground = %textForeground |
||||||
|
OptionPane.questionDialog.titlePane.background = %background |
||||||
|
OptionPane.questionDialog.titlePane.foreground = %textForeground |
||||||
|
OptionPane.warningDialog.titlePane.background = %background |
||||||
|
OptionPane.warningDialog.titlePane.foreground = %textForeground |
@ -1,51 +0,0 @@ |
|||||||
#MIT License |
|
||||||
# |
|
||||||
#Copyright (c) 2020 Jannis Weis |
|
||||||
# |
|
||||||
#Permission is hereby granted, free of charge, to any person obtaining a copy |
|
||||||
#of this software and associated documentation files (the "Software"), to deal |
|
||||||
#in the Software without restriction, including without limitation the rights |
|
||||||
#to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
|
||||||
#copies of the Software, and to permit persons to whom the Software is |
|
||||||
#furnished to do so, subject to the following conditions: |
|
||||||
# |
|
||||||
#The above copyright notice and this permission notice shall be included in all |
|
||||||
#copies or substantial portions of the Software. |
|
||||||
# |
|
||||||
#THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
|
||||||
#IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
|
||||||
#FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
|
||||||
#AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
|
||||||
#LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
|
||||||
#OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
|
||||||
#SOFTWARE. |
|
||||||
# |
|
||||||
# suppress inspection "UnusedProperty" for whole file |
|
||||||
#TitlePane |
|
||||||
TitlePane.minimize.icon = windows/minimize.svg[themed] |
|
||||||
TitlePane.minimizeInactive.icon = windows/minimizeInactive.svg[themed] |
|
||||||
TitlePane.maximize.icon = windows/maximize.svg[themed] |
|
||||||
TitlePane.maximizeInactive.icon = windows/maximizeInactive.svg[themed] |
|
||||||
TitlePane.restore.icon = windows/restore.svg[themed] |
|
||||||
TitlePane.restoreInactive.icon = windows/restoreInactive.svg[themed] |
|
||||||
TitlePane.close.icon = windows/closeActive.svg[themed] |
|
||||||
TitlePane.closeInactive.icon = windows/closeInactive.svg[themed] |
|
||||||
TitlePane.closeHover.icon = windows/closeHover.svg[themed] |
|
||||||
|
|
||||||
TitlePane.close.clickColor = F1707A |
|
||||||
TitlePane.close.rollOverColor = E81123 |
|
||||||
|
|
||||||
TitlePane.icon = duke.svg |
|
||||||
|
|
||||||
TitlePane.borderColor = %borderSecondary |
|
||||||
TitlePane.background = %background |
|
||||||
TitlePane.foreground = %textForegroundSecondary |
|
||||||
TitlePane.inactiveBackground = %background |
|
||||||
TitlePane.inactiveForeground = %textForegroundInactive |
|
||||||
|
|
||||||
OptionPane.errorDialog.titlePane.background = %background |
|
||||||
OptionPane.errorDialog.titlePane.foreground = %textForeground |
|
||||||
OptionPane.questionDialog.titlePane.background = %background |
|
||||||
OptionPane.questionDialog.titlePane.foreground = %textForeground |
|
||||||
OptionPane.warningDialog.titlePane.background = %background |
|
||||||
OptionPane.warningDialog.titlePane.foreground = %textForeground |
|