Function: dirvish--mode-line-bar-img

dirvish--mode-line-bar-img is a natively compiled function defined in dirvish.el.

Signature

(dirvish--mode-line-bar-img FULLFRAME-P HEADER)

Documentation

Create a bar image with height of dirvish-mode-line-height.

If FULLFRAME-P, use the cdr of the value as height, otherwise use car. If HEADER, use dirvish-header-line-height instead.

Source Code

;; Defined in /nix/store/1gijwny2yx4fggrsb9l110h1ybs1gdk5-emacs-packages-deps/share/emacs/site-lisp/elpa/dirvish-20260725.1520/dirvish.el
;; Thanks to `doom-modeline'.
(defun dirvish--mode-line-bar-img (fullframe-p header)
  "Create a bar image with height of `dirvish-mode-line-height'.
If FULLFRAME-P, use the `cdr' of the value as height, otherwise
use `car'.  If HEADER, use `dirvish-header-line-height' instead."
  (when (and (display-graphic-p) (image-type-available-p 'pbm)
             (numberp dirvish-mode-line-bar-image-width))
    (let ((ht (dirvish--mode-line-height fullframe-p header))
          (wd dirvish-mode-line-bar-image-width))
      (propertize
       " " 'display
       (ignore-errors
         (create-image
          (concat (format "P1\n%i %i\n" (if (eq wd 0) 1 wd) ht)
                  (make-string (* wd ht) (if (> wd 0) ?1 ?0)) "\n")
          'pbm t :foreground "None" :ascent 'center))))))