glimmer-dsl-swt 4.17.6.0 → 4.17.8.3

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 (47) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +34 -2
  3. data/README.md +211 -82
  4. data/VERSION +1 -1
  5. data/glimmer-dsl-swt.gemspec +14 -3
  6. data/lib/glimmer/data_binding/tree_items_binding.rb +20 -2
  7. data/lib/glimmer/dsl/swt/checkbox_group_selection_data_binding_expression.rb +61 -0
  8. data/lib/glimmer/dsl/swt/custom_widget_expression.rb +1 -0
  9. data/lib/glimmer/dsl/swt/dialog_expression.rb +1 -0
  10. data/lib/glimmer/dsl/swt/directory_dialog_expression.rb +48 -0
  11. data/lib/glimmer/dsl/swt/dsl.rb +1 -0
  12. data/lib/glimmer/dsl/swt/file_dialog_expression.rb +48 -0
  13. data/lib/glimmer/dsl/swt/radio_group_selection_data_binding_expression.rb +3 -3
  14. data/lib/glimmer/dsl/swt/shell_expression.rb +3 -3
  15. data/lib/glimmer/dsl/swt/widget_expression.rb +8 -8
  16. data/lib/glimmer/swt/custom/checkbox_group.rb +181 -0
  17. data/lib/glimmer/swt/custom/code_text.rb +43 -33
  18. data/lib/glimmer/swt/custom/radio_group.rb +94 -19
  19. data/lib/glimmer/swt/directory_dialog_proxy.rb +65 -0
  20. data/lib/glimmer/swt/expand_item_proxy.rb +0 -1
  21. data/lib/glimmer/swt/file_dialog_proxy.rb +66 -0
  22. data/lib/glimmer/swt/menu_proxy.rb +3 -3
  23. data/lib/glimmer/swt/shell_proxy.rb +5 -5
  24. data/lib/glimmer/swt/tab_item_proxy.rb +3 -3
  25. data/lib/glimmer/swt/table_proxy.rb +25 -25
  26. data/lib/glimmer/swt/widget_listener_proxy.rb +4 -4
  27. data/lib/glimmer/swt/widget_proxy.rb +27 -27
  28. data/lib/glimmer/ui/custom_shell.rb +3 -3
  29. data/samples/elaborate/contact_manager.rb +3 -3
  30. data/samples/elaborate/meta_sample.rb +24 -19
  31. data/samples/hello/hello_browser.rb +3 -3
  32. data/samples/hello/hello_checkbox.rb +18 -18
  33. data/samples/hello/hello_checkbox_group.rb +68 -0
  34. data/samples/hello/hello_combo.rb +12 -12
  35. data/samples/hello/hello_directory_dialog.rb +60 -0
  36. data/samples/hello/hello_expand_bar.rb +3 -1
  37. data/samples/hello/hello_file_dialog.rb +60 -0
  38. data/samples/hello/hello_group.rb +104 -0
  39. data/samples/hello/hello_list_multi_selection.rb +23 -23
  40. data/samples/hello/hello_list_single_selection.rb +18 -17
  41. data/samples/hello/hello_menu_bar.rb +3 -3
  42. data/samples/hello/hello_pop_up_context_menu.rb +3 -3
  43. data/samples/hello/hello_radio.rb +20 -20
  44. data/samples/hello/hello_radio_group.rb +25 -25
  45. data/samples/hello/hello_table.rb +130 -0
  46. data/samples/hello/hello_world.rb +3 -3
  47. metadata +13 -2
@@ -8,20 +8,20 @@ module Glimmer
8
8
  include Glimmer::UI::CustomWidget
9
9
 
