Skip to content

Commit

Permalink
feat: make full screen reach more flexible
Browse files Browse the repository at this point in the history
  • Loading branch information
jcs090218 committed Jun 24, 2024
1 parent 0071e65 commit 1cd125d
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions responsive-window.el
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
;; Adapt to different screen sizes automatically.
;;

(require 'elenv)

;;; Code:

(defgroup responsive-window nil
Expand Down Expand Up @@ -80,9 +82,13 @@

(defun responsive-window--reach-size ()
"Reach the size will want to remember the layout."
(let ((max-size (* (elenv-monitor-pixel-width) (elenv-monitor-pixel-height)))
(frame-size (* (frame-pixel-width) (frame-pixel-height))))
(< (* max-size 0.9) frame-size)))
(let* ((m-width (elenv-monitor-pixel-width))
(m-height (elenv-monitor-pixel-height))
(f-width (frame-pixel-width))
(f-height (frame-pixel-height))
(max-size (* m-width m-height))
(frame-size (* f-width f-height)))
(< (* max-size 0.8) frame-size))) ; if almost full monitor

(defun responsive-window--remember-layout (&optional force)
"Remember the frame layout once.
Expand Down

0 comments on commit 1cd125d

Please sign in to comment.