Browse Source

Windows: Update titlebar icons used on Windows 11

To maximize and restore icons look differently on Windows 11.
We update our versions accordingly when Windows 11 is detected.
spotless
Jannis Weis 3 years ago
parent
commit
7197d08083
No known key found for this signature in database
GPG Key ID: 7C9D8D4B558049AB
  1. 15
      windows/src/main/java/com/github/weisj/darklaf/platform/windows/WindowsDecorationsProvider.java
  2. 11
      windows/src/main/resources/com/github/weisj/darklaf/platform/windows/icons/window/maximize11.svg
  3. 11
      windows/src/main/resources/com/github/weisj/darklaf/platform/windows/icons/window/maximize11Inactive.svg
  4. 14
      windows/src/main/resources/com/github/weisj/darklaf/platform/windows/icons/window/restore11.svg
  5. 14
      windows/src/main/resources/com/github/weisj/darklaf/platform/windows/icons/window/restore11Inactive.svg
  6. 30
      windows/src/main/resources/com/github/weisj/darklaf/platform/windows/windows_11_decorations.properties

15
windows/src/main/java/com/github/weisj/darklaf/platform/windows/WindowsDecorationsProvider.java

@ -23,6 +23,7 @@ package com.github.weisj.darklaf.platform.windows;
import java.awt.*;
import java.util.Properties;
import java.util.function.Consumer;
import javax.swing.*;
import javax.swing.border.Border;
@ -101,11 +102,13 @@ public class WindowsDecorationsProvider implements DecorationsProvider {
@Override
public void loadDecorationProperties(final Properties properties, final UIDefaults currentDefaults) {
IconLoader iconLoader = IconLoader.get(WindowsDecorationsProvider.class);
PropertyLoader.putProperties(
PropertyLoader.loadProperties(WindowsDecorationsProvider.class, "windows_decorations", ""), properties,
currentDefaults, iconLoader);
PropertyLoader.putProperties(
PropertyLoader.loadProperties(WindowsDecorationsProvider.class, "windows_icons", ""), properties,
currentDefaults, iconLoader);
Consumer<String> loadProps = fileName -> PropertyLoader.putProperties(
PropertyLoader.loadProperties(WindowsDecorationsProvider.class, fileName, ""),
properties, currentDefaults, iconLoader);
loadProps.accept("windows_icons");
loadProps.accept("windows_decorations");
if (SystemInfo.isWindows11OrGreater) {
loadProps.accept("windows_11_decorations");
}
}
}

11
windows/src/main/resources/com/github/weisj/darklaf/platform/windows/icons/window/maximize11.svg

@ -0,0 +1,11 @@
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">
<defs id="colors">
<linearGradient id="Windows.Icons.windowMaximizeInactive.color">
<stop offset="0" stop-color="#8C8C8C"/>
<stop offset="1" stop-color="#8C8C8C"/>
</linearGradient>
</defs>
<path fill="url(#Windows.Icons.windowMaximizeInactive.color)" fill-rule="evenodd"
d="M3,5 q0,-2 2,-2 L11,3 q2,0 2,2 L13,11 q0,2 -2,2 L5,13 q-2,0 -2,-2 L3,3 Z
M5,4 q-1,0 -1,1 L4,11 q0,1 1,1 L11,12 q1,0 1,-1 L12,5 q0,-1 -1,-1 L4,4 Z"/>
</svg>

After

Width:  |  Height:  |  Size: 590 B

11
windows/src/main/resources/com/github/weisj/darklaf/platform/windows/icons/window/maximize11Inactive.svg

