From 28d11fd0e8db7fb7456ebd285174822b2056e645 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Wed, 20 Apr 2022 10:44:51 -0500 Subject: bleh --- lisp/+tab-bar.el | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) (limited to 'lisp/+tab-bar.el') diff --git a/lisp/+tab-bar.el b/lisp/+tab-bar.el index 1f4745d..2c39dae 100644 --- a/lisp/+tab-bar.el +++ b/lisp/+tab-bar.el @@ -99,10 +99,10 @@ emms-player-playing-p) (let ((now-playing (+string-truncate (emms-mode-line-playlist-current) (- +tab-bar-emms-max-length 2)))) - `((emms-now-playing menu-item - ,(concat "{" now-playing "}" " ") - emms-pause - :help ,(emms-mode-line-playlist-current)))))) + `(emms-now-playing menu-item + ,(concat "{" now-playing "}" " ") + emms-pause + ( :help ,(emms-mode-line-playlist-current)))))) (defun +tab-bar-bongo () "Display Bongo now playing information." @@ -218,6 +218,17 @@ name to the left." (max 0 (- l-name tab-bar-tab-name-truncated-max l-ell)))) 'help-echo tab-name)))) +(defun +tab-bar-format-align-right () + "Align the rest of tab bar items to the right, pixel-wise." + ;; XXX: ideally, wouldn't require `shr' here + (require 'shr) ; `shr-string-pixel-width' + (let* ((rest (cdr (memq '+tab-bar-format-align-right tab-bar-format))) + (rest (tab-bar-format-list rest)) + (rest (mapconcat (lambda (item) (nth 2 item)) rest "")) + (hpos (shr-string-pixel-width rest)) + (str (propertize " " 'display `(space :align-to (- right (,hpos)))))) + `((align-right menu-item ,str ignore)))) + ;;; Menu bar ;; stole from https://github.com/emacs-mirror/emacs/blob/master/lisp/tab-bar.el -- cgit 1.4.1-21-gabe81