glimmer-dsl-tk 0.0.52 → 0.0.53

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
  SHA256:
3
- metadata.gz: bb2ccf0557cc7810f711f841873b281e3ffe57e67355e61825feedc287769102
4
- data.tar.gz: 16e760a663bb0982542089d46c5ca3d959d354bb566929367cf2bde7909f29cc
3
+ metadata.gz: 4bc998830956c028c331da19e9238e69fe15198a0c2741af217cd15cae8fceb8
4
+ data.tar.gz: '040971d080dae49ebcb201631802566bcb415ddcd72ca623d6cca350c4587058'
5
5
  SHA512:
6
- metadata.gz: 7906ab4bdc15f6a9c6cbe184f70ae9929adec99879091789395a9386d7e7a6572fc5b65d83c492514bdff332c29cc6cd192ac6b1d5f562e52aa15157db2a3f34
7
- data.tar.gz: 84ea229d1961c7385b6aac6dcea591fea7db0731e99a6e5d65bcae114eed2b1218cb0665cf8762d2abad0560c1510feb347ac7eecde8a69612ce22fc98eede82
6
+ metadata.gz: a573287857c8f89fb58226dc6c8f1c1629f5a7f7c2dac59952e3459738ba582b89539cc1365a8ebe0134d0c132e62757677fb438480a20b93f25c346846b20f8
7
+ data.tar.gz: 404e13705e7354d5e0bb2ae15993c7b17d09e77cb7161e111ab5dc908bbe18523501dffc041ff7ce69a71fb70db8d1cca8ef306fbab26f9d07faa2e5933eca53
data/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # Change Log
2
2
 
3
+ ## 0.0.53
4
+
5
+ - Support menu item accelerators that include or end with function keys (e.g. `'Alt+F4'`)
6
+ - Default `:about` Menu Item label to 'About' if not specified
7
+
3
8
  ## 0.0.52
4
9
 
5
10
  - Upgrade to glimmer 2.6.0
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # [<img src="https://raw.githubusercontent.com/AndyObtiva/glimmer/master/images/glimmer-logo-hi-res.png" height=85 />](https://github.com/AndyObtiva/glimmer) Glimmer DSL for Tk 0.0.52
1
+ # [<img src="https://raw.githubusercontent.com/AndyObtiva/glimmer/master/images/glimmer-logo-hi-res.png" height=85 />](https://github.com/AndyObtiva/glimmer) Glimmer DSL for Tk 0.0.53
2
2
  ## MRI Ruby Desktop Development GUI Library
3
3
  [![Gem Version](https://badge.fury.io/rb/glimmer-dsl-tk.svg)](http://badge.fury.io/rb/glimmer-dsl-tk)
4
4
  [![Ruby](https://github.com/AndyObtiva/glimmer-dsl-tk/actions/workflows/ruby.yml/badge.svg)](https://github.com/AndyObtiva/glimmer-dsl-tk/actions/workflows/ruby.yml)
@@ -186,7 +186,7 @@ gem install glimmer-dsl-tk
186
186
 
187
187
  Add the following to `Gemfile`:
188
188
  ```
189
- gem 'glimmer-dsl-tk', '0.0.52'
189
+ gem 'glimmer-dsl-tk', '0.0.53'
190
190
  ```
191
191
 
192
192
  And, then run:
@@ -3763,6 +3763,7 @@ https://gitlab.com/fjc/circule
3763
3763
  ## Resources
3764
3764
 
3765
3765
  - [Tk Tutorial](https://tkdocs.com/tutorial/index.html)
3766
+ - [Official Tk Command Reference](https://tcl.tk/man/tcl8.6/TkCmd/contents.htm)
3766
3767
  - [Code Master Blog](https://andymaleh.blogspot.com/search/label/Tk)
3767
3768
 
3768
3769
  ## Help
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.52
1
+ 0.0.53
Binary file
@@ -43,6 +43,7 @@ module Glimmer
43
43
  def initialize(underscored_widget_name, parent_proxy, args, &block)
44
44
  @options = args.last.is_a?(Hash) ? args.last : {}
45
45
  @label = @options[:label]
46
+ @label ||= 'About' if args.first == :about
46
47
  super
47
48
  end
48
49
 
@@ -61,10 +62,17 @@ module Glimmer
61
62
  def accelerator_event
62
63
  accelerator_parts = @accelerator.split('+')
63
64
  accelerator_parts.map do |accelerator_part|
64
- ACCELERATOR_MODIFIER_EVENT_MAP[accelerator_part.capitalize] || accelerator_part.downcase
65
+ ACCELERATOR_MODIFIER_EVENT_MAP[accelerator_part.capitalize] ||
66
+ (accelerator_part.size == 1 && accelerator_part.downcase) ||
67
+ (function_key?(accelerator_part) && accelerator_part.upcase) ||
68
+ accelerator_part
65
69
  end.join('-')
66
70
  end
67
71
 
72
+ def function_key?(string)
73
+ string.downcase.match(/^f\d+$/)
74
+ end
75
+
68
76
  def label=(value)
69
77
  @last_label = @label
70
78
  @label = value
@@ -41,7 +41,8 @@ root { |r|
41
41
  # Mac-specific application menu (right next to the Apple menu)
42
42
  if OS.mac?
43
43
  menu(:application) {
44
- menu_item(:about, label: 'About My Application') {
44
+ # menu_item(:about, label: 'About My Application') {
45
+ menu_item(:about) {
45
46
  accelerator 'Command+A'
46
47
 
47
48
  on('command') do
@@ -99,6 +100,8 @@ root { |r|
99
100
  menu_item(:separator)
100
101
 
101
102
  menu_item(label: 'Exit', underline: 1) {
103
+ accelerator 'Alt+F4'
104
+
102
105
  on('command') do
103
106
  exit(0)
104
107
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: glimmer-dsl-tk
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.52
4
+ version: 0.0.53
5
5
  platform: ruby
6
6
  authors:
7
7
  - AndyMaleh