Permalink
Browse files

Fix issue #45: Preserve same font name when changing font size

  • Loading branch information...
1 parent e81de94 commit b45218fc2cf9333f1454b72118aa8fc95c650e5c @jafingerhut jafingerhut committed May 21, 2012
Showing with 4 additions and 2 deletions.
  1. +4 −2 src/clj_ns_browser/browser.clj
@@ -90,13 +90,15 @@
(defn font-size+
"Increase the font-size of the widget w by 1."
[w]
- (config! w :font {:size (+ 1 (.getSize (config w :font)))}))
+ (let [f (config w :font)]
+ (config! w :font {:name (.getName f) :size (inc (.getSize f))})))
(defn font-size-
"Decrease the font-size of the widget w by 1."
[w]
- (config! w :font {:size (- (.getSize (config w :font)) 1)}))
+ (let [f (config w :font)]
+ (config! w :font {:name (.getName f) :size (dec (.getSize f))})))
;; constants and global maps shared by all seesaw widgets

0 comments on commit b45218f

Please sign in to comment.