This repository has been archived on 2024-10-22. You can view files and clone it, but cannot push or open issues or pull requests.
spacemacs/layers/+spacemacs/spacemacs-visual/funcs.el
syl20bnr 0f646b884d Add properties for mode-line theme, remove powerline-scale
Since we have now a variable for the mode-line theme, it makes sense to move
the scaling of the mode-line to this variable. Thus the property
=:powerline-scale= of variable dotspacemacs-default-font has been removed and
it is replace by the property =:separator-scale= used in the variable
=dotspacemacs-mode-line-theme=.

This commit also adds a the property =:sperator= for the variable
=dotspacemacs-mode-line-theme= which allows to set the separator type.

Example of the final result:

   dotspacemacs-mode-line-theme '(all-the-icons
                                  :separator cup
                                  :separator-scale 1.5)

Documentation has been updated to reflect the changes.
2018-01-16 22:59:29 -05:00

69 lines
2.1 KiB
EmacsLisp
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

;;; funcs.el --- Spacemacs UI Layer functions File
;;
;; Copyright (c) 2012-2018 Sylvain Benner & Contributors
;;
;; Author: Sylvain Benner <sylvain.benner@gmail.com>
;; URL: https://github.com/syl20bnr/spacemacs
;;
;; This file is not part of GNU Emacs.
;;
;;; License: GPLv3
;; ansi-colors
(defun spacemacs-visual//compilation-buffer-apply-ansi-colors ()
(let ((inhibit-read-only t))
(goto-char compilation-filter-start)
(ansi-color-apply-on-region (line-beginning-position) (point-max))))
;; popwin
(defun spacemacs/remove-popwin-display-config (str)
"Removes the popwin display configurations that matches the passed STR"
(setq popwin:special-display-config
(-remove (lambda (x) (if (and (listp x) (stringp (car x)))
(string-match str (car x))))
popwin:special-display-config)))
;; zoom
(defun spacemacs//zoom-frm-powerline-reset ()
(when (fboundp 'powerline-reset)
(setq-default powerline-height (spacemacs/compute-mode-line-height))
(powerline-reset)))
(defun spacemacs//zoom-frm-do (arg)
"Perform a zoom action depending on ARG value."
(let ((zoom-action (cond ((eq arg 0) 'zoom-frm-unzoom)
((< arg 0) 'zoom-frm-out)
((> arg 0) 'zoom-frm-in)))
(fm (cdr (assoc 'fullscreen (frame-parameters))))
(fwp (* (frame-char-width) (frame-width)))
(fhp (* (frame-char-height) (frame-height))))
(when (equal fm 'maximized)
(toggle-frame-maximized))
(funcall zoom-action)
(set-frame-size nil fwp fhp t)
(when (equal fm 'maximized)
(toggle-frame-maximized))))
(defun spacemacs/zoom-frm-in ()
"zoom in frame, but keep the same pixel size"
(interactive)
(spacemacs//zoom-frm-do 1)
(spacemacs//zoom-frm-powerline-reset))
(defun spacemacs/zoom-frm-out ()
"zoom out frame, but keep the same pixel size"
(interactive)
(spacemacs//zoom-frm-do -1)
(spacemacs//zoom-frm-powerline-reset))
(defun spacemacs/zoom-frm-unzoom ()
"Unzoom current frame, keeping the same pixel size"
(interactive)
(spacemacs//zoom-frm-do 0)
(spacemacs//zoom-frm-powerline-reset))