# ชุดรูปแบบ

A theme changes how VDM looks and keeps everything where it was: the same windows, menus and buttons in the same places, drawn in other colours, shapes and icons. Each theme has a light and a dark side.

## เลือกชุดรูปแบบ

เปิด **มุมมอง → ชุดรูปแบบ** แล้วคลิกชุดรูปแบบที่ต้องการ หน้าต่างทั้งหมดจะเปลี่ยนทันทีโดยไม่ต้องรีสตาร์ท จากนั้นใช้ **มุมมอง → รองรับโหมดมืด** และ **มุมมอง → มืดตลอดเวลา** เพื่อเลือกโหมดสว่างหรือมืด เช่นเดียวกับรูปลักษณ์แบบคลาสสิก ([โหมดมืด](https://vdm.mikaillab.com/th/help/getting-started.html#dark-mode))

The built-in themes are **Classic** (VDM's own look, the default), **Native** (your system's accent colour and contrast), **High contrast**, and the style themes **Metro**, **Adwaita**, **Breeze**, **Luna**, **Aero**, **Aqua** and **Emerald**, each with its own control shapes and icons, and on Windows its own title bar. [Getting started](https://vdm.mikaillab.com/th/help/getting-started.html#themes) describes each one; the website's [Themes page](https://vdm.mikaillab.com/themes.html) shows them all, light and dark.

## ตำแหน่งไฟล์ชุดรูปแบบ

Theme files you make or download go in VDM's themes folder. **View → Theme → Open themes folder** opens it (and makes it the first time). It is in VDM's data folder:

| ระบบ | โฟลเดอร์ |
|---|---|
| Windows | `%APPDATA%\voltdownloadmanager\themes` |
| Linux | `~/.local/share/voltdownloadmanager/themes` |
| macOS | `~/Library/Application Support/voltdownloadmanager/themes` |
| [สำเนาแบบพกพา](https://vdm.mikaillab.com/th/help/portable.html) | `data\themes`ข้างโปรแกรม |

ภายในสองวินาที ไฟล์ใหม่จะปรากฏใน **มุมมอง → ชุดรูปแบบ** ใต้ชุดรูปแบบในตัว โดยมี `name` ที่กำหนดเอง หลังจากแก้ไขไฟล์ ให้เลือกอีกครั้งใน **มุมมอง → ชุดรูปแบบ** เพื่อดูการเปลี่ยนแปลง

ชุดรูปแบบสามารถเป็นไฟล์เดียว (`harbour.toml`) หรือเป็นโฟลเดอร์ของตัวเอง (`harbour/theme.toml`) เมื่อมีไอคอน

**View → Theme → Add a theme file…** does it for you: pick a file anywhere, and VDM copies it into the themes folder and uses it at once. A file that isn't a theme stays out, and VDM says why.

## ชุดสี Base16 และ pywal

ชุดสีที่สร้างขึ้นสำหรับโปรแกรมอื่นก็เป็นชุดรูปแบบได้เช่นกัน โดยไม่ต้องแปลงอะไรเลย:

- **ชุดรูปแบบ Base16** ซึ่งเป็นไฟล์ `.yaml` ที่มาพร้อมกับ [ชุดรูปแบบ Base16 และ Base24](https://github.com/tinted-theming/schemes): ทั้งแบบคลาสสิก (`scheme:` และ `base00` ถึง `base0F` ที่ด้านบน) และแบบใหม่กว่า (`name:` และบล็อก `palette:`) ชุดรูปแบบ Base24 จะอ่านเป็น 16 สีแรก
- **ไฟล์ `colors.json` ของ pywal** หรือไฟล์ของโปรแกรมใด ๆ ที่มีรูปแบบเหมือน pywal (เทมเพลต pywal ของ wallust)

เพิ่มด้วย **มุมมอง → ชุดรูปแบบ → เพิ่มไฟล์ธีม…** หรือใส่ในโฟลเดอร์ชุดรูปแบบด้วยตัวเอง จะแสดงใน **มุมมอง → ชุดรูปแบบ** ภายใต้ชื่อชุดรูปแบบ (`name:` หรือ `scheme:`; ของ pywal จะตั้งชื่อตามวอลเปเปอร์)

**pywal itself:** once `wal` has run, **View → Theme** lists **pywal**, read straight from where pywal writes its colours: `~/.cache/wal/colors.json` (on Windows `%USERPROFILE%\.cache\wal\colors.json`, where winwal and pywal write it; `$PYWAL_CACHE_DIR` or `$XDG_CACHE_HOME/wal` when you set them). Pick it and VDM follows your wallpaper: each time `wal` writes new colours, VDM takes them within two seconds. It looks only at the file's date and size, every two seconds, and only while pywal is the theme. A copy added with **Add a theme file…** keeps the colours it had.

A scheme changes colours only, on the classic look: every window, button and menu stays where it was. A dark scheme makes VDM dark and a light one light, whatever **View → Always dark** says. The scheme's colours go where they mean the same:

| VDM | Base16 | pywal |
|---|---|---|
| รายการดาวน์โหลด กล่องข้อความ และเมนู | `base00`(พื้นหลัง) | `special.background` |
| Windows, กล่องโต้ตอบ, แถบเครื่องมือ, แถบเมนู และส่วนหัวคอลัมน์ | `base01`(พื้นหลังที่สว่างกว่า) | พื้นหลังที่เข้มขึ้นหนึ่งระดับ |
| ข้อความ | `base05`(พื้นหน้า) | `special.foreground` |
| ข้อความรอง (ขนาด, หมายเหตุ) | `base04` | `color8` |
| โฟกัส, ปุ่มเริ่มต้น, กล่องกาเครื่องหมาย, ลิงก์, การเลือก และแถบความคืบหน้า | `base0D`(สีน้ำเงิน) | `color4` |
| ข้อผิดพลาด | `base08`(สีแดง) | `color1` |
| คำเตือน | `base0A`(สีเหลือง) | `color3` |
| สำเร็จ, ตัววัด และชิ้นส่วนของทอร์เรนต์ | `base0B`(สีเขียว) | `color2` |

Borders and the hover and pressed shades are mixed from these, as for a theme file's `[seeds]`. Text stays readable: text and secondary text at 4.5:1 or more against every background they sit on (WCAG AA), the accent at 3:1. A scheme short of that has those colours moved a little darker (lighter on a dark scheme) until they pass; VDM's log says which.

หากต้องการเปลี่ยนมากกว่าสี ให้สร้างไฟล์ธีมที่สืบทอดชุดรูปแบบตามชื่อไฟล์และเพิ่มสิ่งที่คุณต้องการ:

```
name = "Gruvbox, my way"
inherits = "gruvbox-dark-medium"   # gruvbox-dark-medium.yaml, beside it
icons = "accent"

[sizes]
radius = 6
```

`inherits = "pywal"`ทำงานในลักษณะเดียวกัน และตาม `wal` ด้วย

## ไฟล์

ชุดรูปแบบคือไฟล์ข้อความขนาดเล็กหนึ่งไฟล์ในรูปแบบ [TOML](https://toml.io/) (หรือ JSON, `.json`; หรือ [ชุดสี](#base16-and-pywal-colour-schemes), `.yaml`) โดยจะระบุเฉพาะสิ่งที่เปลี่ยนแปลงเท่านั้น ส่วนที่เหลือทั้งหมดมาจากชุดรูปแบบที่ `inherits`:

```
name = "Harbour"
inherits = "classic"
icons = "color"

[seeds.light]
background = "#eef3f6"
surface = "#ffffff"
text = "#11202b"
accent = "#0f6c8c"

[seeds.dark]
background = "#14212a"
surface = "#0e171d"
text = "#e8f0f4"
accent = "#5cc3e6"

[sizes]
radius = 6

[controls]
focus = "ring"
```

- **`name`** — สิ่งที่ **มุมมอง → ชุดรูปแบบ** แสดงรายการ; ชื่อไฟล์เมื่อไม่มี
- **`inherits`** — ชุดรูปแบบที่ชุดรูปแบบของคุณเริ่มต้นจาก: `classic` (ค่าเริ่มต้นเมื่อเว้นว่าง), ID ของชุดรูปแบบในตัว (`metro`, `adwaita`, `breeze`, `luna`, `aero`, `aqua`, `high-contrast`) หรือไฟล์ชุดรูปแบบอื่นในโฟลเดอร์เดียวกัน โดยใช้ชื่อไฟล์ที่ไม่มี `.toml` ไฟล์ที่สืบทอดจากไฟล์อื่นสามารถถูกสืบทอดต่อได้; ชุดรูปแบบไม่สามารถสืบทอดจากตัวเองได้
- **`[seeds]`** — a handful of colours (`background`, `surface`, `header`, `text`, `accent`, `selection`, `error`, `warning`, `success`) that VDM spreads over every control. `[seeds.light]` and `[seeds.dark]` give each side its own.
- **`[colors]`** — บทบาทสีเดียว (เช่น `window`, `accent` หรือ `"segments.done"`) ทั้งสองด้าน; **`[light]`** และ **`[dark]`** เฉพาะด้านเดียว สีคือ `#rrggbb` หรือ `#rrggbbaa` ที่มีค่าความโปร่งใส บทบาทที่ไฟล์กำหนดจะมีผลเหนือสีหลัก
- **`[sizes]`** — รัศมีมุม, ความกว้างขอบ, ขนาดตัวอักษร และความสูงแถว ในหน่วยพิกเซล
- **`[controls]`** — รูปแบบของกล่องข้อความ, กล่องกาเครื่องหมาย, ปุ่ม, แถบความคืบหน้า, แถบเลื่อน, หัวคอลัมน์, เครื่องหมายโฟกัส และแถบชื่อเรื่อง รวมถึงแบบอักษรของเมนู
- **`icons`** — `color`, `mono` (สีเดียว) หรือ `accent`
- **`contrast = "high"`** — เพิ่มความเข้มของขอบและสีข้อความทั้งหมดเหนือส่วนที่เหลือ

Every colour role, size and control style, with what it sets, is listed on the website's [Themes page](https://vdm.mikaillab.com/themes.html#make-your-own) (read from VDM's own code, so it never drifts). The built-in themes are written the same way: [read them on GitHub](https://github.com/mikailhossenimran/voltdownloadmanager/tree/main/crates/app/assets/themes).

A key VDM doesn't know, or a value it can't read, is skipped and written to VDM's log (the `logs` folder beside the themes folder), so a file made for a newer VDM still loads. A file that isn't valid TOML or JSON doesn't load, and the log says why. A file named like a built-in theme (`metro.toml`) is passed over: give yours a name of its own.

### ไอคอน

ชุดรูปแบบในโฟลเดอร์ของตัวเอง (`harbour/theme.toml`) สามารถนำไอคอนมาใน `icons/16` และ `icons/24` (และสำหรับรูปภาพ PNG, `icons/32` และ `icons/48` ซึ่งใช้บนหน้าจอที่ปรับขนาด 150% ขึ้นไป) โดยแต่ละไอคอนตั้งชื่อตามสิ่งที่แสดง (`tb-add-url.svg`, `cat-music.png`…) ไฟล์ SVG และ PNG จะคงสีเดิมไว้; ไฟล์ `-symbolic.svg` และ `-symbolic.png` ซึ่งเป็นชื่อที่ GNOME และ KDE ใช้ จะใช้สีข้อความของชุดรูปแบบ ไอคอนที่ชุดขาดไปจะถูกวาดเหมือนรูปลักษณ์คลาสสิก รายชื่อชื่อทั้งหมดอยู่ใน [themeicons.rs](https://github.com/mikailhossenimran/voltdownloadmanager/blob/main/crates/app/src/themeicons.rs) (`NEEDS`)

## สร้างชุดรูปแบบ

1. **มุมมอง → ชุดรูปแบบ → เปิดโฟลเดอร์ชุดรูปแบบ** แล้วสร้างไฟล์ `.toml` ใหม่ที่นั่น (ใช้โปรแกรมแก้ไขข้อความใดก็ได้)
2. เริ่มต้นจากตัวอย่างด้านบน: เปลี่ยนสีหลัก จากนั้นเพิ่มบทบาทและขนาดตามต้องการ
3. เลือกใน **มุมมอง → ชุดรูปแบบ** และดูทั้งสองด้าน: **มุมมอง → มืดตลอดเวลา** เปิดและปิด ตรวจสอบว่าข้อความอ่านง่ายและเครื่องหมายโฟกัสปรากฏให้เห็นทั้งสองด้าน

[หน้าชุดรูปแบบ](https://vdm.mikaillab.com/themes.html#ai-prompt) ของเว็บไซต์มีข้อความแจ้งที่คุณสามารถให้ผู้ช่วย AI พร้อมรูปแบบ คีย์ทั้งหมด และกฎ เพื่อเขียนชุดรูปแบบให้คุณจากคำอธิบาย

## แบ่งปัน

สร้างสิ่งที่คนอื่นน่าจะชอบ? เปิด [pull request](https://github.com/mikailhossenimran/voltdownloadmanager/pulls) ที่เพิ่มลงใน `crates/app/assets/themes` พร้อม:

- ไฟล์ `.toml` และโฟลเดอร์ไอคอนหากมี;
- ภาพหน้าจอของหน้าต่างหลักในด้านสว่างและด้านมืด;
- a `SOURCES.txt` beside any icons, saying who drew them and under which licence. Icons must be your own or under a licence that lets VDM share them (GPL-3.0), never copied from another program.

ยังไม่แน่ใจใช่ไหม? [พูดคุย](https://github.com/mikailhossenimran/voltdownloadmanager/discussions) กันก่อน [CONTRIBUTING.md](https://vdm.mikaillab.com/th/contributing.html) อธิบายวิธีการทำงานของพูลรีเควสต์ที่นี่

## ขั้นตอนถัดไป

- [เริ่มต้นใช้งาน →](https://vdm.mikaillab.com/th/help/getting-started.html)
- [ตัวเลือก →](https://vdm.mikaillab.com/th/help/options.html)

## ที่เกี่ยวข้อง

- [ตัวเลือก](https://vdm.mikaillab.com/th/help/options.html)
- [ภาษา](https://vdm.mikaillab.com/th/help/languages.html)
- [โหมดพกพา](https://vdm.mikaillab.com/th/help/portable.html)
- [แป้นพิมพ์ลัด](https://vdm.mikaillab.com/th/help/keyboard-shortcuts.html)
- [บรรทัดคำสั่งและการทำงานอัตโนมัติ](https://vdm.mikaillab.com/th/help/command-line.html)

[แก้ไขหน้านี้บน GitHub](https://github.com/mikailhossenimran/voltdownloadmanager/edit/main/docs/themes.md) [รายงานปัญหาเกี่ยวกับหน้านี้](https://github.com/mikailhossenimran/voltdownloadmanager/issues/new?template=website.yml&title=Website%3A%20Themes&page=https%3A//vdm.mikaillab.com/help/themes.html) [ประวัติหน้า](https://github.com/mikailhossenimran/voltdownloadmanager/commits/main/docs/themes.md)

ฟรี, โอเพนซอร์ส, ไม่มีโฆษณา, ไม่มีช่วงทดลองใช้

[Download Volt Download Manager](https://vdm.mikaillab.com/th/download.html)
