Emacs-doom-themes: 使用treemacs主题时图标和文本的对齐方式不正确

创建于 2020-02-03  ·  12评论  ·  资料来源: hlissner/emacs-doom-themes

随附的是快照,以供参考。 treemacs的原始主题没有此问题。 这会影响treemacstreemacs-dired-icons-mode

screenshot-2020-02-03_08-10-34

bug treemacs

最有用的评论

好的。 同时,我在9549c7c中进行了一些分类。

image

@CSRaghunandan让我知道这是否无济于事,我将重新打开问题。

所有12条评论

这是与#387相同的问题。 鉴于这是特定于all-the-icons的问题,因此无法修复。

实际上,我们也许可以解决它。 问题出在#347中引入的doom-colors主题。 默认的doom-atom主题可以正常工作:

image

查看doom-colors主题,没有使用的:height属性。

@CSRaghunandan这样可以解决问题吗?

(require 'treemacs)
(treemacs-create-theme "doom-colors"
  :extends "doom-atom"
  :config
  (progn
    (treemacs-create-icon
     :icon (format " %s\t" (all-the-icons-octicon "repo" :height 1.2 :v-adjust -0.1 :face 'doom-themes-treemacs-root-face))
     :extensions (root))
    (treemacs-create-icon
     :icon (format "%s\t" (all-the-icons-octicon "flame" :height 0.8 :v-adjust 0 :face 'all-the-icons-red))
     :extensions (error))
    (treemacs-create-icon
     :icon (format "%s\t" (all-the-icons-octicon "stop" :height 0.8 :v-adjust 0 :face 'all-the-icons-yellow))
     :extensions (warning))
    (treemacs-create-icon
     :icon (format "%s\t" (all-the-icons-octicon "info" :height 0.75 :v-adjust 0.1 :face 'all-the-icons-green))
     :extensions (info))
    (treemacs-create-icon
     :icon (format "  %s\t" (all-the-icons-alltheicon "git" :height 0.85 :face 'all-the-icons-red))
     :extensions ("gitignore" "git" "gitconfig" "gitmodules"))

    (dolist (item all-the-icons-icon-alist)
      (let* ((extensions (doom-themes--get-treemacs-extensions (car item)))
             (func (cadr item))
             (args (append (list (caddr item)) '(:v-adjust -0.05 :height 0.85) (cdddr item)))
             (icon (apply func args)))
        (let* ((icon-pair (cons (format "  %s\t" icon) " "))
               (gui-icons (treemacs-theme->gui-icons treemacs--current-theme))
               (tui-icons (treemacs-theme->tui-icons treemacs--current-theme))
               (gui-icon  (car icon-pair))
               (tui-icon  (cdr icon-pair)))
          (--each extensions
            (ht-set! gui-icons it gui-icon)
            (ht-set! tui-icons it tui-icon)))))))
(treemacs-load-theme "doom-colors")

@hlissner。 没错,这是一个解决方案,但我认为这更像是一种解决方法。 核心问题是所有图标都使用的字体,据我了解,这很难解决。 我认为该问题已在所有图标的仓库中得到了多次解决,但是,还没有人找到合适的解决方案。

虽然...等一下。 @ seagle0128 ,如何在这里#347对齐.gitignore文件?

之所以对齐,是因为其旁边的图标来自相同的图标集(存在相同的尺寸问题)。 如果您查看灰色图标(来自八位子集),它们是未对齐的。 在我们的主题中,我们为所有图标设置:height,因此它们要小很多。

编辑:哦,octicons图标集也自然变小了。

解决的办法是停止操作:高度炸毁图标图标或缩小彩色文件类型图标。

是的,这就是问题所在,默认字体大小不一致,并且其他字体(例如go图标)中也有几个文件图标(尽管我认为可以替代使用,我会提交PR请求进行更改。它比当前版本更明显)。

好的。 同时,我在9549c7c中进行了一些分类。

image

@CSRaghunandan让我知道这是否无济于事,我将重新打开问题。

好的。 同时,我在9549c7c中进行了一些分类。

image

@CSRaghunandan让我知道这是否无济于事,我将重新打开问题。

非常感谢您的快速响应和修复。 我会检查出来并与您联系。

虽然...等一下。 @ seagle0128 ,如何在这里#347对齐.gitignore文件?

我认为这可能与字体家族有关。 图标在MacBook中与menloSF mono对齐。

@hlissner似乎在最新提交后已修复。

谢谢 :)

干得好! @hlissner

@hlissner tab-width未设置为1时, doom-themes-emacs-config启用。 我必须将其手动设置为1才能看起来干净。 您可能需要再次查看。

谢谢

此页面是否有帮助?
0 / 5 - 0 等级

相关问题

chigoncalves picture chigoncalves  ·  5评论

r-darwish picture r-darwish  ·  4评论

ShaneKilkelly picture ShaneKilkelly  ·  18评论

seagle0128 picture seagle0128  ·  9评论

mpolden picture mpolden  ·  4评论