10
10
  SYNTAX_COLOR_MAP = {
11
- Builtin: [215,58,73],
12
- Class: [3,47,98],
13
- Constant: [0,92,197],
11
+ Builtin: [215,58,73],
12
+ Class: [3,47,98],
13
+ Constant: [0,92,197],
14
14
  Double: [0,92,197],
15
15
  Escape: [:red],
16
- Function: [:blue],
17
- Instance: [227,98,9],
18
- Integer: [:blue],
16
+ Function: [:blue],
17
+ Instance: [227,98,9],
18
+ Integer: [:blue],
19
19
  Interpol: [:blue],
20
- Keyword: [:blue],
20
+ Keyword: [:blue],
21
21
  Name: [111,66,193], #purple
22
- Operator: [:red],
22
+ Operator: [:red],
23
23
  Pseudo: [:dark_red],
24
- Punctuation: [:blue],
24
+ Punctuation: [:blue],
25
25
  Single: [106,115,125], # Also, Comments
26
26
  Symbol: [:dark_green],
27
27
  Text: [75, 75, 75],
@@ -38,29 +38,25 @@ module Glimmer
38
38
  swt_widget&.text
39
39
  end
40
40
 
41
- def syntax_highlighting
41
+ def syntax_highlighting(text)
42
42
  return [] if text.to_s.strip.empty?
43
- code = text
44
- return @syntax_highlighting if @last_code == code
45
- @last_code = code
46
- @lexer ||= Rouge::Lexer.find_fancy('ruby', code)
47
- lex = @lexer.lex(code).to_a
48
- code_size = 0
49
- lex_hashes = lex.map do |pair|
50
- {token_type: pair.first, token_text: pair.last}
51
- end.each do |hash|
52
- hash[:token_index] = code_size
53
- code_size += hash[:token_text].size
43
+ @syntax_highlighting ||= {}
44
+ unless @syntax_highlighting.keys.include?(text)
45
+ lex = lexer.lex(text).to_a
46
+ text_size = 0
47
+ @syntax_highlighting[text] = lex.map do |pair|
48
+ {token_type: pair.first, token_text: pair.last}
49
+ end.each do |hash|
50
+ hash[:token_index] = text_size
51
+ text_size += hash[:token_text].size
52
+ end
54
53
  end
55
- code_lines = code.split("\n")
56
- line_index = 0
57
- @syntax_highlighting = code_lines_map = code_lines.reduce({}) do |hash, line|
58
- line_hashes = []
59
- line_hashes << lex_hashes.shift while lex_hashes.any? && lex_hashes.first[:token_index].between?(line_index, line_index + line.size)
60
- hash.merge(line_index => line_hashes).tap do
61
- line_index += line.size + 1
62
- end
63
- end
54
+ @syntax_highlighting[text]
55
+ end
56
+
57
+ def lexer
58
+ # TODO Try to use Rouge::Lexer.find_fancy('guess', code) in the future to guess the language or otherwise detect it from file extension
59
+ @lexer ||= Rouge::Lexer.find_fancy('ruby')
64
60
  end
65
61
 
66
62
  before_body {
@@ -75,18 +71,32 @@ module Glimmer
75
71
  top_margin 5
76
72
  right_margin 5
77
73
  bottom_margin 5
74
+
75
+ on_modify_text { |event|
76
+ # clear unnecessary syntax highlighting cache on text updates, and do it async to avoid affecting performance
77
+ new_text = event.data
78
+ async_exec {
79
+ unless @syntax_highlighting.nil?
80
+ lines = new_text.to_s.split("\n")
81
+ line_diff = @syntax_highlighting.keys - lines
82
+ line_diff.each do |line|
83
+ @syntax_highlighting.delete(line)
84
+ end
85
+ end
86
+ }
87
+ }
78
88
 
79
89
  on_line_get_style { |line_style_event|
80
90
  styles = []
81
- syntax_highlighting[line_style_event.lineOffset].to_a.each do |token_hash|
91
+ syntax_highlighting(line_style_event.lineText).to_a.each do |token_hash|
82
92
  start_index = token_hash[:token_index]
83
93
  size = token_hash[:token_text].size
84
94
  token_color = SYNTAX_COLOR_MAP[token_hash[:token_type].name] || [:black]
85
95
  token_color = color(*token_color).swt_color
86
- styles << StyleRange.new(start_index, size, token_color, nil)
96
+ styles << StyleRange.new(line_style_event.lineOffset + start_index, size, token_color, nil)
87
97
  end
88
98
  line_style_event.styles = styles.to_java(StyleRange) unless styles.empty?
89
- }
99
+ }
90
100
  }
91
101
  }
92
102
  end
@@ -1,14 +1,33 @@
1
+ # Copyright (c) 2007-2020 Andy Maleh
2
+ #
3
+ # Permission is hereby granted, free of charge, to any person obtaining
4
+ # a copy of this software and associated documentation files (the
5
+ # "Software"), to deal in the Software without restriction, including
6
+ # without limitation the rights to use, copy, modify, merge, publish,
7
+ # distribute, sublicense, and/or sell copies of the Software, and to
8
+ # permit persons to whom the Software is furnished to do so, subject to
9
+ # the following conditions:
10
+ #
11
+ # The above copyright notice and this permission notice shall be
12
+ # included in all copies or substantial portions of the Software.
13
+ #
14
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21
+
1
22
  require 'glimmer/ui/custom_widget'
2
23
 
3
24
  module Glimmer
4
25
  module SWT
5
26
  module Custom
