mirror of
https://github.com/valentderah/totk-pc-recomp.git
synced 2026-11-21 04:55:56 +00:00
The setup window draws in the light Sun Valley ttk theme (sv-ttk 2.6.1, MIT, vendored unmodified in installer/vendor/sv_ttk), the Windows 11 look; its fonts follow the display scale, its palette no longer overrides our label colours, and the platform theme stays when it does not load
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
bf96d7d6c8
commit
95aac58d45
11 files changed
+1325
-3
No files matched your search
@@ -73,6 +73,7 @@ These tools run on the developer's or player's machine during the build. They ar
|
||||
| Tcl/Tk 9.0.4, rebuilt with Xft for the Linux installer | https://github.com/tcltk/tcl and https://github.com/tcltk/tk, tag `core-9-0-4`; archives pinned by SHA-256 in `tools/make_release_linux.py` | Tcl/Tk licence (BSD-style) | `python/lib/`; licence texts in `licenses/tcl-license.terms` and `licenses/tk-license.terms` |
|
||||
| libXft 2 and libXrender 1, the sniper SDK sysroot's shared libraries, bundled beside the Xft Tk of the Linux installer; their Debian `copyright` files go into `licenses/` | https://repo.steampowered.com/steamrt-images-sniper/snapshots/3.0.20261021.266025/ | HPND (MIT-style) | `python/lib/`; `licenses/libXft-copyright.txt`, `licenses/libXrender-copyright.txt` |
|
||||
| CPython 3.14.9 embeddable package, with `tkinter` and Tcl/Tk 9.0.4 taken from the python.org 3.14.9 installer's component MSI (unpacked, never run); includes `vcruntime140*.dll` (Microsoft, redistributable with Python), OpenSSL, libffi, SQLite, zlib, libtommath | https://www.python.org/downloads/release/python-3149/ | PSF-2.0 (Tcl/Tk: Tcl/Tk licence, BSD-style) | `python/` |
|
||||
| Sun Valley ttk theme (sv-ttk 2.6.1): the light and dark themes, their sprite sheets and fonts, the look of the setup window | https://github.com/rdbende/Sun-Valley-ttk-theme @ `cefdf5d383073f29f04cb7254e24e195d8bda6a2` (tag v2.6.1, `sv_ttk/sv.tcl`, `sv_ttk/theme/`), Copyright (c) rdbende | MIT | `installer/vendor/sv_ttk/` (unmodified, licence in `installer/vendor/sv_ttk/LICENSE`), loaded by `installer/gui.py` use_sun_valley |
|
||||
| numpy 2.5.4 (with its bundled OpenBLAS), lz4 4.4.5, cryptography 50.0.2 (with its bundled OpenSSL), fontTools 4.68.0, cffi 2.1.1, pycparser 3.11 | PyPI binary wheels, pins in `tools/requirements-installer.txt` | BSD-3-Clause; lz4 BSD-3-Clause; cryptography Apache-2.0 OR BSD-3-Clause; fontTools MIT; cffi MIT; pycparser BSD-3-Clause | `python/Lib/site-packages/` |
|
||||
| llvm-mingw 20261020 (LLVM/Clang/LLD 23, mingw-w64, libc++, libunwind, compiler-rt), x86_64 subset | https://github.com/mstorsjo/llvm-mingw/releases/tag/20261020 | Apache-2.0 with LLVM exception; mingw-w64 ZPL-2.1/BSD/public domain; libc++ and libunwind Apache-2.0 with LLVM exception and MIT/UIUC; winpthreads MIT | `llvm/` |
|
||||
| SDL 3.4.20 upstream Windows release (`SDL3.dll`) and mingw development package (headers, `libSDL3.dll.a`) | https://github.com/libsdl-org/SDL/releases/tag/release-3.4.20 | zlib | `bin/SDL3.dll`, `runtime/deps/` |
|
||||
|
||||
+5
-3
@@ -177,9 +177,11 @@ python -m installer --base FILE --update FILE --keys FILE --lang CODE --dest DIR
|
||||
resume and update are one rule; output kept from another release is re-hashed first.
|
||||
- Peak space on the install disk is about 36 GiB, not 22: the extraction copies both Program NCAs (16.3 GiB) next to
|
||||
the merged RomFS (15.9 GiB) before it deletes them. The check computes the exact figure.
|
||||
- Window (`python -m installer.gui`, `installer/gui.py` draws, `installer/guilogic.py` decides): form (game files and install
|
||||
sections, the explanations under More details, the share notice next to Start), step list with progress, space line, collapsible log, Cancel (Ctrl+Break to the CLI's process group, then it waits for the exit),
|
||||
finish screen with Open folder. English, Russian, Brazilian Portuguese or Simplified Chinese, chosen from the Windows
|
||||
- Window (`python -m installer.gui`, `installer/gui.py` draws, `installer/guilogic.py` decides): form (game files and
|
||||
install sections, the explanations under More details, the share notice next to Start) in the Sun Valley ttk theme
|
||||
(`installer/vendor/sv_ttk/`, the platform theme when it does not load), step list with progress, space line,
|
||||
collapsible log, Cancel (Ctrl+Break to the CLI's process group, then it waits for the exit), finish screen with Open
|
||||
folder. English, Russian, Brazilian Portuguese or Simplified Chinese, chosen from the Windows
|
||||
display language (zh-CN and zh-SG give Chinese; the Traditional Chinese regions give English), switchable in the
|
||||
window; every sentence is an id in `installer/text/<en|ru|pt-BR|zh-Hans>.json`. A Chinese window still starts with
|
||||
English as the game language, because Chinese game text needs the Switch shared fonts, which the setup extracts only
|
||||
|
||||
@@ -28,6 +28,7 @@ dpi.enable()
|
||||
|
||||
import tkinter as tk # noqa: E402 (after dpi.enable, see above)
|
||||
from tkinter import filedialog, messagebox, ttk # noqa: E402
|
||||
from tkinter import font as tkfont # noqa: E402
|
||||
|
||||
try:
|
||||
from PIL import ImageGrab # only the screenshots of --selftest --shots need it; the release has no PIL
|
||||
@@ -50,6 +51,8 @@ PAD = dpi.px(14) # padding of the window and its frames
|
||||
WRAP = dpi.px(620) # wrap width of the long labels
|
||||
|
||||
RECENT_WAIT = 1.5 # seconds the window waits for the recorded paths
|
||||
# Sun Valley, the Windows 11 look for ttk (sv-ttk 2.6.1, MIT, unmodified; THIRD_PARTY_NOTICES.md)
|
||||
SUN_VALLEY = Path(__file__).resolve().parent / 'vendor' / 'sv_ttk' / 'sv.tcl'
|
||||
|
||||
|
||||
def load_recent(wait=RECENT_WAIT):
|
||||
@@ -71,6 +74,46 @@ def fix_tcl_paths():
|
||||
os.environ[var] = str(tcl / lib)
|
||||
|
||||
|
||||
def use_sun_valley(root, ui_font):
|
||||
"""Switch the window to the light Sun Valley theme; False leaves the platform theme when it does not load.
|
||||
|
||||
The theme sizes its fonts in pixels, which Tk does not scale with the display; they are turned into points (96 DPI
|
||||
pixels * 0.75) so they grow with tk scaling like the rest of the window. Its Segoe UI Variable families exist on
|
||||
Windows 11 only; elsewhere the fonts take `ui_font`, bold where the theme asked for Semibold. The theme's images
|
||||
(check boxes, button and field borders) stay at their 100% pixel size.
|
||||
|
||||
sv.tcl answers <<ThemeChanged>> with configure_colors, whose tk_setPalette writes the theme's text and background
|
||||
colour into every widget and into the option database, over the colours of our label styles (errors, notices,
|
||||
muted text). The binding is dropped before the switch and the ttk half of configure_colors is done here."""
|
||||
try:
|
||||
root.tk.call('source', str(SUN_VALLEY))
|
||||
root.bind_class('Tk', '<<ThemeChanged>>', '')
|
||||
style = ttk.Style(root)
|
||||
style.theme_use('sun-valley-light')
|
||||
c = {k: root.tk.call('set', f'ttk::theme::sv_light::colors(-{k})') for k in ('fg', 'bg', 'disfg', 'selfg', 'selbg')}
|
||||
style.configure('.', background=c['bg'], foreground=c['fg'], troughcolor=c['bg'], focuscolor=c['selbg'],
|
||||
selectbackground=c['selbg'], selectforeground=c['selfg'], insertwidth=1, insertcolor=c['fg'],
|
||||
fieldbackground=c['bg'], font='SunValleyBodyFont', borderwidth=0, relief='flat')
|
||||
style.map('.', foreground=[('disabled', c['disfg'])])
|
||||
root.configure(background=c['bg'])
|
||||
for cls in ('TEntry', 'TCombobox'): # config_entry_font sets this only on fields that exist at the switch
|
||||
root.option_add(f'*{cls}.font', 'SunValleyBodyFont')
|
||||
except (tk.TclError, OSError):
|
||||
return False
|
||||
families = set(root.tk.splitlist(root.tk.call('font', 'families')))
|
||||
for name in root.tk.splitlist(root.tk.call('font', 'names')):
|
||||
if not str(name).startswith('SunValley'):
|
||||
continue
|
||||
f = tkfont.nametofont(str(name), root=root)
|
||||
size = int(f.cget('size'))
|
||||
if size < 0:
|
||||
f.configure(size=round(-size * 0.75))
|
||||
family = f.cget('family')
|
||||
if family not in families:
|
||||
f.configure(family=ui_font, weight='bold' if 'Semibold' in family else 'normal')
|
||||
return True
|
||||
|
||||
|
||||
class App:
|
||||
def __init__(self, root, ui_lang, layout, run_args=None, rebuild=None):
|
||||
self.root, self.layout = root, layout
|
||||
@@ -104,6 +147,7 @@ class App:
|
||||
root.protocol('WM_DELETE_WINDOW', self.on_close)
|
||||
self.ui_font = 'Segoe UI' if os.name == 'nt' else 'DejaVu Sans'
|
||||
self.mono_font = 'Consolas' if os.name == 'nt' else 'DejaVu Sans Mono'
|
||||
self.sun_valley = use_sun_valley(root, self.ui_font)
|
||||
style = ttk.Style(root)
|
||||
style.configure('Title.TLabel', font=(self.ui_font, 15, 'bold'))
|
||||
style.configure('Notice.TLabel', background='#fff3cd', foreground='#664d03', padding=dpi.px(8))
|
||||
|
||||
Vendored
+21
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) rdbende <rdbende@proton.me>
|
||||
|
||||
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.
|
||||
Vendored
+130
@@ -0,0 +1,130 @@
|
||||
package require Tk 8.6-
|
||||
|
||||
source [file join [file dirname [info script]] theme light.tcl]
|
||||
source [file join [file dirname [info script]] theme dark.tcl]
|
||||
|
||||
|
||||
if {[tk windowingsystem] == "win32"} {
|
||||
set static ""
|
||||
} else {
|
||||
set static " static"
|
||||
}
|
||||
|
||||
font create SunValleyCaptionFont -family "Segoe UI Variable$static Small" -size -12
|
||||
font create SunValleyBodyFont -family "Segoe UI Variable$static Text" -size -14
|
||||
font create SunValleyBodyStrongFont -family "Segoe UI Variable$static Text Semibold" -size -14
|
||||
font create SunValleyBodyLargeFont -family "Segoe UI Variable$static Text" -size -18
|
||||
font create SunValleySubtitleFont -family "Segoe UI Variable$static Display Semibold" -size -20
|
||||
font create SunValleyTitleFont -family "Segoe UI Variable$static Display Semibold" -size -28
|
||||
font create SunValleyTitleLargeFont -family "Segoe UI Variable$static Display Semibold" -size -40
|
||||
font create SunValleyDisplayFont -family "Segoe UI Variable$static Display Semibold" -size -68
|
||||
|
||||
|
||||
proc config_entry_font {w} {
|
||||
set font_config [$w config -font]
|
||||
if {[lindex $font_config 3] != [lindex $font_config 4]} {
|
||||
return
|
||||
}
|
||||
if {[ttk::style theme use] in {"sun-valley-dark" "sun-valley-light"}} {
|
||||
$w configure -font SunValleyBodyFont
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
proc config_menus {w} {
|
||||
if {[tk windowingsystem] == "aqua" || [tk windowingsystem] == "win32"} {
|
||||
return
|
||||
}
|
||||
|
||||
set theme [ttk::style theme use]
|
||||
if {$theme == "sun-valley-dark"} {
|
||||
$w configure \
|
||||
-relief solid \
|
||||
-borderwidth 1 \
|
||||
-activeborderwidth 0 \
|
||||
-background "#292929" \
|
||||
-activebackground $ttk::theme::sv_dark::colors(-selbg) \
|
||||
-activeforeground $ttk::theme::sv_dark::colors(-selfg) \
|
||||
-selectcolor $ttk::theme::sv_dark::colors(-selfg)
|
||||
} elseif {$theme == "sun-valley-light"} {
|
||||
$w configure \
|
||||
-relief solid \
|
||||
-borderwidth 1 \
|
||||
-activeborderwidth 0 \
|
||||
-background "#e7e7e7" \
|
||||
-activebackground $ttk::theme::sv_light::colors(-selbg) \
|
||||
-activeforeground $ttk::theme::sv_light::colors(-selfg) \
|
||||
-selectcolor $ttk::theme::sv_light::colors(-selfg)
|
||||
}
|
||||
|
||||
if {[[winfo toplevel $w] cget -menu] != $w} {
|
||||
if {$theme == "sun-valley-dark"} {
|
||||
$w configure -borderwidth 0 -background $ttk::theme::sv_dark::colors(-bg)
|
||||
} elseif {$theme == "sun-valley-light"} {
|
||||
$w configure -borderwidth 0 -background $ttk::theme::sv_light::colors(-bg)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
proc configure_colors {} {
|
||||
set theme [ttk::style theme use]
|
||||
if {$theme == "sun-valley-dark"} {
|
||||
ttk::style configure . \
|
||||
-background $ttk::theme::sv_dark::colors(-bg) \
|
||||
-foreground $ttk::theme::sv_dark::colors(-fg) \
|
||||
-troughcolor $ttk::theme::sv_dark::colors(-bg) \
|
||||
-focuscolor $ttk::theme::sv_dark::colors(-selbg) \
|
||||
-selectbackground $ttk::theme::sv_dark::colors(-selbg) \
|
||||
-selectforeground $ttk::theme::sv_dark::colors(-selfg) \
|
||||
-insertwidth 1 \
|
||||
-insertcolor $ttk::theme::sv_dark::colors(-fg) \
|
||||
-fieldbackground $ttk::theme::sv_dark::colors(-bg) \
|
||||
-font SunValleyBodyFont \
|
||||
-borderwidth 0 \
|
||||
-relief flat
|
||||
|
||||
tk_setPalette \
|
||||
background $ttk::theme::sv_dark::colors(-bg) \
|
||||
foreground $ttk::theme::sv_dark::colors(-fg) \
|
||||
highlightColor $ttk::theme::sv_dark::colors(-selbg) \
|
||||
selectBackground $ttk::theme::sv_dark::colors(-selbg) \
|
||||
selectForeground $ttk::theme::sv_dark::colors(-selfg) \
|
||||
activeBackground $ttk::theme::sv_dark::colors(-selbg) \
|
||||
activeForeground $ttk::theme::sv_dark::colors(-selfg)
|
||||
|
||||
ttk::style map . -foreground [list disabled $ttk::theme::sv_dark::colors(-disfg)]
|
||||
} elseif {$theme == "sun-valley-light"} {
|
||||
ttk::style configure . \
|
||||
-background $ttk::theme::sv_light::colors(-bg) \
|
||||
-foreground $ttk::theme::sv_light::colors(-fg) \
|
||||
-troughcolor $ttk::theme::sv_light::colors(-bg) \
|
||||
-focuscolor $ttk::theme::sv_light::colors(-selbg) \
|
||||
-selectbackground $ttk::theme::sv_light::colors(-selbg) \
|
||||
-selectforeground $ttk::theme::sv_light::colors(-selfg) \
|
||||
-insertwidth 1 \
|
||||
-insertcolor $ttk::theme::sv_light::colors(-fg) \
|
||||
-fieldbackground $ttk::theme::sv_light::colors(-bg) \
|
||||
-font SunValleyBodyFont \
|
||||
-borderwidth 0 \
|
||||
-relief flat
|
||||
|
||||
tk_setPalette \
|
||||
background $ttk::theme::sv_light::colors(-bg) \
|
||||
foreground $ttk::theme::sv_light::colors(-fg) \
|
||||
highlightColor $ttk::theme::sv_light::colors(-selbg) \
|
||||
selectBackground $ttk::theme::sv_light::colors(-selbg) \
|
||||
selectForeground $ttk::theme::sv_light::colors(-selfg) \
|
||||
activeBackground $ttk::theme::sv_light::colors(-selbg) \
|
||||
activeForeground $ttk::theme::sv_light::colors(-selfg)
|
||||
|
||||
ttk::style map . -foreground [list disabled $ttk::theme::sv_light::colors(-disfg)]
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
bind [winfo class .] <<ThemeChanged>> {+configure_colors}
|
||||
bind TEntry <<ThemeChanged>> {+config_entry_font %W}
|
||||
bind TCombobox <<ThemeChanged>> {+config_entry_font %W}
|
||||
bind TSpinbox <<ThemeChanged>> {+config_entry_font %W}
|
||||
bind Menu <<ThemeChanged>> {+config_menus %W}
|
||||
+465
@@ -0,0 +1,465 @@
|
||||
source [file join [file dirname [info script]] sprites_dark.tcl]
|
||||
|
||||
namespace eval ttk::theme::sv_dark {
|
||||
package provide ttk::theme::sv_dark 2.5
|
||||
|
||||
array set colors {
|
||||
-fg "#fafafa"
|
||||
-bg "#1c1c1c"
|
||||
-disfg "#595959"
|
||||
-selfg "#ffffff"
|
||||
-selbg "#2f60d8"
|
||||
-accent "#57c8ff"
|
||||
}
|
||||
|
||||
proc load_images {imgfile} {
|
||||
variable I
|
||||
image create photo spritesheet -file $imgfile -format png
|
||||
foreach {name x y width height} $::spriteinfo {
|
||||
set I($name) [image create photo -width $width -height $height]
|
||||
$I($name) copy spritesheet -from $x $y [expr {$x+$width}] [expr {$y+$height}]
|
||||
}
|
||||
}
|
||||
|
||||
load_images [file join [file dirname [info script]] spritesheet_dark.png]
|
||||
|
||||
ttk::style theme create sun-valley-dark -parent clam -settings {
|
||||
|
||||
# Button
|
||||
ttk::style layout TButton {
|
||||
Button.button -children {
|
||||
Button.padding -children {
|
||||
Button.label -side left -expand 1
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ttk::style configure TButton -padding {8 2 8 3} -anchor center -foreground $colors(-fg)
|
||||
ttk::style map TButton -foreground [list disabled "#7a7a7a" pressed "#d0d0d0"]
|
||||
|
||||
ttk::style element create Button.button image \
|
||||
[list $I(button-rest) \
|
||||
{selected disabled} $I(button-dis) \
|
||||
disabled $I(button-dis) \
|
||||
selected $I(button-rest) \
|
||||
pressed $I(button-pressed) \
|
||||
{active focus} $I(button-focus-hover) \
|
||||
active $I(button-hover) \
|
||||
focus $I(button-focus) \
|
||||
] -border 4 -sticky nsew
|
||||
|
||||
# Toolbutton
|
||||
ttk::style layout Toolbutton {
|
||||
Toolbutton.button -children {
|
||||
Toolbutton.padding -children {
|
||||
Toolbutton.label -side left -expand 1
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ttk::style configure Toolbutton -padding {8 2 8 3} -anchor center
|
||||
|
||||
ttk::style element create Toolbutton.button image \
|
||||
[list $I(empty) \
|
||||
disabled $I(button-dis) \
|
||||
pressed $I(button-pressed) \
|
||||
{active focus} $I(button-focus-hover) \
|
||||
active $I(button-hover) \
|
||||
focus $I(button-focus) \
|
||||
] -border 4 -sticky nsew
|
||||
|
||||
# Accent.TButton
|
||||
ttk::style layout Accent.TButton {
|
||||
AccentButton.button -children {
|
||||
AccentButton.padding -children {
|
||||
AccentButton.label -side left -expand 1
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ttk::style configure Accent.TButton -padding {8 2 8 3} -anchor center -foreground "#000000"
|
||||
ttk::style map Accent.TButton -foreground [list pressed "#25536a" disabled "#a5a5a5"]
|
||||
|
||||
ttk::style element create AccentButton.button image \
|
||||
[list $I(button-accent-rest) \
|
||||
{selected disabled} $I(button-accent-dis) \
|
||||
disabled $I(button-accent-dis) \
|
||||
selected $I(button-accent-rest) \
|
||||
pressed $I(button-accent-pressed) \
|
||||
{active focus} $I(button-accent-focus-hover) \
|
||||
active $I(button-accent-hover) \
|
||||
focus $I(button-accent-focus) \
|
||||
] -border 4 -sticky nsew
|
||||
|
||||
# Menubutton
|
||||
ttk::style layout TMenubutton {
|
||||
Menubutton.button -children {
|
||||
Menubutton.padding -children {
|
||||
Menubutton.label -side left -expand 1
|
||||
Menubutton.indicator -side right -sticky nsew
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ttk::style configure TMenubutton -padding {8 2 13 3}
|
||||
|
||||
ttk::style element create Menubutton.button image \
|
||||
[list $I(button-rest) \
|
||||
disabled $I(button-dis) \
|
||||
pressed $I(button-pressed) \
|
||||
{active focus} $I(button-focus-hover) \
|
||||
active $I(button-hover) \
|
||||
focus $I(button-focus) \
|
||||
] -border 4 -sticky nsew
|
||||
|
||||
ttk::style element create Menubutton.indicator image $I(down) -width 10 -sticky e
|
||||
|
||||
# OptionMenu
|
||||
ttk::style layout TOptionMenu {
|
||||
OptionMenu.button -children {
|
||||
OptionMenu.padding -children {
|
||||
OptionMenu.label -side left -expand 1
|
||||
OptionMenu.indicator -side right -sticky nsew
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ttk::style configure TOptionMenu -padding {8 2 13 3}
|
||||
|
||||
ttk::style element create OptionMenu.button image \
|
||||
[list $I(button-rest) \
|
||||
disabled $I(button-dis) \
|
||||
pressed $I(button-pressed) \
|
||||
{active focus} $I(button-focus-hover) \
|
||||
active $I(button-hover) \
|
||||
focus $I(button-focus) \
|
||||
] -border 4 -sticky nsew
|
||||
|
||||
ttk::style element create OptionMenu.indicator image $I(down) -width 10 -sticky e
|
||||
|
||||
# Checkbutton
|
||||
ttk::style layout TCheckbutton {
|
||||
Checkbutton.button -children {
|
||||
Checkbutton.padding -children {
|
||||
Checkbutton.indicator -side left
|
||||
Checkbutton.label -side right -expand 1
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ttk::style configure TCheckbutton -padding 4
|
||||
|
||||
ttk::style element create Checkbutton.indicator image \
|
||||
[list $I(check-unsel-rest) \
|
||||
{alternate disabled} $I(check-tri-dis) \
|
||||
{selected disabled} $I(check-dis) \
|
||||
disabled $I(check-unsel-dis) \
|
||||
{pressed alternate} $I(check-tri-hover) \
|
||||
{active focus alternate} $I(check-tri-focus-hover) \
|
||||
{active alternate} $I(check-tri-hover) \
|
||||
{focus alternate} $I(check-tri-focus) \
|
||||
alternate $I(check-tri-rest) \
|
||||
{pressed selected} $I(check-hover) \
|
||||
{active focus selected} $I(check-focus-hover) \
|
||||
{active selected} $I(check-hover) \
|
||||
{focus selected} $I(check-focus) \
|
||||
selected $I(check-rest) \
|
||||
{pressed !selected} $I(check-unsel-pressed) \
|
||||
{active focus} $I(check-unsel-focus-hover) \
|
||||
active $I(check-unsel-hover) \
|
||||
focus $I(check-unsel-focus) \
|
||||
] -width 26 -sticky w
|
||||
|
||||
# Switch.TCheckbutton
|
||||
ttk::style layout Switch.TCheckbutton {
|
||||
Switch.button -children {
|
||||
Switch.padding -children {
|
||||
Switch.indicator -side left
|
||||
Switch.label -side right -expand 1
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ttk::style element create Switch.indicator image \
|
||||
[list $I(switch-off-rest) \
|
||||
{selected disabled} $I(switch-dis) \
|
||||
disabled $I(switch-off-dis) \
|
||||
{pressed selected} $I(switch-pressed) \
|
||||
{active focus selected} $I(switch-focus-hover) \
|
||||
{active selected} $I(switch-hover) \
|
||||
{focus selected} $I(switch-focus) \
|
||||
selected $I(switch-rest) \
|
||||
{pressed !selected} $I(switch-off-pressed) \
|
||||
{active focus} $I(switch-off-focus-hover) \
|
||||
active $I(switch-off-hover) \
|
||||
focus $I(switch-off-focus) \
|
||||
] -width 46 -sticky w
|
||||
|
||||
# Toggle.TButton
|
||||
ttk::style layout Toggle.TButton {
|
||||
ToggleButton.button -children {
|
||||
ToggleButton.padding -children {
|
||||
ToggleButton.label -side left -expand 1
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ttk::style configure Toggle.TButton -padding {8 2 8 3} -anchor center -foreground $colors(-fg)
|
||||
|
||||
ttk::style map Toggle.TButton -foreground \
|
||||
[list {selected disabled} "#a5a5a5" \
|
||||
{selected pressed} "#d0d0d0" \
|
||||
selected "#000000" \
|
||||
pressed "#25536a" \
|
||||
disabled "#7a7a7a"
|
||||
]
|
||||
|
||||
ttk::style element create ToggleButton.button image \
|
||||
[list $I(button-rest) \
|
||||
{selected disabled} $I(button-accent-dis) \
|
||||
disabled $I(button-dis) \
|
||||
{pressed selected} $I(button-rest) \
|
||||
{active focus selected} $I(button-accent-focus-hover) \
|
||||
{active selected} $I(button-accent-hover) \
|
||||
{focus selected} $I(button-accent-focus) \
|
||||
selected $I(button-accent-rest) \
|
||||
{pressed !selected} $I(button-accent-rest) \
|
||||
{active focus} $I(button-focus-hover) \
|
||||
active $I(button-hover) \
|
||||
focus $I(button-focus) \
|
||||
] -border 4 -sticky nsew
|
||||
|
||||
# Radiobutton
|
||||
ttk::style layout TRadiobutton {
|
||||
Radiobutton.button -children {
|
||||
Radiobutton.padding -children {
|
||||
Radiobutton.indicator -side left
|
||||
Radiobutton.label -side right -expand 1
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ttk::style configure TRadiobutton -padding 4
|
||||
|
||||
ttk::style element create Radiobutton.indicator image \
|
||||
[list $I(radio-unsel-rest) \
|
||||
{selected disabled} $I(radio-dis) \
|
||||
disabled $I(radio-unsel-dis) \
|
||||
{pressed selected} $I(radio-pressed) \
|
||||
{active focus selected} $I(radio-focus-hover) \
|
||||
{active selected} $I(radio-hover) \
|
||||
{focus selected} $I(radio-focus) \
|
||||
selected $I(radio-rest) \
|
||||
{pressed !selected} $I(radio-unsel-pressed) \
|
||||
{active focus} $I(radio-unsel-focus-hover) \
|
||||
active $I(radio-unsel-hover) \
|
||||
focus $I(radio-unsel-focus) \
|
||||
] -width 26 -sticky w
|
||||
|
||||
# Entry
|
||||
ttk::style configure TEntry -foreground $colors(-fg) -padding {6 1 4 2}
|
||||
ttk::style map TEntry -foreground [list disabled "#757575" pressed "#cfcfcf"]
|
||||
|
||||
ttk::style element create Entry.field image \
|
||||
[list $I(textbox-rest) \
|
||||
{focus hover !invalid} $I(textbox-focus) \
|
||||
invalid $I(textbox-error) \
|
||||
disabled $I(textbox-dis) \
|
||||
{focus !invalid} $I(textbox-focus) \
|
||||
hover $I(textbox-hover) \
|
||||
] -border 5 -sticky nsew
|
||||
|
||||
# Combobox
|
||||
ttk::style layout TCombobox {
|
||||
Combobox.field -sticky nsew -children {
|
||||
Combobox.arrow -side right -sticky ns
|
||||
Combobox.padding -sticky nsew -children {
|
||||
Combobox.textarea -sticky nsew
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ttk::style configure TCombobox -foreground $colors(-fg) -padding {6 1 0 2}
|
||||
ttk::style configure ComboboxPopdownFrame -borderwidth 1 -relief solid
|
||||
ttk::style map TCombobox -foreground [list disabled "#757575" pressed "#cfcfcf"]
|
||||
|
||||
ttk::style map TCombobox -selectbackground [list \
|
||||
{readonly hover} $colors(-selbg) \
|
||||
{readonly focus} $colors(-selbg) \
|
||||
] -selectforeground [list \
|
||||
{readonly hover} $colors(-selfg) \
|
||||
{readonly focus} $colors(-selfg) \
|
||||
]
|
||||
|
||||
ttk::style element create Combobox.field image \
|
||||
[list $I(textbox-rest) \
|
||||
{readonly focus} $I(button-focus) \
|
||||
{readonly disabled} $I(button-dis) \
|
||||
{readonly pressed} $I(button-pressed) \
|
||||
{readonly hover} $I(button-hover) \
|
||||
readonly $I(button-rest) \
|
||||
{focus hover !invalid} $I(textbox-focus) \
|
||||
invalid $I(textbox-error) \
|
||||
disabled $I(textbox-dis) \
|
||||
focus $I(textbox-focus) \
|
||||
{focus !invalid} $I(textbox-focus) \
|
||||
hover $I(textbox-hover) \
|
||||
] -border 5
|
||||
|
||||
ttk::style element create Combobox.arrow image $I(down) -width 34 -sticky {}
|
||||
|
||||
# Spinbox
|
||||
ttk::style layout TSpinbox {
|
||||
Spinbox.field -side top -sticky we -children {
|
||||
Spinbox.downarrow -side right -sticky ns
|
||||
Spinbox.uparrow -side right -sticky ns
|
||||
Spinbox.padding -sticky nswe -children {
|
||||
Spinbox.textarea -sticky nsew
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ttk::style configure TSpinbox -foreground $colors(-fg) -padding {6 1 0 2}
|
||||
ttk::style map TSpinbox -foreground [list disabled "#757575" pressed "#cfcfcf"]
|
||||
|
||||
ttk::style element create Spinbox.field image \
|
||||
[list $I(textbox-rest) \
|
||||
{focus hover !invalid} $I(textbox-focus) \
|
||||
invalid $I(textbox-error) \
|
||||
disabled $I(textbox-dis) \
|
||||
focus $I(textbox-focus) \
|
||||
{focus !invalid} $I(textbox-focus) \
|
||||
hover $I(textbox-hover) \
|
||||
] -border 5 -sticky nsew
|
||||
|
||||
ttk::style element create Spinbox.uparrow image $I(up) -width 34 -height 16 -sticky {}
|
||||
ttk::style element create Spinbox.downarrow image $I(down) -width 34 -height 16 -sticky {}
|
||||
|
||||
# Progressbar
|
||||
ttk::style element create Horizontal.Progressbar.trough image $I(progressbar-trough-hor) -border 1 -sticky ew
|
||||
ttk::style element create Horizontal.Progressbar.pbar image $I(progressbar-bar-hor) -border 2 -sticky ew
|
||||
|
||||
ttk::style element create Vertical.Progressbar.trough image $I(progressbar-trough-vert) -border 1 -sticky ns
|
||||
ttk::style element create Vertical.Progressbar.pbar image $I(progressbar-bar-vert) -border 2 -sticky ns
|
||||
|
||||
# Scale
|
||||
ttk::style element create Horizontal.Scale.trough image $I(slider-trough-hor) \
|
||||
-border 5 -padding 0 -sticky {ew}
|
||||
|
||||
ttk::style element create Vertical.Scale.trough image $I(slider-trough-vert) \
|
||||
-border 5 -padding 0 -sticky {ns}
|
||||
|
||||
ttk::style element create Scale.slider image \
|
||||
[list $I(slider-thumb-rest) \
|
||||
disabled $I(slider-thumb-dis) \
|
||||
pressed $I(slider-thumb-pressed) \
|
||||
{active focus} $I(slider-thumb-focus-hover) \
|
||||
active $I(slider-thumb-hover) \
|
||||
focus $I(slider-thumb-focus) \
|
||||
] -sticky {}
|
||||
|
||||
# Scrollbar
|
||||
ttk::style layout Vertical.TScrollbar {
|
||||
Vertical.Scrollbar.trough -sticky ns -children {
|
||||
Vertical.Scrollbar.uparrow -side top
|
||||
Vertical.Scrollbar.downarrow -side bottom
|
||||
Vertical.Scrollbar.thumb -expand 1
|
||||
}
|
||||
}
|
||||
|
||||
ttk::style layout Horizontal.TScrollbar {
|
||||
Horizontal.Scrollbar.trough -sticky ew -children {
|
||||
Horizontal.Scrollbar.leftarrow -side left
|
||||
Horizontal.Scrollbar.rightarrow -side right
|
||||
Horizontal.Scrollbar.thumb -expand 1
|
||||
}
|
||||
}
|
||||
|
||||
ttk::style element create Horizontal.Scrollbar.trough image $I(scrollbar-trough-hor) -sticky ew -border {6 0}
|
||||
ttk::style element create Horizontal.Scrollbar.thumb image $I(scrollbar-thumb-hor) -sticky ew -border {3 0}
|
||||
|
||||
ttk::style element create Horizontal.Scrollbar.rightarrow image $I(scrollbar-right) -sticky e -width 13
|
||||
ttk::style element create Horizontal.Scrollbar.leftarrow image $I(scrollbar-left) -sticky w -width 13
|
||||
|
||||
ttk::style element create Vertical.Scrollbar.trough image $I(scrollbar-trough-vert) -sticky ns -border {0 6}
|
||||
ttk::style element create Vertical.Scrollbar.thumb image $I(scrollbar-thumb-vert) -sticky ns -border {0 3}
|
||||
|
||||
ttk::style element create Vertical.Scrollbar.uparrow image $I(scrollbar-up) -sticky n -height 13
|
||||
ttk::style element create Vertical.Scrollbar.downarrow image $I(scrollbar-down) -sticky s -height 13
|
||||
|
||||
# Separator
|
||||
ttk::style element create Separator.separator image $I(sep) -width 1 -height 1
|
||||
|
||||
# Sizegrip
|
||||
ttk::style element create Sizegrip.sizegrip image $I(grip) -sticky nsew
|
||||
|
||||
# Card
|
||||
ttk::style layout Card.TFrame {
|
||||
Card.field {
|
||||
Card.padding -expand 1
|
||||
}
|
||||
}
|
||||
|
||||
ttk::style element create Card.field image $I(card) -border 10 -padding 4 -sticky nsew
|
||||
|
||||
# Labelframe
|
||||
ttk::style layout TLabelframe {
|
||||
Labelframe.border {
|
||||
Labelframe.padding -expand 1 -children {
|
||||
Labelframe.label -side left
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ttk::style element create Labelframe.border image $I(card) -border 5 -padding 4 -sticky nsew
|
||||
ttk::style configure TLabelframe.Label -font SunValleyCaptionFont
|
||||
|
||||
# Notebook
|
||||
ttk::style layout TNotebook {
|
||||
Notebook.border -children {
|
||||
TNotebook.Tab -expand 1
|
||||
}
|
||||
}
|
||||
|
||||
ttk::style configure TNotebook -padding 1
|
||||
ttk::style configure TNotebook.Tab -focuscolor $colors(-accent)
|
||||
ttk::style element create Notebook.border image $I(notebook-border) -border 5 -padding 5
|
||||
|
||||
ttk::style element create Notebook.tab image \
|
||||
[list $I(tab-rest) \
|
||||
selected $I(tab-selected) \
|
||||
active $I(tab-hover) \
|
||||
] -border 13 -padding {16 14 16 6} -height 32
|
||||
|
||||
# Treeview
|
||||
ttk::style configure Heading -font SunValleyCaptionFont
|
||||
ttk::style configure Treeview \
|
||||
-background $colors(-bg) \
|
||||
-rowheight [expr {[font metrics SunValleyBodyFont -linespace] + 3}] \
|
||||
-font SunValleyBodyFont
|
||||
|
||||
ttk::style map Treeview -background {selected "#292929"} -foreground "selected $colors(-selfg)"
|
||||
|
||||
ttk::style element create Treeview.field image $I(card) -border 5 -width 0 -height 0
|
||||
|
||||
ttk::style element create Treeheading.cell image \
|
||||
[list $I(heading-rest) \
|
||||
pressed $I(heading-pressed) \
|
||||
active $I(heading-hover)
|
||||
] -border 5 -padding 14 -sticky nsew
|
||||
|
||||
ttk::style element create Treeitem.indicator image \
|
||||
[list $I(right) \
|
||||
user2 $I(empty) \
|
||||
user1 $I(down) \
|
||||
] -width 26 -sticky {}
|
||||
|
||||
# Panedwindow
|
||||
ttk::style configure Sash \
|
||||
-lightcolor "#9e9e9e" \
|
||||
-darkcolor "#9e9e9e" \
|
||||
-bordercolor "#9e9e9e" \
|
||||
-sashthickness 4 \
|
||||
-gripcount 20
|
||||
}
|
||||
}
|
||||
+469
@@ -0,0 +1,469 @@
|
||||
source [file join [file dirname [info script]] sprites_light.tcl]
|
||||
|
||||
namespace eval ttk::theme::sv_light {
|
||||
package provide ttk::theme::sv_light 2.5
|
||||
|
||||
array set colors {
|
||||
-fg "#1c1c1c"
|
||||
-bg "#fafafa"
|
||||
-disfg "#a0a0a0"
|
||||
-selfg "#ffffff"
|
||||
-selbg "#2f60d8"
|
||||
-accent "#005fb8"
|
||||
}
|
||||
|
||||
proc load_images {imgfile} {
|
||||
variable I
|
||||
image create photo spritesheet -file $imgfile -format png
|
||||
foreach {name x y width height} $::spriteinfo {
|
||||
set I($name) [image create photo -width $width -height $height]
|
||||
$I($name) copy spritesheet -from $x $y [expr {$x+$width}] [expr {$y+$height}]
|
||||
}
|
||||
}
|
||||
|
||||
load_images [file join [file dirname [info script]] spritesheet_light.png]
|
||||
|
||||
ttk::style theme create sun-valley-light -parent clam -settings {
|
||||
|
||||
# Button
|
||||
ttk::style layout TButton {
|
||||
Button.button -children {
|
||||
Button.padding -children {
|
||||
Button.label -side left -expand 1
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ttk::style configure TButton -padding {8 2 8 3} -anchor center -foreground $colors(-fg)
|
||||
ttk::style map TButton -foreground [list disabled "#a2a2a2" pressed "#636363" active "#1a1a1a"]
|
||||
|
||||
ttk::style element create Button.button image \
|
||||
[list $I(button-rest) \
|
||||
{selected disabled} $I(button-dis) \
|
||||
disabled $I(button-dis) \
|
||||
selected $I(button-rest) \
|
||||
pressed $I(button-pressed) \
|
||||
{active focus} $I(button-focus-hover) \
|
||||
active $I(button-hover) \
|
||||
focus $I(button-focus) \
|
||||
] -border 4 -sticky nsew
|
||||
|
||||
# Toolbutton
|
||||
ttk::style layout Toolbutton {
|
||||
Toolbutton.button -children {
|
||||
Toolbutton.padding -children {
|
||||
Toolbutton.label -side left -expand 1
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ttk::style configure Toolbutton -padding {8 2 8 3} -anchor center
|
||||
|
||||
ttk::style element create Toolbutton.button image \
|
||||
[list $I(empty) \
|
||||
disabled $I(button-dis) \
|
||||
pressed $I(button-pressed) \
|
||||
{active focus} $I(button-focus-hover) \
|
||||
active $I(button-hover) \
|
||||
focus $I(button-focus) \
|
||||
] -border 4 -sticky nsew
|
||||
|
||||
# Accent.TButton
|
||||
ttk::style layout Accent.TButton {
|
||||
AccentButton.button -children {
|
||||
AccentButton.padding -children {
|
||||
AccentButton.label -side left -expand 1
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ttk::style configure Accent.TButton -padding {8 2 8 3} -anchor center -foreground "#ffffff"
|
||||
ttk::style map Accent.TButton -foreground [list pressed "#c1d8ee" disabled "#ffffff"]
|
||||
|
||||
ttk::style element create AccentButton.button image \
|
||||
[list $I(button-accent-rest) \
|
||||
{selected disabled} $I(button-accent-dis) \
|
||||
disabled $I(button-accent-dis) \
|
||||
selected $I(button-accent-rest) \
|
||||
pressed $I(button-accent-pressed) \
|
||||
{active focus} $I(button-accent-focus-hover) \
|
||||
active $I(button-accent-hover) \
|
||||
focus $I(button-accent-focus) \
|
||||
] -border 4 -sticky nsew
|
||||
|
||||
# Menubutton
|
||||
ttk::style layout TMenubutton {
|
||||
Menubutton.button -children {
|
||||
Menubutton.padding -children {
|
||||
Menubutton.label -side left -expand 1
|
||||
Menubutton.indicator -side right -sticky nsew
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ttk::style configure TMenubutton -padding {8 2 13 3}
|
||||
|
||||
ttk::style element create Menubutton.button image \
|
||||
[list $I(button-rest) \
|
||||
disabled $I(button-dis) \
|
||||
pressed $I(button-pressed) \
|
||||
{active focus} $I(button-focus-hover) \
|
||||
active $I(button-hover) \
|
||||
focus $I(button-focus) \
|
||||
] -border 4 -sticky nsew
|
||||
|
||||
ttk::style element create Menubutton.indicator image $I(down) -width 10 -sticky e
|
||||
|
||||
# OptionMenu
|
||||
ttk::style layout TOptionMenu {
|
||||
OptionMenu.button -children {
|
||||
OptionMenu.padding -children {
|
||||
OptionMenu.label -side left -expand 1
|
||||
OptionMenu.indicator -side right -sticky nsew
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ttk::style configure TOptionMenu -padding {8 2 13 3}
|
||||
|
||||
ttk::style element create OptionMenu.button image \
|
||||
[list $I(button-rest) \
|
||||
disabled $I(button-dis) \
|
||||
pressed $I(button-pressed) \
|
||||
{active focus} $I(button-focus-hover) \
|
||||
active $I(button-hover) \
|
||||
focus $I(button-focus) \
|
||||
] -border 4 -sticky nsew
|
||||
|
||||
ttk::style element create OptionMenu.indicator image $I(down) -width 10 -sticky e
|
||||
|
||||
# Checkbutton
|
||||
ttk::style layout TCheckbutton {
|
||||
Checkbutton.button -children {
|
||||
Checkbutton.padding -children {
|
||||
Checkbutton.indicator -side left
|
||||
Checkbutton.label -side right -expand 1
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ttk::style configure TCheckbutton -padding 4
|
||||
|
||||
ttk::style element create Checkbutton.indicator image \
|
||||
[list $I(check-unsel-rest) \
|
||||
{alternate disabled} $I(check-tri-dis) \
|
||||
{selected disabled} $I(check-dis) \
|
||||
disabled $I(check-unsel-dis) \
|
||||
{pressed alternate} $I(check-tri-hover) \
|
||||
{active focus alternate} $I(check-tri-focus-hover) \
|
||||
{active alternate} $I(check-tri-hover) \
|
||||
{focus alternate} $I(check-tri-focus) \
|
||||
alternate $I(check-tri-rest) \
|
||||
{pressed selected} $I(check-hover) \
|
||||
{active focus selected} $I(check-focus-hover) \
|
||||
{active selected} $I(check-hover) \
|
||||
{focus selected} $I(check-focus) \
|
||||
selected $I(check-rest) \
|
||||
{pressed !selected} $I(check-unsel-pressed) \
|
||||
{active focus} $I(check-unsel-focus-hover) \
|
||||
active $I(check-unsel-hover) \
|
||||
focus $I(check-unsel-focus) \
|
||||
] -width 26 -sticky w
|
||||
|
||||
# Switch.TCheckbutton
|
||||
ttk::style layout Switch.TCheckbutton {
|
||||
Switch.button -children {
|
||||
Switch.padding -children {
|
||||
Switch.indicator -side left
|
||||
Switch.label -side right -expand 1
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ttk::style element create Switch.indicator image \
|
||||
[list $I(switch-off-rest) \
|
||||
{selected disabled} $I(switch-dis) \
|
||||
disabled $I(switch-off-dis) \
|
||||
{pressed selected} $I(switch-pressed) \
|
||||
{active focus selected} $I(switch-focus-hover) \
|
||||
{active selected} $I(switch-hover) \
|
||||
{focus selected} $I(switch-focus) \
|
||||
selected $I(switch-rest) \
|
||||
{pressed !selected} $I(switch-off-pressed) \
|
||||
{active focus} $I(switch-off-focus-hover) \
|
||||
active $I(switch-off-hover) \
|
||||
focus $I(switch-off-focus) \
|
||||
] -width 46 -sticky w
|
||||
|
||||
# Toggle.TButton
|
||||
ttk::style layout Toggle.TButton {
|
||||
ToggleButton.button -children {
|
||||
ToggleButton.padding -children {
|
||||
ToggleButton.label -side left -expand 1
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ttk::style configure Toggle.TButton -padding {8 2 8 3} -anchor center -foreground $colors(-fg)
|
||||
|
||||
ttk::style map Toggle.TButton -foreground \
|
||||
[list {selected disabled} "#ffffff" \
|
||||
{selected pressed} "#636363" \
|
||||
selected "#ffffff" \
|
||||
pressed "#c1d8ee" \
|
||||
disabled "#a2a2a2" \
|
||||
active "#1a1a1a"
|
||||
]
|
||||
|
||||
ttk::style element create ToggleButton.button image \
|
||||
[list $I(button-rest) \
|
||||
{selected disabled} $I(button-accent-dis) \
|
||||
disabled $I(button-dis) \
|
||||
{pressed selected} $I(button-rest) \
|
||||
{active focus selected} $I(button-accent-focus-hover) \
|
||||
{active selected} $I(button-accent-hover) \
|
||||
{focus selected} $I(button-accent-focus) \
|
||||
selected $I(button-accent-rest) \
|
||||
{pressed !selected} $I(button-accent-rest) \
|
||||
{active focus} $I(button-focus-hover) \
|
||||
active $I(button-hover) \
|
||||
focus $I(button-focus) \
|
||||
] -border 4 -sticky nsew
|
||||
|
||||
# Radiobutton
|
||||
ttk::style layout TRadiobutton {
|
||||
Radiobutton.button -children {
|
||||
Radiobutton.padding -children {
|
||||
Radiobutton.indicator -side left
|
||||
Radiobutton.label -side right -expand 1
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ttk::style configure TRadiobutton -padding 4
|
||||
|
||||
ttk::style element create Radiobutton.indicator image \
|
||||
[list $I(radio-unsel-rest) \
|
||||
{selected disabled} $I(radio-dis) \
|
||||
disabled $I(radio-unsel-dis) \
|
||||
{pressed selected} $I(radio-pressed) \
|
||||
{active focus selected} $I(radio-focus-hover) \
|
||||
{active selected} $I(radio-hover) \
|
||||
{focus selected} $I(radio-focus) \
|
||||
selected $I(radio-rest) \
|
||||
{pressed !selected} $I(radio-unsel-pressed) \
|
||||
{active focus} $I(radio-unsel-focus-hover) \
|
||||
active $I(radio-unsel-hover) \
|
||||
focus $I(radio-unsel-focus) \
|
||||
] -width 26 -sticky w
|
||||
|
||||
# Entry
|
||||
ttk::style configure TEntry -foreground $colors(-fg) -padding {6 1 4 2}
|
||||
ttk::style map TEntry -foreground [list disabled $colors(-disfg) pressed "#636363" active "#626262"]
|
||||
|
||||
ttk::style element create Entry.field image \
|
||||
[list $I(textbox-rest) \
|
||||
{focus hover !invalid} $I(textbox-focus) \
|
||||
invalid $I(textbox-error) \
|
||||
disabled $I(textbox-dis) \
|
||||
{focus !invalid} $I(textbox-focus) \
|
||||
hover $I(textbox-hover) \
|
||||
] -border 5 -sticky nsew
|
||||
|
||||
# Combobox
|
||||
ttk::style layout TCombobox {
|
||||
Combobox.field -sticky nsew -children {
|
||||
Combobox.arrow -side right -sticky ns
|
||||
Combobox.padding -sticky nsew -children {
|
||||
Combobox.textarea -sticky nsew
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ttk::style configure TCombobox -foreground $colors(-fg) -padding {6 1 0 2}
|
||||
ttk::style configure ComboboxPopdownFrame -borderwidth 1 -relief solid
|
||||
ttk::style map TCombobox -foreground [list disabled $colors(-disfg) pressed "#636363" active "#626262"]
|
||||
|
||||
ttk::style map TCombobox -selectbackground [list \
|
||||
{readonly hover} $colors(-selbg) \
|
||||
{readonly focus} $colors(-selbg) \
|
||||
] -selectforeground [list \
|
||||
{readonly hover} $colors(-selfg) \
|
||||
{readonly focus} $colors(-selfg) \
|
||||
]
|
||||
|
||||
ttk::style element create Combobox.field image \
|
||||
[list $I(textbox-rest) \
|
||||
{readonly focus} $I(button-focus) \
|
||||
{readonly disabled} $I(button-dis) \
|
||||
{readonly pressed} $I(button-pressed) \
|
||||
{readonly hover} $I(button-hover) \
|
||||
readonly $I(button-rest) \
|
||||
{focus hover !invalid} $I(textbox-focus) \
|
||||
invalid $I(textbox-error) \
|
||||
disabled $I(textbox-dis) \
|
||||
focus $I(textbox-focus) \
|
||||
{focus !invalid} $I(textbox-focus) \
|
||||
hover $I(textbox-hover) \
|
||||
] -border 5
|
||||
|
||||
ttk::style element create Combobox.arrow image $I(down) -width 34 -sticky {}
|
||||
|
||||
# Spinbox
|
||||
ttk::style layout TSpinbox {
|
||||
Spinbox.field -side top -sticky we -children {
|
||||
Spinbox.downarrow -side right -sticky ns
|
||||
Spinbox.uparrow -side right -sticky ns
|
||||
Spinbox.padding -sticky nswe -children {
|
||||
Spinbox.textarea -sticky nsew
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ttk::style configure TSpinbox -foreground $colors(-fg) -padding {6 1 0 2}
|
||||
ttk::style map TSpinbox -foreground [list disabled $colors(-disfg) pressed "#636363" active "#626262"]
|
||||
|
||||
ttk::style element create Spinbox.field image \
|
||||
[list $I(textbox-rest) \
|
||||
{focus hover !invalid} $I(textbox-focus) \
|
||||
invalid $I(textbox-error) \
|
||||
disabled $I(textbox-dis) \
|
||||
focus $I(textbox-focus) \
|
||||
{focus !invalid} $I(textbox-focus) \
|
||||
hover $I(textbox-hover) \
|
||||
] -border 5 -sticky nsew
|
||||
|
||||
ttk::style element create Spinbox.uparrow image $I(up) -width 34 -height 16 -sticky {}
|
||||
ttk::style element create Spinbox.downarrow image $I(down) -width 34 -height 16 -sticky {}
|
||||
|
||||
# Progressbar
|
||||
ttk::style element create Horizontal.Progressbar.trough image $I(progressbar-trough-hor) \
|
||||
-border 1 -sticky ew
|
||||
ttk::style element create Horizontal.Progressbar.pbar image $I(progressbar-bar-hor) \
|
||||
-border 2 -sticky ew
|
||||
|
||||
ttk::style element create Vertical.Progressbar.trough image $I(progressbar-trough-vert) \
|
||||
-border 1 -sticky ns
|
||||
ttk::style element create Vertical.Progressbar.pbar image $I(progressbar-bar-vert) \
|
||||
-border 2 -sticky ns
|
||||
|
||||
# Scale
|
||||
ttk::style element create Horizontal.Scale.trough image $I(slider-trough-hor) \
|
||||
-border 5 -padding 0 -sticky {ew}
|
||||
|
||||
ttk::style element create Vertical.Scale.trough image $I(slider-trough-vert) \
|
||||
-border 5 -padding 0 -sticky {ns}
|
||||
|
||||
ttk::style element create Scale.slider image \
|
||||
[list $I(slider-thumb-rest) \
|
||||
disabled $I(slider-thumb-dis) \
|
||||
pressed $I(slider-thumb-pressed) \
|
||||
{active focus} $I(slider-thumb-focus-hover) \
|
||||
active $I(slider-thumb-hover) \
|
||||
focus $I(slider-thumb-focus) \
|
||||
] -sticky {}
|
||||
|
||||
# Scrollbar
|
||||
ttk::style layout Vertical.TScrollbar {
|
||||
Vertical.Scrollbar.trough -sticky ns -children {
|
||||
Vertical.Scrollbar.uparrow -side top
|
||||
Vertical.Scrollbar.downarrow -side bottom
|
||||
Vertical.Scrollbar.thumb -expand 1
|
||||
}
|
||||
}
|
||||
|
||||
ttk::style layout Horizontal.TScrollbar {
|
||||
Horizontal.Scrollbar.trough -sticky ew -children {
|
||||
Horizontal.Scrollbar.leftarrow -side left
|
||||
Horizontal.Scrollbar.rightarrow -side right
|
||||
Horizontal.Scrollbar.thumb -expand 1
|
||||
}
|
||||
}
|
||||
|
||||
ttk::style element create Horizontal.Scrollbar.trough image $I(scrollbar-trough-hor) -sticky ew -border {6 0}
|
||||
ttk::style element create Horizontal.Scrollbar.thumb image $I(scrollbar-thumb-hor) -sticky ew -border {3 0}
|
||||
|
||||
ttk::style element create Horizontal.Scrollbar.rightarrow image $I(scrollbar-right) -sticky e -width 13
|
||||
ttk::style element create Horizontal.Scrollbar.leftarrow image $I(scrollbar-left) -sticky w -width 13
|
||||
|
||||
ttk::style element create Vertical.Scrollbar.trough image $I(scrollbar-trough-vert) -sticky ns -border {0 6}
|
||||
ttk::style element create Vertical.Scrollbar.thumb image $I(scrollbar-thumb-vert) -sticky ns -border {0 3}
|
||||
|
||||
ttk::style element create Vertical.Scrollbar.uparrow image $I(scrollbar-up) -sticky n -height 13
|
||||
ttk::style element create Vertical.Scrollbar.downarrow image $I(scrollbar-down) -sticky s -height 13
|
||||
|
||||
# Separator
|
||||
ttk::style element create Separator.separator image $I(sep) -width 1 -height 1
|
||||
|
||||
# Sizegrip
|
||||
ttk::style element create Sizegrip.sizegrip image $I(grip) -sticky nsew
|
||||
|
||||
# Card
|
||||
ttk::style layout Card.TFrame {
|
||||
Card.field {
|
||||
Card.padding -expand 1
|
||||
}
|
||||
}
|
||||
|
||||
ttk::style element create Card.field image $I(card) -border 10 -padding 4 -sticky nsew
|
||||
|
||||
# Labelframe
|
||||
ttk::style layout TLabelframe {
|
||||
Labelframe.border {
|
||||
Labelframe.padding -expand 1 -children {
|
||||
Labelframe.label -side left
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ttk::style element create Labelframe.border image $I(card) -border 5 -padding 4 -sticky nsew
|
||||
ttk::style configure TLabelframe.Label -font SunValleyCaptionFont
|
||||
|
||||
# Notebook
|
||||
ttk::style layout TNotebook {
|
||||
Notebook.border -children {
|
||||
TNotebook.Tab -expand 1
|
||||
}
|
||||
}
|
||||
|
||||
ttk::style configure TNotebook -padding 1
|
||||
ttk::style configure TNotebook.Tab -focuscolor $colors(-accent)
|
||||
ttk::style element create Notebook.border image $I(notebook-border) -border 5 -padding 5
|
||||
|
||||
ttk::style element create Notebook.tab image \
|
||||
[list $I(tab-rest) \
|
||||
selected $I(tab-selected) \
|
||||
active $I(tab-hover) \
|
||||
] -border 13 -padding {16 14 16 6} -height 32
|
||||
|
||||
# Treeview
|
||||
ttk::style configure Heading -font SunValleyCaptionFont
|
||||
ttk::style configure Treeview \
|
||||
-background $colors(-bg) \
|
||||
-rowheight [expr {[font metrics SunValleyBodyFont -linespace] + 3}] \
|
||||
-font SunValleyBodyFont
|
||||
|
||||
ttk::style map Treeview -background {selected "#e7e7e7"} -foreground {selected "#191919"}
|
||||
|
||||
ttk::style element create Treeview.field image $I(card) -border 5 -width 0 -height 0
|
||||
ttk::style element create Treeheading.cell image \
|
||||
[list $I(heading-rest) \
|
||||
pressed $I(heading-pressed) \
|
||||
active $I(heading-hover)
|
||||
] -border 5 -padding 14 -sticky nsew
|
||||
|
||||
ttk::style element create Treeitem.indicator image \
|
||||
[list $I(right) \
|
||||
user2 $I(empty) \
|
||||
user1 $I(down) \
|
||||
] -width 26 -sticky {}
|
||||
|
||||
# Panedwindow
|
||||
ttk::style configure Sash \
|
||||
-lightcolor "#676767" \
|
||||
-darkcolor "#676767" \
|
||||
-bordercolor "#676767" \
|
||||
-sashthickness 4 \
|
||||
-gripcount 20
|
||||
}
|
||||
}
|
||||
+95
@@ -0,0 +1,95 @@
|
||||
set ::spriteinfo [list \
|
||||
card 0 0 50 50 \
|
||||
notebook-border 50 0 40 40 \
|
||||
switch-dis 50 40 40 20 \
|
||||
switch-focus-hover 0 50 40 20 \
|
||||
switch-focus 0 70 40 20 \
|
||||
switch-hover 40 60 40 20 \
|
||||
switch-off-dis 90 0 40 20 \
|
||||
switch-off-focus-hover 90 20 40 20 \
|
||||
switch-off-focus 90 40 40 20 \
|
||||
switch-off-hover 80 60 40 20 \
|
||||
switch-off-pressed 0 90 40 20 \
|
||||
switch-off-rest 40 80 40 20 \
|
||||
switch-pressed 80 80 40 20 \
|
||||
switch-rest 0 110 40 20 \
|
||||
tab-hover 130 0 32 32 \
|
||||
tab-rest 130 32 32 32 \
|
||||
tab-selected 120 64 32 32 \
|
||||
heading-hover 40 100 22 22 \
|
||||
heading-pressed 62 100 22 22 \
|
||||
heading-rest 84 100 22 22 \
|
||||
slider-thumb-dis 106 100 22 22 \
|
||||
slider-thumb-focus-hover 128 96 22 22 \
|
||||
slider-thumb-focus 0 130 22 22 \
|
||||
slider-thumb-hover 22 130 22 22 \
|
||||
slider-thumb-pressed 44 122 22 22 \
|
||||
slider-thumb-rest 66 122 22 22 \
|
||||
slider-trough-hor 88 122 22 22 \
|
||||
slider-trough-vert 110 122 22 22 \
|
||||
button-accent-dis 132 118 20 20 \
|
||||
button-accent-focus-hover 0 152 20 20 \
|
||||
button-accent-focus 20 152 20 20 \
|
||||
button-accent-hover 40 152 20 20 \
|
||||
button-accent-pressed 60 144 20 20 \
|
||||
button-accent-rest 80 144 20 20 \
|
||||
button-dis 100 144 20 20 \
|
||||
button-focus-hover 120 144 20 20 \
|
||||
button-focus 140 138 20 20 \
|
||||
button-hover 162 0 20 20 \
|
||||
button-pressed 162 20 20 20 \
|
||||
button-rest 162 40 20 20 \
|
||||
check-dis 162 60 20 20 \
|
||||
check-focus-hover 150 96 20 20 \
|
||||
check-focus 152 116 20 20 \
|
||||
check-hover 160 136 20 20 \
|
||||
check-pressed 0 172 20 20 \
|
||||
check-rest 20 172 20 20 \
|
||||
check-tri-dis 40 172 20 20 \
|
||||
check-tri-focus-hover 160 156 20 20 \
|
||||
check-tri-focus 140 158 20 20 \
|
||||
check-tri-hover 60 164 20 20 \
|
||||
check-tri-pressed 80 164 20 20 \
|
||||
check-tri-rest 100 164 20 20 \
|
||||
check-unsel-dis 120 164 20 20 \
|
||||
check-unsel-focus-hover 182 0 20 20 \
|
||||
check-unsel-focus 182 20 20 20 \
|
||||
check-unsel-hover 182 40 20 20 \
|
||||
check-unsel-pressed 182 60 20 20 \
|
||||
check-unsel-rest 180 80 20 20 \
|
||||
progressbar-bar-hor 180 100 20 5 \
|
||||
progressbar-bar-vert 172 80 5 20 \
|
||||
progressbar-trough-hor 152 80 20 5 \
|
||||
progressbar-trough-vert 172 100 5 20 \
|
||||
radio-dis 180 105 20 20 \
|
||||
radio-focus-hover 180 125 20 20 \
|
||||
radio-focus 180 145 20 20 \
|
||||
radio-hover 180 165 20 20 \
|
||||
radio-pressed 160 176 20 20 \
|
||||
radio-rest 140 178 20 20 \
|
||||
radio-unsel-dis 0 192 20 20 \
|
||||
radio-unsel-focus-hover 20 192 20 20 \
|
||||
radio-unsel-focus 40 192 20 20 \
|
||||
radio-unsel-hover 180 185 20 20 \
|
||||
radio-unsel-pressed 60 184 20 20 \
|
||||
radio-unsel-rest 80 184 20 20 \
|
||||
scrollbar-thumb-hor 160 196 20 12 \
|
||||
scrollbar-thumb-vert 100 184 12 20 \
|
||||
scrollbar-trough-hor 112 198 20 12 \
|
||||
scrollbar-trough-vert 202 0 12 20 \
|
||||
textbox-dis 0 212 20 20 \
|
||||
textbox-error 20 212 20 20 \
|
||||
textbox-focus 40 212 20 20 \
|
||||
textbox-hover 60 210 20 20 \
|
||||
textbox-rest 80 210 20 20 \
|
||||
down 40 50 10 5 \
|
||||
empty 152 64 10 10 \
|
||||
grip 152 85 10 10 \
|
||||
right 162 85 5 10 \
|
||||
sep 202 20 10 10 \
|
||||
up 40 55 10 5 \
|
||||
scrollbar-down 132 138 8 6 \
|
||||
scrollbar-left 44 144 6 8 \
|
||||
scrollbar-right 50 144 6 8 \
|
||||
scrollbar-up 172 120 8 6 \
|
||||
]
|
||||
+95
@@ -0,0 +1,95 @@
|
||||
set ::spriteinfo [list \
|
||||
card 0 0 50 50 \
|
||||
notebook-border 50 0 40 40 \
|
||||
switch-dis 50 40 40 20 \
|
||||
switch-focus-hover 0 50 40 20 \
|
||||
switch-focus 0 70 40 20 \
|
||||
switch-hover 40 60 40 20 \
|
||||
switch-off-dis 90 0 40 20 \
|
||||
switch-off-focus-hover 90 20 40 20 \
|
||||
switch-off-focus 90 40 40 20 \
|
||||
switch-off-hover 80 60 40 20 \
|
||||
switch-off-pressed 0 90 40 20 \
|
||||
switch-off-rest 40 80 40 20 \
|
||||
switch-pressed 80 80 40 20 \
|
||||
switch-rest 0 110 40 20 \
|
||||
tab-hover 130 0 32 32 \
|
||||
tab-rest 130 32 32 32 \
|
||||
tab-selected 120 64 32 32 \
|
||||
heading-hover 40 100 22 22 \
|
||||
heading-pressed 62 100 22 22 \
|
||||
heading-rest 84 100 22 22 \
|
||||
slider-thumb-dis 106 100 22 22 \
|
||||
slider-thumb-focus-hover 128 96 22 22 \
|
||||
slider-thumb-focus 0 130 22 22 \
|
||||
slider-thumb-hover 22 130 22 22 \
|
||||
slider-thumb-pressed 44 122 22 22 \
|
||||
slider-thumb-rest 66 122 22 22 \
|
||||
slider-trough-hor 88 122 22 22 \
|
||||
slider-trough-vert 110 122 22 22 \
|
||||
button-accent-dis 132 118 20 20 \
|
||||
button-accent-focus-hover 0 152 20 20 \
|
||||
button-accent-focus 20 152 20 20 \
|
||||
button-accent-hover 40 152 20 20 \
|
||||
button-accent-pressed 60 144 20 20 \
|
||||
button-accent-rest 80 144 20 20 \
|
||||
button-dis 100 144 20 20 \
|
||||
button-focus-hover 120 144 20 20 \
|
||||
button-focus 140 138 20 20 \
|
||||
button-hover 162 0 20 20 \
|
||||
button-pressed 162 20 20 20 \
|
||||
button-rest 162 40 20 20 \
|
||||
check-dis 162 60 20 20 \
|
||||
check-focus-hover 150 96 20 20 \
|
||||
check-focus 152 116 20 20 \
|
||||
check-hover 160 136 20 20 \
|
||||
check-pressed 0 172 20 20 \
|
||||
check-rest 20 172 20 20 \
|
||||
check-tri-dis 40 172 20 20 \
|
||||
check-tri-focus-hover 160 156 20 20 \
|
||||
check-tri-focus 140 158 20 20 \
|
||||
check-tri-hover 60 164 20 20 \
|
||||
check-tri-pressed 80 164 20 20 \
|
||||
check-tri-rest 100 164 20 20 \
|
||||
check-unsel-dis 120 164 20 20 \
|
||||
check-unsel-focus-hover 182 0 20 20 \
|
||||
check-unsel-focus 182 20 20 20 \
|
||||
check-unsel-hover 182 40 20 20 \
|
||||
check-unsel-pressed 182 60 20 20 \
|
||||
check-unsel-rest 180 80 20 20 \
|
||||
progressbar-bar-hor 180 100 20 5 \
|
||||
progressbar-bar-vert 172 80 5 20 \
|
||||
progressbar-trough-hor 152 80 20 5 \
|
||||
progressbar-trough-vert 172 100 5 20 \
|
||||
radio-dis 180 105 20 20 \
|
||||
radio-focus-hover 180 125 20 20 \
|
||||
radio-focus 180 145 20 20 \
|
||||
radio-hover 180 165 20 20 \
|
||||
radio-pressed 160 176 20 20 \
|
||||
radio-rest 140 178 20 20 \
|
||||
radio-unsel-dis 0 192 20 20 \
|
||||
radio-unsel-focus-hover 20 192 20 20 \
|
||||
radio-unsel-focus 40 192 20 20 \
|
||||
radio-unsel-hover 180 185 20 20 \
|
||||
radio-unsel-pressed 60 184 20 20 \
|
||||
radio-unsel-rest 80 184 20 20 \
|
||||
scrollbar-thumb-hor 160 196 20 12 \
|
||||
scrollbar-thumb-vert 100 184 12 20 \
|
||||
scrollbar-trough-hor 112 198 20 12 \
|
||||
scrollbar-trough-vert 202 0 12 20 \
|
||||
textbox-dis 0 212 20 20 \
|
||||
textbox-error 20 212 20 20 \
|
||||
textbox-focus 40 212 20 20 \
|
||||
textbox-hover 60 210 20 20 \
|
||||
textbox-rest 80 210 20 20 \
|
||||
down 40 50 10 5 \
|
||||
empty 152 64 10 10 \
|
||||
grip 152 85 10 10 \
|
||||
right 162 85 5 10 \
|
||||
sep 202 20 10 10 \
|
||||
up 40 55 10 5 \
|
||||
scrollbar-down 132 138 8 6 \
|
||||
scrollbar-left 44 144 6 8 \
|
||||
scrollbar-right 50 144 6 8 \
|
||||
scrollbar-up 172 120 8 6 \
|
||||
]
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 18 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 18 KiB |
Reference in new issue
Block a user