Skip to content

Commit fedaac8

Browse files
committed
improv: Use Windows 10 style themes on Windows
1 parent 87eaab5 commit fedaac8

File tree

5 files changed

+22
-0
lines changed

5 files changed

+22
-0
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ jobs:
5050
with:
5151
toolchain: stable-i686-pc-windows-gnu
5252
- uses: actions/checkout@v2
53+
with:
54+
submodules: true
5355
- name: Build and package
5456
shell: msys2 {0}
5557
run: cd windows && python build.py --rustup="C:/Rust/.cargo/bin/rustup.exe" $RELEASE

.gitmodules

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[submodule "windows/themes/Windows-10-Dark"]
2+
path = windows/themes/Windows-10-Dark
3+
url = https://github.com/B00merang-Project/Windows-10-Dark
4+
[submodule "windows/themes/Windows-10"]
5+
path = windows/themes/Windows-10
6+
url = https://github.com/B00merang-Project/Windows-10

windows/build.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,18 @@ def find_depends(exe):
9393
shutil.copy(src, dest)
9494
subprocess.check_call(["glib-compile-schemas", "out/share/glib-2.0/schemas"])
9595

96+
# Copy themes, and set default
97+
# Based on https://www.gtk.org/docs/installations/windows#building-and-distributing-your-application
98+
os.makedirs("out/share/themes/Windows10")
99+
os.makedirs("out/share/themes/Windows10-dark")
100+
os.makedirs("out/etc/gtk-3.0")
101+
print("Copy themes/Windows-10/gtk-3.20 -> out/share/themes/Windows10/gtk-3.0")
102+
shutil.copytree("themes/Windows-10/gtk-3.20", "out/share/themes/Windows10/gtk-3.0")
103+
print("Copy themes/Windows-10-dark/gtk-3.20 -> out/share/themes/Windows10-dark/gtk-3.0")
104+
shutil.copytree("themes/Windows-10-dark/gtk-3.20", "out/share/themes/Windows10-dark/gtk-3.0")
105+
with open("out/etc/gtk-3.0/settings.ini", "w") as f:
106+
f.write("[Settings]\ngtk-theme-name=Windows10\ngtk-font-name=Segoe UI 9\n")
107+
96108
# Extract crate version from cargo
97109
meta_str = subprocess.check_output(CARGO + ["metadata", "--format-version", "1", "--no-deps"])
98110
meta = json.loads(meta_str)

windows/themes/Windows-10

Submodule Windows-10 added at 06dd5b8

windows/themes/Windows-10-Dark

Submodule Windows-10-Dark added at 6f3e063

0 commit comments

Comments
 (0)