Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions Viewer/Mac/Base.lproj/Main.storyboard
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,11 @@
</connections>
</menuItem>
<menuItem isSeparatorItem="YES" id="Qpm-Qs-Vdp"/>
<menuItem title="Float Window" keyEquivalent="F" id="kog-Ka-X5i">
<connections>
<action selector="toggleFloatWindow:" target="Ady-hI-5gd" id="HQv-XV-Nm1"/>
</connections>
</menuItem>
<menuItem title="Show Sidebar" keyEquivalent="s" id="kIP-vf-haE">
<modifierMask key="keyEquivalentModifierMask" control="YES" command="YES"/>
<connections>
Expand Down
15 changes: 15 additions & 0 deletions Viewer/Mac/Document.swift
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,17 @@ class Document: NSDocument {
isOrthographic.toggle()
}

@IBAction func toggleFloatWindow(_: NSMenuItem) {
if let window = viewController?.view.window {
if window.level == .floating {
window.level = .normal
return
}

window.level = .floating
}
}

// MARK: Menus

override func validateMenuItem(_ menuItem: NSMenuItem) -> Bool {
Expand Down Expand Up @@ -461,6 +472,10 @@ class Document: NSDocument {
case #selector(showModelInfo(_:)):
menuItem.title = selectedGeometry == nil ?
"Scene Info" : "Selected Shape Info"
case #selector(toggleFloatWindow(_:)):
if let window = viewController?.view.window {
menuItem.state = window.level == .floating ? .on : .off
}
default:
break
}
Expand Down
2 changes: 2 additions & 0 deletions docs/mac/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ No third-party editors currently support ShapeScript syntax directly, but if you

ShapeScript will only ask you which editor you want to use the *first* time you edit a file, then it will remember your choice. If you change your mind later, you can select a different editor in Preferences (select the `ShapeScript > Preferences…` menu or press **Cmd-,**).

When using an external editor, it may be useful to have the window displaying the rendered model accessible in the same workspace so you do not have to use split-screen or switch applications every time you make a change to see the result. You can do this using the `View > Float Window` option. Note that this setting must be set independently for each window.

## File Structure

The first line of the default `.shape` document looks like this:
Expand Down