diff options
author | Kerwin Bryant <kerwin612@qq.com> | 2025-04-10 09:10:16 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-04-09 18:10:16 -0700 |
commit | 02e49a0f471fcd50e70835458d196615f03c39cc (patch) | |
tree | 2c60bf0a60bfc078cbd049ebf089ab394e828293 /web_src/js/components/ViewFileTreeItem.vue | |
parent | fac6b87dd24be5021d9c656edc2072397cfd6bed (diff) | |
download | gitea-02e49a0f471fcd50e70835458d196615f03c39cc.tar.gz gitea-02e49a0f471fcd50e70835458d196615f03c39cc.zip |
Fix vertical centering of file tree icons and use entryIcon for submodules/symlinks (#34137)
In the file tree, the icons are not vertically centered, which affects
the overall visual consistency.
Currently, the icons of submodules and symlinks do not adopt the value
of entryIcon, resulting in inconsistent icon display.
before:

after:

---------
Co-authored-by: silverwind <me@silverwind.io>
Diffstat (limited to 'web_src/js/components/ViewFileTreeItem.vue')
-rw-r--r-- | web_src/js/components/ViewFileTreeItem.vue | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/web_src/js/components/ViewFileTreeItem.vue b/web_src/js/components/ViewFileTreeItem.vue index 69e26dbc33..c39fa1f4ae 100644 --- a/web_src/js/components/ViewFileTreeItem.vue +++ b/web_src/js/components/ViewFileTreeItem.vue @@ -58,7 +58,8 @@ const doGotoSubModule = () => { > <!-- submodule --> <div class="item-content"> - <SvgIcon class="text primary" name="octicon-file-submodule"/> + <!-- eslint-disable-next-line vue/no-v-html --> + <span class="tw-contents" v-html="item.entryIcon"/> <span class="gt-ellipsis tw-flex-1">{{ item.entryName }}</span> </div> </div> @@ -70,7 +71,8 @@ const doGotoSubModule = () => { > <!-- symlink --> <div class="item-content"> - <SvgIcon name="octicon-file-symlink-file"/> + <!-- eslint-disable-next-line vue/no-v-html --> + <span class="tw-contents" v-html="item.entryIcon"/> <span class="gt-ellipsis tw-flex-1">{{ item.entryName }}</span> </div> </div> @@ -83,7 +85,7 @@ const doGotoSubModule = () => { <!-- file --> <div class="item-content"> <!-- eslint-disable-next-line vue/no-v-html --> - <span v-html="item.entryIcon"/> + <span class="tw-contents" v-html="item.entryIcon"/> <span class="gt-ellipsis tw-flex-1">{{ item.entryName }}</span> </div> </div> @@ -95,13 +97,12 @@ const doGotoSubModule = () => { > <!-- directory --> <div class="item-toggle"> - <!-- FIXME: use a general and global class for this animation --> - <SvgIcon v-if="isLoading" name="octicon-sync" class="job-status-rotate"/> + <SvgIcon v-if="isLoading" name="octicon-sync" class="circular-spin"/> <SvgIcon v-else :name="collapsed ? 'octicon-chevron-right' : 'octicon-chevron-down'" @click.stop="doLoadChildren"/> </div> <div class="item-content"> <!-- eslint-disable-next-line vue/no-v-html --> - <span class="text primary" v-html="(!collapsed && item.entryIconOpen) ? item.entryIconOpen : item.entryIcon"/> + <span class="tw-contents" v-html="(!collapsed && item.entryIconOpen) ? item.entryIconOpen : item.entryIcon"/> <span class="gt-ellipsis">{{ item.entryName }}</span> </div> </div> @@ -154,7 +155,7 @@ const doGotoSubModule = () => { grid-area: content; display: flex; align-items: center; - gap: 0.25em; + gap: 0.5em; text-overflow: ellipsis; min-width: 0; } |