Skip to content

Commit 304f08f

Browse files
committed
improv: Use Windows 10 style themes on Windows
1 parent fe30090 commit 304f08f

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
@@ -89,6 +89,18 @@ def find_depends(exe):
8989
print(f"Copy {src} -> {dest}")
9090
shutil.copytree(src, dest)
9191

92+
# Copy themes, and set default
93+
# Based on https://www.gtk.org/docs/installations/windows#building-and-distributing-your-application
94+
os.makedirs("out/share/themes/Windows10")
95+
os.makedirs("out/share/themes/Windows10-dark")
96+
os.makedirs("out/etc/gtk-3.0")
97+
print("Copy themes/Windows-10/gtk-3.20 -> out/share/themes/Windows10/gtk-3.0")
98+
shutil.copytree("themes/Windows-10/gtk-3.20", "out/share/themes/Windows10/gtk-3.0")
99+
print("Copy themes/Windows-10-dark/gtk-3.20 -> out/share/themes/Windows10-dark/gtk-3.0")
100+
shutil.copytree("themes/Windows-10-dark/gtk-3.20", "out/share/themes/Windows10-dark/gtk-3.0")
101+
with open("out/etc/gtk-3.0/settings.ini", "w") as f:
102+
f.write("[Settings]\ngtk-theme-name=Windows10\ngtk-font-name=Segoe UI 9\n")
103+
92104
# Extract crate version from cargo
93105
meta_str = subprocess.check_output(CARGO + ["metadata", "--format-version", "1", "--no-deps"])
94106
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)