menu-motion 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e2483be76e3b6d3139b31d37f2e1ff69d766de62
|
4
|
+
data.tar.gz: b6d6634c821c24df95404002c75f240ef53147fd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 31e35a13070f39b361541fdacf6aecb2826dc259c09342c26d60364661a323f3573a41f6be28712b0652d6bec334fe7df9d1cc8bdb5c5b84ece7eeccfe22b94a
|
7
|
+
data.tar.gz: 1a420cb8996f49681f4a2e6f48e5879207d3ae18a82402b8ae4da98a54392b090744e017f1e38747e84fb121e13b1f425a9bde8b0b564c49b395101c41cb01cb
|
data/README.md
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
[![Build Status](https://travis-ci.org/codelation/menu-motion.svg)](https://travis-ci.org/codelation/menu-motion)
|
4
4
|
[![Code Climate](https://codeclimate.com/github/codelation/menu-motion.png)](https://codeclimate.com/github/codelation/menu-motion)
|
5
5
|
|
6
|
-
MenuMotion is a [RubyMotion](http://www.rubymotion.com) wrapper inspired by [Formotion](https://github.com/clayallsopp/formotion) for creating OS X
|
6
|
+
MenuMotion is a [RubyMotion](http://www.rubymotion.com) wrapper inspired by [Formotion](https://github.com/clayallsopp/formotion) for creating OS X menus with a syntax that should feel familiar if you've used Formotion.
|
7
7
|
|
8
8
|
## Installation
|
9
9
|
|
@@ -114,7 +114,7 @@ menu = MenuMotion::Menu.new({
|
|
114
114
|
### Actions
|
115
115
|
|
116
116
|
Adding an action to a menu item is easy. Just define the
|
117
|
-
target and action.
|
117
|
+
target and action parameters.
|
118
118
|
|
119
119
|
```ruby
|
120
120
|
menu = MenuMotion::Menu.new({
|
@@ -140,8 +140,10 @@ end
|
|
140
140
|
|
141
141
|
### Keyboard Shortcuts
|
142
142
|
|
143
|
-
Keyboard shortcuts can be assigned to menu items with a simple string
|
144
|
-
|
143
|
+
Keyboard shortcuts can be assigned to menu items with a simple string
|
144
|
+
assigned to the `:shortcut` parameter.
|
145
|
+
The string can include multiple modifier keys, followed by the final
|
146
|
+
key to be assigned (`{modifier+}{modifier+}{key}`):
|
145
147
|
|
146
148
|
```ruby
|
147
149
|
menu = MenuMotion::Menu.new({
|
@@ -164,7 +166,10 @@ menu = MenuMotion::Menu.new({
|
|
164
166
|
|
165
167
|
### Validation
|
166
168
|
|
167
|
-
MenuMotion implements the [NSMenuValidation](https://developer.apple.com/library/mac/documentation/cocoa/reference/applicationkit/Protocols/NSMenuValidation_Protocol/Reference/Reference.html)
|
169
|
+
MenuMotion implements the [NSMenuValidation](https://developer.apple.com/library/mac/documentation/cocoa/reference/applicationkit/Protocols/NSMenuValidation_Protocol/Reference/Reference.html)
|
170
|
+
protocol for determining whether a menu item should be enabled or not.
|
171
|
+
Simply pass a `Proc` to the `:validate` parameter that returns `true` if the
|
172
|
+
menu item should be enabled or `false` if the menu item should be disabled:
|
168
173
|
|
169
174
|
```ruby
|
170
175
|
menu = MenuMotion::Menu.new({
|
@@ -226,7 +231,6 @@ menu.update_item_with_tag(:submenu_item1, {
|
|
226
231
|
## TODO
|
227
232
|
|
228
233
|
- Menu Item Icons
|
229
|
-
- Keyboard Shortcuts
|
230
234
|
|
231
235
|
## Contributing
|
232
236
|
|
File without changes
|
File without changes
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
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.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brian Pattison
|
@@ -33,10 +33,10 @@ extensions: []
|
|
33
33
|
extra_rdoc_files: []
|
34
34
|
files:
|
35
35
|
- README.md
|
36
|
-
- lib/
|
37
|
-
- lib/
|
38
|
-
- lib/
|
39
|
-
- lib/
|
36
|
+
- lib/menu-motion.rb
|
37
|
+
- lib/menu-motion/menu.rb
|
38
|
+
- lib/menu-motion/menu_item.rb
|
39
|
+
- lib/menu-motion/version.rb
|
40
40
|
homepage: https://github.com/codelation/menu-motion
|
41
41
|
licenses:
|
42
42
|
- MIT
|