From 2e5ac53bdcbdc796dc4d1597bdf6d717e211bf24 Mon Sep 17 00:00:00 2001 From: silverwind Date: Mon, 21 Nov 2022 21:25:26 +0100 Subject: [PATCH] Embed Matrix icon as SVG (#21890) Embed the SVG icon directly, making further invertion unnecessary because the icon color can now follow text color. Screenshot 2022-11-21 at 20 16 32 Screenshot 2022-11-21 at 20 16 46 --- public/img/svg/gitea-matrix.svg | 1 + templates/admin/hook_new.tmpl | 2 +- templates/org/settings/hook_new.tmpl | 2 +- templates/repo/settings/webhook/base_list.tmpl | 2 +- templates/repo/settings/webhook/new.tmpl | 2 +- web_src/less/_base.less | 3 +++ web_src/less/themes/theme-arc-green.less | 4 ---- public/img/matrix.svg => web_src/svg/gitea-matrix.svg | 2 +- 8 files changed, 9 insertions(+), 9 deletions(-) create mode 100644 public/img/svg/gitea-matrix.svg rename public/img/matrix.svg => web_src/svg/gitea-matrix.svg (99%) diff --git a/public/img/svg/gitea-matrix.svg b/public/img/svg/gitea-matrix.svg new file mode 100644 index 00000000000..cc5e08d3c7f --- /dev/null +++ b/public/img/svg/gitea-matrix.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/templates/admin/hook_new.tmpl b/templates/admin/hook_new.tmpl index c5196fce4e7..407eae9646c 100644 --- a/templates/admin/hook_new.tmpl +++ b/templates/admin/hook_new.tmpl @@ -31,7 +31,7 @@ {{else if eq .HookType "feishu"}} {{else if eq .HookType "matrix"}} - + {{svg "gitea-matrix" 26}} {{else if eq .HookType "wechatwork"}} {{else if eq .HookType "packagist"}} diff --git a/templates/org/settings/hook_new.tmpl b/templates/org/settings/hook_new.tmpl index 7308cafa202..081f5a28394 100644 --- a/templates/org/settings/hook_new.tmpl +++ b/templates/org/settings/hook_new.tmpl @@ -26,7 +26,7 @@ {{else if eq .HookType "feishu"}} {{else if eq .HookType "matrix"}} - + {{svg "gitea-matrix" 26}} {{else if eq .HookType "wechatwork"}} {{else if eq .HookType "packagist"}} diff --git a/templates/repo/settings/webhook/base_list.tmpl b/templates/repo/settings/webhook/base_list.tmpl index fa68e12ce9f..f96c48d4cd8 100644 --- a/templates/repo/settings/webhook/base_list.tmpl +++ b/templates/repo/settings/webhook/base_list.tmpl @@ -29,7 +29,7 @@ {{.locale.Tr "repo.settings.web_hook_name_feishu_or_larksuite"}} - {{.locale.Tr "repo.settings.web_hook_name_matrix"}} + {{svg "gitea-matrix" 20 "img"}}{{.locale.Tr "repo.settings.web_hook_name_matrix"}} {{.locale.Tr "repo.settings.web_hook_name_wechatwork"}} diff --git a/templates/repo/settings/webhook/new.tmpl b/templates/repo/settings/webhook/new.tmpl index ea5a3eca3c4..2722e099bee 100644 --- a/templates/repo/settings/webhook/new.tmpl +++ b/templates/repo/settings/webhook/new.tmpl @@ -24,7 +24,7 @@ {{else if eq .HookType "feishu"}} {{else if eq .HookType "matrix"}} - + {{svg "gitea-matrix" 26}} {{else if eq .HookType "wechatwork"}} {{else if eq .HookType "packagist"}} diff --git a/web_src/less/_base.less b/web_src/less/_base.less index f2173d6d2b2..e49721f7e0e 100644 --- a/web_src/less/_base.less +++ b/web_src/less/_base.less @@ -784,6 +784,9 @@ a.commit-statuses-trigger { margin-top: -.25rem; margin-bottom: -.25rem; } +.ui.dropdown .menu > .item > svg.img { + margin-right: .78571429rem; +} .ui.selection.dropdown .menu > .item { border-color: var(--color-secondary); diff --git a/web_src/less/themes/theme-arc-green.less b/web_src/less/themes/theme-arc-green.less index b793f995091..fab1b9c3b47 100644 --- a/web_src/less/themes/theme-arc-green.less +++ b/web_src/less/themes/theme-arc-green.less @@ -182,7 +182,3 @@ .emoji[aria-label="musical notes"] { filter: invert(100%) hue-rotate(180deg); } - -img[src$="/img/matrix.svg"] { - filter: invert(80%); -} diff --git a/public/img/matrix.svg b/web_src/svg/gitea-matrix.svg similarity index 99% rename from public/img/matrix.svg rename to web_src/svg/gitea-matrix.svg index 9a255fd758a..63b23fc671c 100644 --- a/public/img/matrix.svg +++ b/web_src/svg/gitea-matrix.svg @@ -11,4 +11,4 @@ c-4.2-2.7-10.3-4.1-18.5-4.1c-2.4,0-5.6,0.5-9.5,1.6c-3.9,1.1-7.8,3.1-11.5,6.1c-3.7,3-6.9,7.3-9.5,12.9c-2.6,5.6-3.9,13-3.9,22.1 v107.6h-50.9V169.2H166.3z"/> - + \ No newline at end of file