Skip to content

Commit

Permalink
v0.6.28: save bounds switch
Browse files Browse the repository at this point in the history
  • Loading branch information
matthiasn committed Jan 7, 2019
1 parent f578f78 commit 311e847
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
All notable changes to this project will be documented in this file. This change log follows the conventions of [keepachangelog.com](http://keepachangelog.com/).


## [0.6.28] - 2018-01-07
### Changed
- save bounds switch

## [0.6.27] - 2018-12-26
### Changed
- support for restoring window at the same size and position
Expand Down
2 changes: 1 addition & 1 deletion project.clj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
(defproject matthiasn/systems-toolbox-electron "0.6.27"
(defproject matthiasn/systems-toolbox-electron "0.6.28"
:description "Building blocks for ClojureScript systems on top of Electron"
:url "https://github.com/matthiasn/systems-toolbox-electron"
:license {:name "Eclipse Public License"
Expand Down
5 changes: 3 additions & 2 deletions src/matthiasn/systems_toolbox_electron/window_manager.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
(t/write w serializable)))

(defn new-window [{:keys [current-state cmp-state msg-payload put-fn]}]
(let [{:keys [url width height x y window-id cached opts]} msg-payload]
(let [{:keys [url width height x y window-id cached opts save-bounds]} msg-payload]
(if (get-in current-state [:windows window-id])
(do (info "WM: window id exists, not creating new one:" window-id) {})
(let [default-opts {:width (or width 1280)
Expand Down Expand Up @@ -68,7 +68,8 @@
resized-moved (fn [_]
(let [bounds (js->clj (.getContentBounds window)
:keywordize-keys true)]
(put-fn [:window/resized bounds])
(when save-bounds
(put-fn [:window/resized bounds]))
(debug "resize" bounds)))]
(.on window "focus" #(js/setTimeout focus 10))
(.on window "resize" resized-moved)
Expand Down

0 comments on commit 311e847

Please sign in to comment.