summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThanos Apollo <[email protected]>2024-07-24 09:38:37 +0300
committerThanos Apollo <[email protected]>2024-07-24 09:38:37 +0300
commite44a7a4cf9d55779b80b4f9d5d0e15466d9fa2fd (patch)
tree59f1fd0f6f757ca199ed10d1dd173a9ad8e68b48
parent0448bf120425c5f4822da46c27f446b475fd1bf1 (diff)
New function: dashboard--add-padding
* Add padding for str-length. This is meant to be used with displaying month graphs
-rw-r--r--gnosis-dashboard.el6
1 files changed, 6 insertions, 0 deletions
diff --git a/gnosis-dashboard.el b/gnosis-dashboard.el
index 103d36b..a25fe81 100644
--- a/gnosis-dashboard.el
+++ b/gnosis-dashboard.el
@@ -112,6 +112,12 @@ Skips days where no note was reviewed."
(propertize string 'face 'font-lock-constant-face))))
(defun gnosis-dashboard-reviews-graph (dates &optional remove-spaces)
+(defun gnosis-dashboard--add-padding (str-length)
+ "Add padding for STR-LENGTH."
+ (let ((padding (/ (- (window-width) str-length) 2)))
+ (make-string padding ?\s)))
+
+(defun gnosis-dashboard-reviews-graph (dates &optional )
"Insert graph for month DATES.
Optionally, use REMOVE-SPACES when using multiple months."