Skip to content

Commit

Permalink
Make draft pull-requests italic
Browse files Browse the repository at this point in the history
Add new face `forge-pullreq-draft' face, which makes draft pull-requests
italic by default.

Previously all done topics were italic, but that was an unnecessary
complication.  Pending topics are already bold (and unread topics are
bold and have a box around them), so it is enough for done topics to
just not be bold.

Closes #726.
  • Loading branch information
tarsius committed Nov 14, 2024
1 parent 54cfcd0 commit 969b523
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions lisp/forge-topic.el
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ faces should not set `:weight' or `:slant'."
:group 'forge-faces)

(defface forge-topic-done
'((t :slant italic))
'((t))
"Face used for summaries of entities with no unread or open notification.
This face is always used together with, and takes preference over,
a `forge-{issue,pullreq}-STATE' face and should not specify any
Expand Down Expand Up @@ -198,6 +198,13 @@ faces should not set `:weight' or `:slant'."
"Face used for summaries of closed pull-requests, that weren't merged."
:group 'forge-faces)

(defface forge-pullreq-draft
'((t :slant italic))
"Face used for summaries of draft pull-requests.
A face attribute should be used that is not already used by any
`forge-topic-STATUS' or `forge-{issue,pullreq}-STATE' face."
:group 'forge-faces)

;;;; Labels

(defface forge-topic-label
Expand Down Expand Up @@ -830,7 +837,10 @@ can be selected from the start."
nil
(magit--propertize-face
title
`(,(pcase status
`(,@(and (forge-pullreq-p topic)
(oref topic draft-p)
'(forge-pullreq-draft))
,(pcase status
('unread 'forge-topic-unread)
('pending 'forge-topic-pending)
('done 'forge-topic-done))
Expand Down Expand Up @@ -1291,7 +1301,9 @@ This mode itself is never used directly."
["" :if-non-nil forge--show-topic-legend
(:info* (lambda () (propertize "unread" 'face 'forge-topic-unread)))
(:info* (lambda () (propertize "pending" 'face 'forge-topic-pending)))
(:info* (lambda () (propertize "done" 'face 'forge-topic-done)))]))
(:info* (lambda () (propertize "done" 'face 'forge-topic-done)))]
["" :if-non-nil forge--show-topic-legend
(:info* (lambda () (propertize "draft" 'face 'forge-pullreq-draft)))]))

(defvar forge--show-topic-legend t)

Expand Down

0 comments on commit 969b523

Please sign in to comment.