GolinksPRO Download Manager
  1. 主页
  2. 帮助
  3. 主题

主题

A theme changes how GDM 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.

选择主题

打开视图 → 主题,然后点击一个主题:整个窗口会立即改变,无需重启。然后,视图 → 深色模式支持和视图 → 始终为深色会选择其浅色或深色模式,就像经典外观一样(深色模式)。

The built-in themes are Classic (GDM's own look, the default), Native (your system's accent colour and contrast), High contrast, and the style themes Metro, Adwaita, Breeze, Luna, Aero and Aqua, each with its own control shapes and icons, and on Windows its own title bar. Getting started describes each one; the website's Themes page shows them all, light and dark.

主题文件存放位置

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

系统 文件夹
Windows %APPDATA%\misterdownloadmanager\themes
Linux ~/.local/share/misterdownloadmanager/themes
macOS ~/Library/Application Support/misterdownloadmanager/themes
便携版 data\themes在程序旁边

两秒钟内,新文件会显示在视图 → 主题中,内置主题下方,带有它自己提供的name。编辑文件后,在视图 → 主题中再次选择它以查看更改。

主题可以是一个文件(harbour.toml),或者当它包含图标时,可以是一个独立的文件夹(harbour/theme.toml)。

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

Base16 和 pywal 配色方案

为其他程序制作的配色方案也可以作为主题,无需转换:

  • Base16 方案,即 .yaml 文件,Base16 和 Base24 方案 均采用此格式:包括经典布局(顶部 scheme: 和 base00 到 base0F)和新布局(name: 和 palette: 块)。Base24 方案读取其前 16 种颜色。
  • pywal 的 colors.json,或任何符合 pywal 格式的程序文件(wallust 的 pywal 模板)。

通过视图 → 主题 → 添加主题文件…添加,或自行放入主题文件夹。它会显示在视图 → 主题下,名称为方案名(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 GDM follows your wallpaper: each time wal writes new colours, GDM 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 GDM dark and a light one light, whatever View → Always dark says. The scheme's colours go where they mean the same:

GDM 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; GDM'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 文本文件(或 JSON,.json;或配色方案,.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 GDM 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 (read from GDM's own code, so it never drifts). The built-in themes are written the same way: read them on GitHub.

A key GDM doesn't know, or a value it can't read, is skipped and written to GDM's log (the logs folder beside the themes folder), so a file made for a newer GDM 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(NEEDS)中。

制作主题

  1. 视图 → 主题 → 打开主题文件夹,并在其中创建一个新的.toml文件(任何文本编辑器)。
  2. 从上面的示例开始:更改种子的颜色,然后逐步添加角色和大小。
  3. 在视图 → 主题中选择它,并查看两侧:视图 → 始终为深色的开启和关闭状态。检查文本是否可读,以及焦点标记在两种模式下是否可见。

网站的主题页面提供了一个您可以提供给 AI 助手的提示,其中包含格式、所有键和规则,以便根据描述为您编写主题。

分享

制作了其他人会喜欢的东西?打开一个拉取请求,将其添加到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 GDM share them (GPL-3.0), never copied from another program.

不确定?请先在讨论区中展示。 CONTRIBUTING.md解释了拉取请求的工作方式。

下一步

免费、开源、无广告、无试用版。

Download GolinksPRO Download Manager