6
- # CodeText is a customization of StyledText with support for Ruby Syntax Highlighting
27
+ # A custom widget rendering a group of radios generated via data-binding
7
28
  class RadioGroup
8
29
  include Glimmer::UI::CustomWidget
9
30
 
10
- # TODO support setting font, background, foreground, cursor
11
-
12
31
  body {
13
32
  composite # just an empty composite to hold radios upon data-binding `selection`
14
33
  }
@@ -20,18 +39,20 @@ module Glimmer
20
39
  end
21
40
 
22
41
  def items
23
- @items
42
+ @items || []
24
43
  end
25
44
 
26
45
  def selection=(text)
27
- radios.each do |radio|
28
- radio.selection = radio.text == text
46
+ radios.count.times do |index|
47
+ radio = radios[index]
48
+ item = items[index]
49
+ radio.selection = item == text
29
50
  end
30
51
  end
31
52
 
32
53
  def selection
33
- # TODO use labels to retrieve text since they are better customizable with fonts while maintaining alignment with radio buttons
34
- radios.detect(&:selection)&.text.to_s
54
+ selection_value = labels[selection_index]&.text unless selection_index == -1
55
+ selection_value.to_s
35
56
  end
36
57
 
37
58
  def selection_index=(index)
@@ -47,6 +68,10 @@ module Glimmer
47
68
  @radios ||= []
48
69
  end
49
70
 
71
+ def labels
72
+ @labels ||= []
73
+ end
74
+
50
75
  def can_handle_observation_request?(observation_request)
51
76
  radios.first&.can_handle_observation_request?(observation_request) || super(observation_request)
52
77
  end
@@ -58,15 +83,31 @@ module Glimmer
58
83
  end
59
84
 
60
85
  def delegate_observation_request_to_radios(observation_request, &block)
61
- if observation_request != 'on_widget_disposed' && radios.first&.can_handle_observation_request?(observation_request)
62
- radios.each do |radio|
63
- radio_block = lambda do |event|
64
- if event.widget.selection || selection_index == -1
86
+ if observation_request != 'on_widget_disposed'
87
+ radios.count.times do |index|
88
+ radio = radios[index]
89
+ label = labels[index]
90
+ if observation_request == 'on_widget_selected'
91
+ radio_block = lambda do |event|
92
+ if event.widget.selection || selection_index == -1
93
+ event.widget = self.swt_widget
94
+ block.call(event)
95
+ end
96
+ end
97
+ label_block = lambda do |event|
98
+ self.selection_index = index
99
+ block.call(event)
100
+ end
101
+ radio.handle_observation_request(observation_request, &radio_block) if radio.can_handle_observation_request?(observation_request)
102
+ label.handle_observation_request('on_mouse_up', &label_block)
103
+ else
104
+ listener_block = lambda do |event|
65
105
  event.widget = self.swt_widget
66
106
  block.call(event)
67
107
  end
108
+ radio.handle_observation_request(observation_request, &listener_block) if radio.can_handle_observation_request?(observation_request)
109
+ label.handle_observation_request(observation_request, &listener_block) if label.can_handle_observation_request?(observation_request)
68
110
  end
69
- radio.handle_observation_request(observation_request, &block)
70
111
  end
71
112
  end
72
113
  end
@@ -75,23 +116,57 @@ module Glimmer
75
116
  @observation_requests ||= Set.new
76
117
  end
77
118
 
119
+ def has_attribute?(attribute_name, *args)
120
+ (@composites.to_a + @radios.to_a + @labels.to_a).map do |widget_proxy|
121
+ return true if widget_proxy.has_attribute?(attribute_name, *args)
122
+ end
123
+ super
124
+ end
125
+
126
+ def set_attribute(attribute_name, *args)
127
+ excluded_attributes = ['selection']
128
+ unless excluded_attributes.include?(attribute_name.to_s)
129
+ (@composites.to_a + @radios.to_a + @labels.to_a).each do |widget_proxy|
130
+ widget_proxy.set_attribute(attribute_name, *args) if widget_proxy.has_attribute?(attribute_name, *args)
131
+ end
132
+ end
133
+ super
134
+ end
135
+
78
136
  private
79
137
 
80
138
  def build_radios
81
- # TODO consider doing a diff instead of disposing and rebuilding everything in the future
82
- # TODO add labels since they are better customizable with fonts while maintaining alignment with radio buttons
83
139
  current_selection = selection
84
- radios.each(&:dispose) # TODO take care of the fact that dispose removes the observers attached
140
+ @composites.to_a.each(&:dispose)
85
141
  @radios = []
142
+ @labels = []
143
+ @composites = []
86
144
  items.each do |item|
