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.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +39 -2
  3. data/lib/menu-motion/version.rb +1 -1
  4. metadata +2 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 81a470e891e3ef0dc469a6184e66a3fc9261a6a0
4
- data.tar.gz: 47c198b68132494dc529a7a7bcb622825bc4caf3
3
+ metadata.gz: cbbc7e3903f68ffc41850d88ad5654b97335a951
4
+ data.tar.gz: 2a28e7097e6a207e5ce9631bb011d4e74ff776ba
5
5
  SHA512:
6
- metadata.gz: 376ab57eac16f013695eb5fde29f28281ee6d6f73e5378ac32401be718f7313d2b13801fb5039d9fcbbae0109a702e033ecb42acba33e73b826193ca3ce68fd5
7
- data.tar.gz: abbef473c9bd1ce0a81dfaa90ee98e20cce65abea2aac33c11c22f9e803f25ccb86a537f7e2cfd46efa9254552b61a3cb19e850f6c36d591b6244c2ecbd0b06c
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 |-----------------| First Action |
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.
@@ -1,3 +1,3 @@
1
1
  module MenuMotion
2
- VERSION = "0.1.6"
2
+ VERSION = "0.1.7"
3
3
  end
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.6
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-07-23 00:00:00.000000000 Z
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: