menu-motion 0.1.6 → 0.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +39 -2
- data/lib/menu-motion/version.rb +1 -1
- metadata +2 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: cbbc7e3903f68ffc41850d88ad5654b97335a951
|
|
4
|
+
data.tar.gz: 2a28e7097e6a207e5ce9631bb011d4e74ff776ba
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c4e8d4258fc8ffe75053d1f6c7d4e642e64107924af02893fe1d8870512e0e48bfdc1bef2ed8128736505691bbfbcce617fc3d01aaef27e06492bb939295639c
|
|
7
|
+
data.tar.gz: eb1004cbc9602c841d15dffbae6649fe7e9a4d6878439a5d0e44293d1270de5c7b6f1615fcfe1913654514bf024525c5a936c09f936caae1979c7fe30321bc6c
|
data/README.md
CHANGED
|
@@ -33,7 +33,7 @@ Here's an awesome graphic of a menu:
|
|
|
33
33
|
|‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾|
|
|
34
34
|
| [icon] First Item > |‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾|
|
|
35
35
|
|---------------------| First Subitem > |‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾|
|
|
36
|
-
| About MenuMotion
|
|
36
|
+
| ۞ About MenuMotion |-----------------| First Action |
|
|
37
37
|
| Quit | Some Action | ✓ Second Action |
|
|
38
38
|
|_____________________|_________________|_________________|
|
|
39
39
|
```
|
|
@@ -72,7 +72,8 @@ menu = MenuMotion::Menu.new({
|
|
|
72
72
|
}, {
|
|
73
73
|
rows: [{
|
|
74
74
|
title: "About MenuMotion",
|
|
75
|
-
action: "orderFrontStandardAboutPanel:"
|
|
75
|
+
action: "orderFrontStandardAboutPanel:",
|
|
76
|
+
image: "gear"
|
|
76
77
|
}, {
|
|
77
78
|
title: "Quit",
|
|
78
79
|
action: "terminate:"
|
|
@@ -191,6 +192,42 @@ menu = MenuMotion::Menu.new({
|
|
|
191
192
|
})
|
|
192
193
|
```
|
|
193
194
|
|
|
195
|
+
### Images
|
|
196
|
+
|
|
197
|
+
You can assign an image to a menu item with the `image` option. This option can be sent as a `String` or an `NSImage`.
|
|
198
|
+
|
|
199
|
+
```ruby
|
|
200
|
+
menu = MenuMotion::Menu.new({
|
|
201
|
+
rows: [{
|
|
202
|
+
title: "Menu item",
|
|
203
|
+
tag: :main_item,
|
|
204
|
+
image: 'main_item_image' # the file extension is optional
|
|
205
|
+
# or:
|
|
206
|
+
# image: NSImage.imageNamed('main_item_image')
|
|
207
|
+
}]
|
|
208
|
+
})
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
### Custom Views
|
|
212
|
+
|
|
213
|
+
Menu items can have custom views applied to them with the `view` option. In order for the view to be interactable, you need to set a `target` and `action` on the menu item _even if_ the custom view handles clicks for you.
|
|
214
|
+
|
|
215
|
+
```ruby
|
|
216
|
+
menu = MenuMotion::Menu.new({
|
|
217
|
+
rows: [{
|
|
218
|
+
title: "Menu item",
|
|
219
|
+
tag: :main_item,
|
|
220
|
+
view: MyNSViewSubclass.new,
|
|
221
|
+
target: self,
|
|
222
|
+
action: :blank_action
|
|
223
|
+
}]
|
|
224
|
+
})
|
|
225
|
+
|
|
226
|
+
def blank_action
|
|
227
|
+
# Nothing to see here, move along please.
|
|
228
|
+
end
|
|
229
|
+
```
|
|
230
|
+
|
|
194
231
|
### Updating Menu Items
|
|
195
232
|
|
|
196
233
|
Assign tags to menu items that will need to be updated.
|
data/lib/menu-motion/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: menu-motion
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.7
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Brian Pattison
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2014-
|
|
11
|
+
date: 2014-10-27 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rake
|
|
@@ -62,4 +62,3 @@ signing_key:
|
|
|
62
62
|
specification_version: 4
|
|
63
63
|
summary: A RubyMotion wrapper for creating OS X status bar menus
|
|
64
64
|
test_files: []
|
|
65
|
-
has_rdoc:
|