emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/golden-ratio f7bee8e221 65/95: Added width adjustment to a


From: ELPA Syncer
Subject: [nongnu] elpa/golden-ratio f7bee8e221 65/95: Added width adjustment to adjust for very wide frames.
Date: Thu, 7 Sep 2023 22:02:14 -0400 (EDT)

branch: elpa/golden-ratio
commit f7bee8e221542424a1a532ad02a8e3f61ac35c81
Author: EricGebhart <e.a.gebhart@gmail.com>
Commit: EricGebhart <e.a.gebhart@gmail.com>

    Added width adjustment to adjust for very wide frames.
---
 golden-ratio.el | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)

diff --git a/golden-ratio.el b/golden-ratio.el
index b28e88bb75..1b9f6438f1 100644
--- a/golden-ratio.el
+++ b/golden-ratio.el
@@ -62,14 +62,28 @@ will not cause the window to be resized to the golden 
ratio."
   :group 'golden-ratio
   :type 'boolean)
 
+(defcustom golden-ratio-adjust-width 1.0
+  "Adjust the width sizing by some factor. 1 is no adjustment.
+   For very wide screens/frames .4 may work well."
+  :group 'golden-ratio
+  :type 'integer)
+
 ;;; Compatibility
 ;;
 (unless (fboundp 'window-resizable-p)
   (defalias 'window-resizable-p 'window--resizable-p))
 
+(defun golden-ratio-adjust (a)
+  "set the adjustment of window widths."
+  (interactive
+   (list
+    (read-number "Adjust: " golden-ratio-adjust-width)))
+  (setq golden-ratio-adjust-width a))
+
 (defun golden-ratio--dimensions ()
   (list (floor (/ (frame-height) golden-ratio--value))
-        (floor (/ (frame-width)  golden-ratio--value))))
+        (floor  (* (/ (frame-width)  golden-ratio--value)
+                   golden-ratio-adjust-width))))
 
 (defun golden-ratio--resize-window (dimensions &optional window)
   (with-selected-window (or window (selected-window))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]