Skip to content

Commit

Permalink
Add a preference to turn off auto layout
Browse files Browse the repository at this point in the history
  • Loading branch information
Weston Thayer committed Aug 4, 2016
1 parent b364ec2 commit de96d8e
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 4 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ A UX for flexbox layout within Illustrator. [Read the blog post](http://westonth

Requires **Illustrator 2015.3** (latest Creative Cloud version).

1. [Download bloks.zip](https://github.com/WestonThayer/Bloks/releases/download/v0.1.0/bloks.zip)
1. [Download bloks.zip](https://github.com/WestonThayer/Bloks/releases/download/v0.1.1/bloks.zip)
2. Unzip
3. Copy the `com.westonthayer.bloks` folder to
1. Windows: `C:\Program Files (x86)\Common Files\Adobe\CEP\extensions\`
Expand All @@ -20,4 +20,4 @@ Get started by opening a document in Illustrator and going to *Window > Extensio

## Tutorial

For a quick introduction to how Bloks works, download [BloksTutorial.ai](https://github.com/WestonThayer/Bloks/blob/master/sample-files/BloksTutorial.ai?raw=true). There are a few more [sample files](https://github.com/WestonThayer/Bloks/tree/master/sample-files) as well.
For a quick introduction to how Bloks works, open `samples/BloksTutorial.ai`.
4 changes: 4 additions & 0 deletions css/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@
margin: 12px 6px 4px;
}

.bottombuttons .topcoat-checkbox {
margin: 6px 0 0 0;
}

.divider {
border-top: 1px solid rgba(0,0,0,0.8);
border-bottom: 1px solid rgba(255,255,255,0.2);
Expand Down
8 changes: 7 additions & 1 deletion gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,11 +129,17 @@ gulp.task("zxp-plugin-win-32", function() {
.pipe(gulp.dest("release/WIN_32/"));
});

gulp.task("zxp-samples", function() {
return gulp.src("sample-files/*.ai")
.pipe(gulp.dest("release/samples/"));
});

gulp.task("zxp",
[
"zxp-html-extension",
"zxp-plugin-mac",
"zxp-plugin-win-64",
"zxp-plugin-win-32"
"zxp-plugin-win-32",
"zxp-samples"
]
);
5 changes: 5 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,11 @@
<button id="spacer-hide-btn" class="topcoat-button--large hostFontSize" title="Set the opacity of all art with '.spacer' in its name to 0.0">Hide .spacer</button>
<button id="spacer-show-btn" class="topcoat-button--large hostFontSize" title="Set the opacity of all art with '.spacer' in its name to 1.0">Show .spacer</button>
<button id="layout-btn" class="topcoat-button--large hostFontSize" data-bind="disable: !isLayoutButtonVisible()" title="Manually trigger layout on the selected object">Relayout</button>
<label class="topcoat-checkbox hostFontSize" title="If unchecked, Bloks won't try to automatically fix layout when things change. You can use the Relayout button or CTRL/CMD + R 2x to manually layout">
<input type="checkbox" data-bind="checked: isAutoLayoutOn">
<div class="topcoat-checkbox__checkmark"></div>
Auto relayout
</label>

<!--<button id="reload-btn" class="topcoat-button--large hostFontSize">Reload</button>-->
</div>
Expand Down
3 changes: 2 additions & 1 deletion js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
this.isChildSettingsVisible = ko.observable(false);
this.isCreateButtonVisible = ko.observable(false);
this.isLayoutButtonVisible = ko.observable(false);
this.isAutoLayoutOn = ko.observable(true);

// Blok settings
this.flex = ko.observable(undefined).extend({ positiveNumeric: 0 });
Expand Down Expand Up @@ -257,7 +258,7 @@
BlokScripts.onSelectionChanged(function() {
BlokScripts.getActionsFromSelection(respondToActions);

if (!isUndo) {
if (!isUndo && viewModel.isAutoLayoutOn()) {
BlokScripts.checkSelectionForRelayout();
}

Expand Down

0 comments on commit de96d8e

Please sign in to comment.