@ -0,0 +1,11 @@
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">
<defs id="colors">
<linearGradient id="Windows.Icons.windowMaximize.color">
<stop offset="0" stop-color="#A9A9A9"/>
<stop offset="1" stop-color="#A9A9A9"/>
</linearGradient>
</defs>
<path fill="url(#Windows.Icons.windowMaximize.color)" fill-rule="evenodd"
d="M3,5 q0,-2 2,-2 L11,3 q2,0 2,2 L13,11 q0,2 -2,2 L5,13 q-2,0 -2,-2 L3,3 Z
M5,4 q-1,0 -1,1 L4,11 q0,1 1,1 L11,12 q1,0 1,-1 L12,5 q0,-1 -1,-1 L4,4 Z"/>
</svg>

After

Width:  |  Height:  |  Size: 574 B

14
windows/src/main/resources/com/github/weisj/darklaf/platform/windows/icons/window/restore11.svg

@ -0,0 +1,14 @@
<svg xmlns="http://www.w3.org/2000/svg" width="16px" height="16px" viewBox="0 0 16 16">
<defs id="colors">
<linearGradient id="Windows.Icons.windowRestore.color">
<stop offset="0" stop-color="#A9A9A9"/>
<stop offset="1" stop-color="#A9A9A9"/>
</linearGradient>
</defs>
<path fill="url(#Windows.Icons.windowRestore.color)"
transform="translate(0.5,-0.5)"
d="M3,7c0-1.3,0.7-2,2-2h4c1.3,0,2,0.7,2,2v4c0,1.3-0.7,2-2,2H5c-1.3,0-2-0.7-2-2V5V7z
M5,6C4.3,6,4,6.3,4,7v4 c0,0.7,0.3,1,1,1h4c0.7,0,1-0.3,1-1V7c0-0.7-0.3-1-1-1H4H5z"/>
<path fill="url(#Windows.Icons.windowRestore.color)"
d="M11,3H7C6.1,3,5.5,3.3,5.2,4H7h4c0.7,0,1,0.3,1,1v2.5V9v1.8c0.7-0.3,1-0.9,1-1.8V5C13,3.7,12.3,3,11,3z"/>
</svg>

After

Width:  |  Height:  |  Size: 787 B

14
windows/src/main/resources/com/github/weisj/darklaf/platform/windows/icons/window/restore11Inactive.svg

@ -0,0 +1,14 @@
<svg xmlns="http://www.w3.org/2000/svg" width="16px" height="16px" viewBox="0 0 16 16">
<defs id="colors">
<linearGradient id="Windows.Icons.windowRestoreInactive.color">
<stop offset="0" stop-color="#8C8C8C"/>
<stop offset="1" stop-color="#8C8C8C"/>
</linearGradient>
</defs>
<path fill="url(#Windows.Icons.windowRestoreInactive.color)"
transform="translate(0.5,-0.5)"
d="M3,7c0-1.3,0.7-2,2-2h4c1.3,0,2,0.7,2,2v4c0,1.3-0.7,2-2,2H5c-1.3,0-2-0.7-2-2V5V7z
M5,6C4.3,6,4,6.3,4,7v4 c0,0.7,0.3,1,1,1h4c0.7,0,1-0.3,1-1V7c0-0.7-0.3-1-1-1H4H5z"/>
<path fill="url(#Windows.Icons.windowRestoreInactive.color)"
d="M11,3H7C6.1,3,5.5,3.3,5.2,4H7h4c0.7,0,1,0.3,1,1v2.5V9v1.8c0.7-0.3,1-0.9,1-1.8V5C13,3.7,12.3,3,11,3z"/>
</svg>

After

Width:  |  Height:  |  Size: 811 B

30
windows/src/main/resources/com/github/weisj/darklaf/platform/windows/windows_11_decorations.properties

@ -0,0 +1,30 @@
#
# MIT License
#
# Copyright (c) 2021 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
#
Windows.TitlePane.maximize.icon = icons/window/maximize11.svg[themed]
Windows.TitlePane.maximizeInactive.icon = icons/window/maximize11Inactive.svg[themed]
Windows.TitlePane.restore.icon = icons/window/restore11.svg[themed]
Windows.TitlePane.restoreInactive.icon = icons/window/restore11Inactive.svg[themed]
Loading…
Cancel
Save