87
145
  body_root.content {
88
- radios << radio {
89
- text item
146
+ @composites << composite {
147
+ grid_layout(2, false) {
148
+ margin_width 0
149
+ margin_height 0
150
+ horizontal_spacing 0
151
+ vertical_spacing 0
152
+ }
153
+ radios << radio { |radio_proxy|
154
+ on_widget_selected {
155
+ self.selection = items[radios.index(radio_proxy)]
156
+ }
157
+ }
158
+ labels << label { |label_proxy|
159
+ layout_data :fill, :center, true, false
160
+ text item
161
+ on_mouse_up {
162
+ self.selection = label_proxy.text
163
+ }
164
+ }
90
165
  }
91
166
  }
92
167
  end
93
168
  observation_requests.to_a.each do |observation_request, block|
94
- delegate_observation_request_to_radios(observation_request, &block)
169
+ delegate_observation_request_to_radios(observation_request, &block)
95
170
  end
96
171
  self.selection = current_selection
97
172
  end
@@ -0,0 +1,65 @@
1
+ # Copyright (c) 2007-2020 Andy Maleh
2
+ #
3
+ # Permission is hereby granted, free of charge, to any person obtaining
4
+ # a copy of this software and associated documentation files (the
5
+ # "Software"), to deal in the Software without restriction, including
6
+ # without limitation the rights to use, copy, modify, merge, publish,
7
+ # distribute, sublicense, and/or sell copies of the Software, and to
8
+ # permit persons to whom the Software is furnished to do so, subject to
9
+ # the following conditions:
10
+ #
11
+ # The above copyright notice and this permission notice shall be
12
+ # included in all copies or substantial portions of the Software.
13
+ #
14
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21
+
22
+ require 'glimmer/swt/swt_proxy'
23
+ require 'glimmer/swt/widget_proxy'
24
+ require 'glimmer/swt/display_proxy'
25
+
26
+ module Glimmer
27
+ module SWT
28
+ # Proxy for org.eclipse.swt.widgets.DirectoryDialog
29
+ #
30
+ # Automatically uses the current shell if one is open.
31
+ # Otherwise, it instantiates a new shell parent
32
+ #
33
+ # Optionally takes a shell as an argument
34
+ #
35
+ # Follows the Proxy Design Pattern
36
+ class DirectoryDialogProxy < WidgetProxy
37
+ # TODO write rspec tests
38
+ include_package 'org.eclipse.swt.widgets'
39
+
40
+ def initialize(*args, swt_widget: nil)
41
+ if swt_widget
42
+ @swt_widget = swt_widget
43
+ else
44
+ style_args = args.select {|arg| arg.is_a?(Symbol) || arg.is_a?(String)}
45
+ if style_args.any?
46
+ style_arg_start_index = args.index(style_args.first)
47
+ style_arg_last_index = args.index(style_args.last)
48
+ args[style_arg_start_index..style_arg_last_index] = SWTProxy[style_args]
49
+ end
50
+ if !args.first.is_a?(Shell)
51
+ current_shell = DisplayProxy.instance.swt_display.shells.first
52
+ args.unshift(current_shell.nil? ? ShellProxy.new : current_shell)
53
+ end
54
+ if args.first.is_a?(ShellProxy)
55
+ args[0] = args[0].swt_widget
56
+ end
57
+ parent = args[0]
58
+ @parent_proxy = parent.is_a?(Shell) ? ShellProxy.new(swt_widget: parent) : parent
59
+ @swt_widget = DirectoryDialog.new(*args)
60
+ end
61
+ end
62
+
63
+ end
64
+ end
65
+ end
@@ -61,7 +61,6 @@ module Glimmer
61
61
 
62
62
  def post_add_content
63
63
  @swt_expand_item.setHeight(swt_widget.computeSize(SWTProxy[:default], SWTProxy[:default]).y) unless @swt_expand_item.getHeight > 0
64
- WidgetProxy.new('composite', self, []) # adding filler since it seems like the last child gets a bad style, so this gets it instead
65
64
  end
66
65
 
67
66
  def has_attribute?(attribute_name, *args)
@@ -0,0 +1,66 @@
1
+ # Copyright (c) 2007-2020 Andy Maleh
2
+ #
3
+ # Permission is hereby granted, free of charge, to any person obtaining
4
+ # a copy of this software and associated documentation files (the
5
+ # "Software"), to deal in the Software without restriction, including
6
+ # without limitation the rights to use, copy, modify, merge, publish,
7
+ # distribute, sublicense, and/or sell copies of the Software, and to
8
+ # permit persons to whom the Software is furnished to do so, subject to
9
+ # the following conditions:
10
+ #
11
+ # The above copyright notice and this permission notice shall be
12
+ # included in all copies or substantial portions of the Software.
13
+ #
14
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21
+
22
+ require 'glimmer/swt/swt_proxy'
23
+ require 'glimmer/swt/widget_proxy'
24
+ require 'glimmer/swt/display_proxy'
25
+
26
+ module Glimmer
27
+ module SWT
28
+ # Proxy for org.eclipse.swt.widgets.FileDialog
29
+ #
30
+ # Automatically uses the current shell if one is open.
31
+ # Otherwise, it instantiates a new shell parent
32
+ #
33
+ # Optionally takes a shell as an argument
34
+ #
35
+ # Follows the Proxy Design Pattern
36
+ class FileDialogProxy < WidgetProxy
37
+ # TODO write rspec tests
38
+ # TODO consider refactoring and sharing code with DirectoryDialogProxy (and do the same with their expressions)
39
+ include_package 'org.eclipse.swt.widgets'
40
+
41
+ def initialize(*args, swt_widget: nil)
42
+ if swt_widget
43
+ @swt_widget = swt_widget
44
+ else
45
+ style_args = args.select {|arg| arg.is_a?(Symbol) || arg.is_a?(String)}
46
+ if style_args.any?
47
+ style_arg_start_index = args.index(style_args.first)
48
+ style_arg_last_index = args.index(style_args.last)
49
+ args[style_arg_start_index..style_arg_last_index] = SWTProxy[style_args]
50
+ end
51
+ if !args.first.is_a?(Shell)
52
+ current_shell = DisplayProxy.instance.swt_display.shells.first
53
+ args.unshift(current_shell.nil? ? ShellProxy.new : current_shell)
54
+ end
55
+ if args.first.is_a?(ShellProxy)
56
+ args[0] = args[0].swt_widget
57
+ end
58
+ parent = args[0]
59
+ @parent_proxy = parent.is_a?(Shell) ? ShellProxy.new(swt_widget: parent) : parent
60
+ @swt_widget = FileDialog.new(*args)
61
+ end
62
+ end
63
+
64
+ end
65
+ end
66
+ end
@@ -1,5 +1,5 @@
1
1
  # Copyright (c) 2007-2020 Andy Maleh
2
- #
2
+ #
3
3
  # Permission is hereby granted, free of charge, to any person obtaining
4
4
  # a copy of this software and associated documentation files (the
5
5
  # "Software"), to deal in the Software without restriction, including
@@ -7,10 +7,10 @@
7
7
  # distribute, sublicense, and/or sell copies of the Software, and to
8
8
  # permit persons to whom the Software is furnished to do so, subject to
9
9
  # the following conditions:
10
- #
10
+ #
11
11
  # The above copyright notice and this permission notice shall be
12
12
  # included in all copies or substantial portions of the Software.
13
- #
13
+ #
14
14
  # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
15
  # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
16
  # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
@@ -1,5 +1,5 @@
1
1
  # Copyright (c) 2007-2020 Andy Maleh
2
- #
2
+ #
3
3
  # Permission is hereby granted, free of charge, to any person obtaining
4
4
  # a copy of this software and associated documentation files (the
5
5
  # "Software"), to deal in the Software without restriction, including
@@ -7,10 +7,10 @@
7
7
  # distribute, sublicense, and/or sell copies of the Software, and to
8
8
  # permit persons to whom the Software is furnished to do so, subject to
9
9
  # the following conditions:
10
- #
10
+ #
11
11
  # The above copyright notice and this permission notice shall be
12
12
  # included in all copies or substantial portions of the Software.
13
- #
13
+ #
14
14
  # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
15
  # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
16
  # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
@@ -65,7 +65,7 @@ module Glimmer
65
65
  @swt_widget.setMinimumSize(WIDTH_MIN, HEIGHT_MIN)
66
66
  # TODO make this an option not the default
67
67
  on_swt_show do
68
- Thread.new do
68
+ Thread.new do
69
69
  sleep(0.25)
70
70
  async_exec do
71
71
  @swt_widget.setActive unless @swt_widget.isDisposed
@@ -130,7 +130,7 @@ module Glimmer
130
130
  @swt_widget.pack
131
131
  @swt_widget.removeControlListener(listener.swt_listener)
132
132
  @swt_widget.setMinimumSize(minimum_size)
133
- elsif OS.linux?
133
+ elsif OS.linux?
134
134
  @swt_widget.layout(true, true)
135
135
  @swt_widget.setBounds(bounds)
136
136
  end