2
;; $Id: theme.jl,v 1.10 2001/02/11 01:33:56 jsh Exp $
4
;; Copyright (C) 1999 John Harper <john@dcs.warwick.ac.uk>
6
;; This file is part of sawmill.
8
;; sawmill is free software; you can redistribute it and/or modify it
9
;; under the terms of the GNU General Public License as published by
10
;; the Free Software Foundation; either version 2, or (at your option)
13
;; sawmill is distributed in the hope that it will be useful, but
14
;; WITHOUT ANY WARRANTY; without even the implied warranty of
15
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
;; GNU General Public License for more details.
18
;; You should have received a copy of the GNU General Public License
19
;; along with sawmill; see the file COPYING. If not, write to
20
;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
22
(defgroup mono "Mono Theme"
25
(defcustom mono:normal-color nil
26
"Color of inactive frames (if unset use GTK+ background color)."
27
:type (optional color)
28
:group (appearance mono)
30
:after-set after-setting-frame-option)
32
(defcustom mono:active-color nil
33
"Color of active frames (if unset use GTK+ selection color)."
34
:type (optional color)
35
:group (appearance mono)
37
:after-set after-setting-frame-option)
39
(defcustom mono:text-justify 'left
40
"Text is \\w justified in window titles."
41
:type (choice left right center)
42
:group (appearance mono)
43
:after-set after-setting-frame-option)
46
(define minimize `((inactive . ,(make-image "min.png"))
47
(clicked . ,(make-image "min-c.png"))))
48
(define close `((inactive . ,(make-image "close.png"))
49
(clicked . ,(make-image "close-c.png"))))
50
(define maximize `((inactive . ,(make-image "max.png"))
51
(clicked . ,(make-image "max-c.png"))))
52
(define restore `((inactive . ,(make-image "restore.png"))
53
(clicked . ,(make-image "restore-c.png"))))
54
(define (maximize-restore w) (if (window-maximized-p w) restore maximize))
55
(define menu `((inactive . ,(make-image "menu.png"))
56
(clicked . ,(make-image "menu-c.png"))))
58
(define initialised-gtk nil)
61
(when (and (or (not mono:normal-color)
62
(not mono:active-color))
63
(not initialised-gtk))
64
(setq initialised-gtk t)
66
(gtkrc-call-after-changed
67
(lambda () (rebuild-frames-with-style 'mono))))
68
(rebuild-frames-with-style 'mono))
70
(define (frame-colors w)
71
(list (or (window-get w 'frame-inactive-color)
72
(and (not mono:normal-color)
73
(car gtkrc-background))
75
(or (window-get w 'frame-active-color)
76
(and (not mono:active-color)
77
(nth 3 gtkrc-background))
80
(define (text-justifier w)
81
(case mono:text-justify
87
`(((background . ,frame-colors)
88
(foreground . "black")
90
(x-justify . ,text-justifier)
98
((background . "black")
104
((background . "black")
110
((background . "black")
116
((background . ,frame-colors)
121
(class . bottom-border))
123
((background . "black")
129
((background . ,frame-colors)
135
(class . menu-button)
138
((background . ,frame-colors)
139
(foreground . ,minimize)
144
(class . iconify-button)
147
((background . ,frame-colors)
148
(foreground . ,maximize-restore)
153
(class . maximize-button)
156
((background . ,frame-colors)
157
(foreground . ,close)
162
(class . close-button)
166
`(((background . ,frame-colors)
167
(foreground . "black")
168
(text . ,window-name)
169
(x-justify . ,text-justifier)
177
((background . "black")
183
((background . "black")
189
((background . "black")
195
((background . "black")
201
((background . ,frame-colors)
207
(class . menu-button)
210
((background . ,frame-colors)
211
(foreground . ,minimize)
216
(class . iconify-button)
219
((background . ,frame-colors)
220
(foreground . ,maximize-restore)
225
(class . maximize-button)
228
((background . ,frame-colors)
229
(foreground . ,close)
234
(class . close-button)
238
(define transient-frame
239
`(((background . ,frame-colors)
246
((background . "black")
252
((background . "black")
258
((background . "black")
264
((background . ,frame-colors)
269
(class . bottom-border))
271
((background . "black")
277
(define shaped-transient-frame
278
`(((background . ,frame-colors)
285
((background . "black")
291
((background . "black")
297
((background . "black")
303
((background . "black")
309
(add-frame-style 'mono
313
((transient) transient-frame)
314
((shaped) shaped-frame)
315
((shaped-transient) shaped-transient-frame))))
318
(custom-set-property 'mono:normal-color ':after-set rebuild)