Browse code
added buffers colors
Alexey Veretennikov authored on 27/05/2015 06:26:50
Showing 1 changed files
Showing 1 changed files
... | ... |
@@ -58,8 +58,11 @@ |
58 | 58 |
|
59 | 59 |
(defclass editor-panes-theme () |
60 | 60 |
((editor-panes :initform nil :accessor editor-panes) |
61 |
+ (buffers-panes :initform nil :accessor buffers-panes) |
|
61 | 62 |
(editor-background :initform +default-background-color+ :accessor bg) |
62 |
- (editor-foreground :initform +default-foreground-color+ :accessor fg))) |
|
63 |
+ (editor-foreground :initform +default-foreground-color+ :accessor fg) |
|
64 |
+ (buffers-background :initform +default-background-color+ :accessor buffers-bg) |
|
65 |
+ (buffers-foreground :initform +default-foreground-color+ :accessor buffers-fg))) |
|
63 | 66 |
|
64 | 67 |
(defclass listener-panes-theme () |
65 | 68 |
((listener-panes :initform nil :accessor listener-panes) |
... | ... |
@@ -76,9 +79,6 @@ |
76 | 79 |
(defvar *listener-tool* (make-instance 'listener-panes-theme)) |
77 | 80 |
(defvar *all-tools* (make-instance 'general-panes-theme)) |
78 | 81 |
|
79 |
-;; (eq (capi:capi-object-name b) 'lw-tools::buffers-list) |
|
80 |
- |
|
81 |
- |
|
82 | 82 |
(defun all-color-themes () |
83 | 83 |
(maphash #'(lambda (key value) |
84 | 84 |
(declare (ignore value)) |
... | ... |
@@ -101,10 +101,10 @@ |
101 | 101 |
(defun update-pane-colors (pane foreground background) |
102 | 102 |
(setf (capi:simple-pane-foreground pane) foreground) |
103 | 103 |
(setf (capi:simple-pane-background pane) background) |
104 |
- |
|
105 |
- (let ((recolorize-p (editor::buffer-font-lock-mode-p (capi:editor-pane-buffer pane)))) |
|
106 |
- (when recolorize-p |
|
107 |
- (gp:invalidate-rectangle pane)))) |
|
104 |
+ |
|
105 |
+ (when (and (typep pane 'capi:editor-pane) |
|
106 |
+ (editor::buffer-font-lock-mode-p (capi:editor-pane-buffer pane))) |
|
107 |
+ (gp:invalidate-rectangle pane))) |
|
108 | 108 |
|
109 | 109 |
|
110 | 110 |
(defgeneric clear-colors (tool) |
... | ... |
@@ -133,14 +133,16 @@ |
133 | 133 |
(defmethod update ((self editor-panes-theme)) |
134 | 134 |
(mapcar #'(lambda (pane) |
135 | 135 |
(update-pane-colors pane (fg self) (bg self))) |
136 |
- (editor-panes self))) |
|
136 |
+ (editor-panes self)) |
|
137 |
+ (mapcar #'(lambda (pane) |
|
138 |
+ (update-pane-colors pane (buffers-fg self) (buffers-bg self))) |
|
139 |
+ (buffers-panes self))) |
|
137 | 140 |
|
138 | 141 |
(defmethod update ((self listener-panes-theme)) |
139 | 142 |
(mapcar #'(lambda (pane) |
140 | 143 |
(update-pane-colors pane (fg self) (bg self))) |
141 | 144 |
(listener-panes self))) |
142 | 145 |
|
143 |
- |
|
144 | 146 |
(defmethod update ((self general-panes-theme)) |
145 | 147 |
(mapcar #'(lambda (pane) |
146 | 148 |
(update-pane-colors pane (output-fg self) (output-bg self))) |
... | ... |
@@ -154,6 +156,8 @@ |
154 | 156 |
listener-background |
155 | 157 |
output-foreground |
156 | 158 |
output-background |
159 |
+ buffers-foreground |
|
160 |
+ buffers-background |
|
157 | 161 |
&allow-other-keys) |
158 | 162 |
(color-theme-args theme-name) |
159 | 163 |
|
... | ... |
@@ -184,6 +188,15 @@ |
184 | 188 |
(output-bg *all-tools*) |
185 | 189 |
(or output-background |
186 | 190 |
(bg *editor-tool*))) |
191 |
+ |
|
192 |
+ ;; buffers list colors |
|
193 |
+ (setf (buffers-fg *editor-tool*) |
|
194 |
+ (or buffers-foreground |
|
195 |
+ (fg *editor-tool*)) |
|
196 |
+ (buffers-bg *editor-tool*) |
|
197 |
+ (or buffers-background |
|
198 |
+ (bg *editor-tool*))) |
|
199 |
+ |
|
187 | 200 |
|
188 | 201 |
(dolist (name *editor-face-names*) |
189 | 202 |
(let* ((color-theme-args-for-face (getf color-theme-args name)) |
... | ... |
@@ -253,7 +266,12 @@ |
253 | 266 |
(fg-color (output-fg *all-tools*))) |
254 | 267 |
(setf (capi:simple-pane-foreground pane) fg-color) |
255 | 268 |
(setf (capi:simple-pane-background pane) bg-color))) |
256 |
- |
|
269 |
+ |
|
270 |
+(defun set-mulitcolumn-list-panel-colors (pane) |
|
271 |
+ (when (eq (capi:capi-object-name pane) 'lw-tools::buffers-list) |
|
272 |
+ (pushnew pane (buffers-panes *editor-tool*)) |
|
273 |
+ (update-pane-colors pane (buffers-fg *editor-tool*) (buffers-bg *editor-tool*)))) |
|
274 |
+ |
|
257 | 275 |
|
258 | 276 |
(lispworks:defadvice ((method capi:interface-display :before (lw-tools:editor)) |
259 | 277 |
change-editor-colors |
... | ... |
@@ -277,6 +295,14 @@ |
277 | 295 |
clos::initargs &key &allow-other-keys) |
278 | 296 |
(set-collector-pane-colors self))) |
279 | 297 |
|
298 |
+(lispworks:defadvice ((method initialize-instance :after (capi:multi-column-list-panel)) |
|
299 |
+ change-multicolumn-colors |
|
300 |
+ :after |
|
301 |
+ :documentation "Change capi:multi-column-list-panel colors") |
|
302 |
+ (self &rest initargs &key &allow-other-keys) |
|
303 |
+ (set-mulitcolumn-list-panel-colors self)) |
|
304 |
+ |
|
305 |
+ |
|
280 | 306 |
|
281 | 307 |
;; This makes it "work" after the podium is launched |
282 | 308 |
(defun is-editor-pane-p (obj) |