everyday-menu 1.4.1 → 1.4.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/examples/basic_main_menu/main_menu.rb +1 -1
- data/lib/everyday-menu/menu.rb +9 -0
- data/lib/everyday-menu/menu_item.rb +2 -0
- data/lib/everyday-menu/version.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b3fd9b91f2d04b370528eb6fdb79b358e57cd9c1
|
4
|
+
data.tar.gz: 00e584ed67bdfaf1166c4e7832dd9028fb7e6351
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d01ae762b3ce59d08a1b59b043ad30b76fe412b8675fd54dd16c08643ecf3567103df7c0fd834b3172692a86902e5018e6e3035e4125f7d16ac923160af10012
|
7
|
+
data.tar.gz: e95a7594148f8dafb7d3ceb369bd1b3554a5dc455b59db403e3d16ed890816382fa82d2315a64a9ed15ffb2f0f2e4e0b2aedcad8ffc3af9b3856c70fd846c447
|
@@ -16,7 +16,7 @@ class MainMenu
|
|
16
16
|
menuItem :status_date, 'Date: ', dynamicTitle: -> { "Date: #{NSDate.date.to_s}" }
|
17
17
|
menuItem :status_open, 'Open', key_equivalent: 'o'
|
18
18
|
menuItem :status_new, 'New'
|
19
|
-
menuItem :status_close, 'Close', key_equivalent: 'w'
|
19
|
+
menuItem :status_close, 'Close', key_equivalent: 'w', opt: true
|
20
20
|
menuItem :status_quit, 'Quit', preset: :quit
|
21
21
|
end
|
22
22
|
|
data/lib/everyday-menu/menu.rb
CHANGED
@@ -20,6 +20,7 @@ module EverydayMenu
|
|
20
20
|
@label = label
|
21
21
|
@builder = block
|
22
22
|
@menu = NSMenu.alloc.init
|
23
|
+
@menu.delegate = self
|
23
24
|
@menuItems = MenuItemList.new(@menu)
|
24
25
|
@mainMenu = false
|
25
26
|
@statusMenu = false
|
@@ -32,6 +33,14 @@ module EverydayMenu
|
|
32
33
|
@statusItemLength = nil
|
33
34
|
end
|
34
35
|
|
36
|
+
def menuNeedsUpdate(menu)
|
37
|
+
flags = (NSEvent.modifierFlags & NSDeviceIndependentModifierFlagsMask)
|
38
|
+
shouldHideSecretMenu = !(flags == NSAlternateKeyMask)
|
39
|
+
@menuItems.each { |menuItem|
|
40
|
+
menuItem.item.setHidden(shouldHideSecretMenu) if menuItem.opt?
|
41
|
+
}
|
42
|
+
end
|
43
|
+
|
35
44
|
def menuItemFromMenu!
|
36
45
|
@mainMenuItem ||= MenuItem.create(self[:label], self[:title], submenu: self)
|
37
46
|
self
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: everyday-menu
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.4.
|
4
|
+
version: 1.4.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Eric Henderson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-11-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -89,7 +89,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
89
89
|
version: '0'
|
90
90
|
requirements: []
|
91
91
|
rubyforge_project:
|
92
|
-
rubygems_version: 2.4.
|
92
|
+
rubygems_version: 2.4.6
|
93
93
|
signing_key:
|
94
94
|
specification_version: 4
|
95
95
|
summary: A more ruby way to create OS X menus in RubyMotion
|
@@ -97,3 +97,4 @@ test_files:
|
|
97
97
|
- spec/menu_builder_spec.rb
|
98
98
|
- spec/menu_item_spec.rb
|
99
99
|
- spec/menu_spec.rb
|
100
|
+
has_rdoc:
|