Skip to content

Commit d99bd07

Browse files
committed
Checkbox on popover, update docs
1 parent 12776a0 commit d99bd07

3 files changed

Lines changed: 22 additions & 14 deletions

File tree

source/html/index.md

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,6 @@ This is where you define which glyphs will get the anchor that is currently sele
3131
### Settings
3232
This is where you can control the settings for the extension.
3333
![](../resources/ui-settings.png)
34-
#### Overwrite Anchors
35-
If you check this box, anchors of the same name in the same glyph will be overwritten when added to your font.
3634

3735
| Operation | Description |
3836
| --- | --- |
@@ -41,15 +39,27 @@ If you check this box, anchors of the same name in the same glyph will be overwr
4139
| **Reset Defaults** | This resets the anchor/glyph settings in the extension to how it looked when you first installed and opened it. |
4240

4341
### Clear Anchors...
44-
This is where you can bulk-remove anchors from your font(s). ![](../resources/ui-clear_anchors.png)
42+
This is where you can bulk-remove anchors from your font(s).
43+
44+
![](../resources/ui-clear_anchors-all.png)
45+
![](../resources/ui-clear_anchors-selected.png)
4546

4647
Choose whether you’d like to remove the anchors from the Current Font or All Fonts, and go through the list of anchor names and hit delete. Be advised: the removal will happen instantaneously! Again, Anchor Dropper attempts to remove "\_" anchors as well (so removing "top" will also remove "\_top").
4748

48-
#### Remove Duplicate Anchors
49-
This button will look at each glyph and make sure you don’t have two anchors of the same name present.
49+
#### Clear (Selected / All)
50+
If you have something selected in the table, this button will remove all anchors with the names selected.
51+
52+
If you *do not* have something selected in the table, this button will remove all anchors.
53+
54+
#### Clear (Selected / All) Duplicates
55+
If you have something selected in the table, this button will remove anchors that are duplicates, only among the names selected.
56+
57+
If you *do not* have something selected in the table, this button will remove anchors that are duplicates.
58+
59+
### Drop Anchors...
60+
This button will add the anchors to your font(s). Before clicking *Drop Anchors*, choose whether you’d like the add the anchors in question to your current font only or all open fonts. Also specify whether, when adding anchors, you’d like them to overwrite anchors of the same name in the same glyph.
5061

51-
### Drop Anchors
52-
This button will add the anchors to your Current Font.
62+
![](../resources/ui-drop_anchors.png)
5363

5464

5565
## Special Thanks

source/lib/main.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -248,11 +248,9 @@ def build(self):
248248

249249
# POPOVER
250250
content = """
251-
(Toggle Checkbox) @toggleAddButton
252-
253-
---
254-
255251
* TwoColumnForm @form
252+
> : Drop Anchor:
253+
> [X] @dropCheckbox
256254
> : Y Position:
257255
> ( ...) @posInput
258256
> : Y Adjustment:
@@ -415,6 +413,7 @@ def mainTableMenuCallback(self, sender):
415413
target_index = min([target_index, 7])
416414
# Predict correct y-pos
417415
sel_item = table.getSelectedItems()[0]
416+
self.w_over.getItem("dropCheckbox").set(sel_item['drop_anchor'])
418417
self.w_over.getItem("posInput").set(sel_item['y_pos'])
419418
self.w_over.getItem("adjustInput").set(int(sel_item['y_adjust']))
420419
table.openPopoverAtIndex(self.w_over, target_index)
@@ -466,15 +465,14 @@ def adjustInputCallback(self, sender):
466465
table.setSelectedIndexes(indexes)
467466
self.update_data()
468467

469-
def toggleAddButtonCallback(self, sender):
468+
def dropCheckboxCallback(self, sender):
470469
table = self.w.getItem("mainTable")
471470
indexes = table.getSelectedIndexes()
472471
if indexes:
473472
# Get current table data
474473
table_data = table.get()
475-
current_value = table_data[indexes[0]]["drop_anchor"]
476474
for i in indexes:
477-
table_data[i]["drop_anchor"] = not current_value
475+
table_data[i]["drop_anchor"] = sender.get()
478476
# Update table with new data
479477
table.set(table_data)
480478
table.reloadData(indexes)

source/resources/ui-main.png

-5.31 KB
Loading

0 commit comments

Comments
 (0)