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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1b0f6009289b4b15bf2638913755b83aee402503
4
- data.tar.gz: 1438b9d35fa7b9f44eb857cefea5f5389f25c634
3
+ metadata.gz: b3fd9b91f2d04b370528eb6fdb79b358e57cd9c1
4
+ data.tar.gz: 00e584ed67bdfaf1166c4e7832dd9028fb7e6351
5
5
  SHA512:
6
- metadata.gz: 6ae7fe4ca9e0cc70ab48239015d130d9809e6f2e43a60fcb7e20bf63967c2cc65200d1e1ac96ebf03edf77a205bbaa85f6fb765a267bac3165aa90dfe18a83d6
7
- data.tar.gz: 338119d0d295445b7b9cd1ca4ba0f7411fbb9de7e5e471e66874017499418f66d9038c45f83a02d181256c707c085e698f350c83ac737e90833aaf13ab61de44
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
 
@@ -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
@@ -153,6 +153,8 @@ module EverydayMenu
153
153
  @dynamicTitle.update if @dynamicTitle
154
154
  end
155
155
 
156
+ my_attr_accessor_bool :opt
157
+
156
158
  def runOnBuild
157
159
  onBuild.each { |block| block.call }
158
160
  end
@@ -1,3 +1,3 @@
1
1
  module EverydayMenu
2
- VERSION = '1.4.1'
2
+ VERSION = '1.4.2'
3
3
  end
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.1
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-01-30 00:00:00.000000000 Z
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.5
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: