shoes-swt 4.0.0.pre11 → 4.0.0.pre12

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: c09977e2aa7d8d84bfc7a5c71fc8aaa3ec8c31f88616266febf0e0d9684139f1
4
- data.tar.gz: 816a6a60e7d9a29314c2dcc532cfba105d674ff2d0c282defd2c8ef32123f527
3
+ metadata.gz: 24d59ab2c243194cd08ec8910dc1ac800cf8d4557c7126338e71bed355cecfe6
4
+ data.tar.gz: 35019496beedf4815a237efb971a9ea0dc128b3155f8378bf6f3680735cdb8d7
5
5
  SHA512:
6
- metadata.gz: da4721c20e3aaadf9a866435e8230ea1a57eb2849d8990975c3be081c251164a5e4772cd091bc1dba2e50982603a9dd0114dd4edffca112c1c35b3fa74dde0f9
7
- data.tar.gz: a686968991a518351c2ef7b51a8e87ddf3c703e98db5f6df553fb9da451ede1b9541eb04582f43195bfde6d96bd60f290f81eb8a2fa376a455c5acfd7938140c
6
+ metadata.gz: 86ee6a318228b84e51eea1ad73e5c0dbcc40e938f4c42e002a32f5c2e2fc2ae3699fa11226b92069bfdd9dc8d5e5182d60203a9801a39f3a3646b5439ee10032
7
+ data.tar.gz: a41f3c499268d5d8d35ad26a60cd3bdf3f419c082ca1724302e1a9e42701a93ae03a1505a249a5ad8b110de8f47b5a94d23c846b33cb2e10e0490cb5fffdf370
data/lib/shoes/swt.rb CHANGED
@@ -59,6 +59,7 @@ class Shoes
59
59
  require 'shoes/swt/common/clickable'
60
60
  require 'shoes/swt/common/container'
61
61
  require 'shoes/swt/common/fill'
62
+ require 'shoes/swt/common/focus'
62
63
  require 'shoes/swt/common/image_handling'
63
64
  require 'shoes/swt/common/resource'
64
65
  require 'shoes/swt/common/painter'
data/lib/shoes/swt/app.rb CHANGED
@@ -68,7 +68,7 @@ EOS
68
68
  @started = true
69
69
  self.fullscreen = true if dsl.start_as_fullscreen?
70
70
  flush
71
- ::Swt.event_loop { ::Shoes::Swt.main_app.disposed? } if main_app?
71
+ ::Swt.event_loop { ::Shoes::Swt.apps.all?(&:disposed?) } if main_app?
72
72
  end
73
73
 
74
74
  def quit
@@ -231,14 +231,22 @@ EOS
231
231
  @shell.setSize(new_width, new_height)
232
232
  end
233
233
 
234
- def main_window_on_close
234
+ def on_close
235
235
  lambda do |_event|
236
- ::Swt.display.dispose
237
- ::Shoes::Swt::App.mark_main_app_closed
238
- Dir[File.join(Dir.tmpdir, "__shoes4_*.png")].each { |f| File.delete f }
236
+ # Only do final cleanup if this is the last open window around
237
+ if finished?
238
+ ::Swt.display.dispose
239
+ ::Shoes::Swt::App.mark_main_app_closed
240
+ Dir[File.join(Dir.tmpdir, "__shoes4_*.png")].each { |f| File.delete f }
241
+ end
239
242
  end
240
243
  end
241
244
 
245
+ def finished?
246
+ # When closing we're done if we're the last undisposed window around
247
+ ::Shoes::Swt.apps.reject(&:disposed?) == [self]
248
+ end
249
+
242
250
  def main_window_style
243
251
  style = ::Swt::SWT::CLOSE | ::Swt::SWT::MIN | ::Swt::SWT::V_SCROLL
244
252
  style |= ::Swt::SWT::RESIZE | ::Swt::SWT::MAX if @dsl.opts[:resizable]
@@ -282,7 +290,7 @@ EOS
282
290
 
283
291
  def attach_shell_event_listeners
284
292
  @shell.addControlListener ShellControlListener.new(self)
285
- @shell.addListener(::Swt::SWT::Close, main_window_on_close) if main_app?
293
+ @shell.addListener(::Swt::SWT::Close, on_close)
286
294
  @shell.addListener(::Swt::SWT::Close, unregister_app)
287
295
  end
288
296
 
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+ class Shoes
3
+ module Swt
4
+ module Common
5
+ module Focus
6
+ def focus
7
+ @real.set_focus
8
+ end
9
+ end
10
+ end
11
+ end
12
+ end
@@ -3,6 +3,7 @@ class Shoes
3
3
  module Swt
4
4
  # Class is used by edit_box and edit_line
5
5
  class InputBox
6
+ include Common::Focus
6
7
  include Common::Remove
7
8
  include Common::PainterUpdatesPosition
8
9
  include Common::Visibility
@@ -2,6 +2,7 @@
2
2
  class Shoes
3
3
  module Swt
4
4
  class ListBox
5
+ include Common::Focus
5
6
  include Common::Remove
6
7
  include Common::Visibility
7
8
  include Common::UpdatePosition
@@ -32,7 +32,7 @@ class Shoes
32
32
 
33
33
  def run(path)
34
34
  if @packages.empty?
35
- puts "You must select at least one packaging format.\n\n#{::Shoes::UI::CLI::PackageCommand.help}"
35
+ puts "You must select at least one packaging format.\n\n#{::Shoes::UI::CLI::PackageCommand.new.help}"
36
36
  return
37
37
  end
38
38
 
@@ -35,8 +35,9 @@ class Shoes
35
35
  :mouse_left],
36
36
  ::Shoes::TextBlock => [:replace] }.freeze
37
37
 
38
- CHANGED_POSITION = { ::Shoes::Common::Positioning => [:_position, :displace],
39
- ::Shoes::Common::Hover => [:eval_hover_block] }.freeze
38
+ CHANGED_POSITION = { ::Shoes::DimensionsDelegations => [:adjust_current_position],
39
+ ::Shoes::Common::Positioning => [:_position, :displace],
40
+ ::Shoes::Common::Hover => [:eval_hover_block] }.freeze
40
41
 
41
42
  attr_reader :app
42
43
 
@@ -49,5 +49,6 @@ class Shoes
49
49
 
50
50
  class Flow < Slot; end
51
51
  class Stack < Slot; end
52
+ class Widget < Slot; end
52
53
  end
53
54
  end
@@ -2,6 +2,7 @@
2
2
  class Shoes
3
3
  module Swt
4
4
  class SwtButton
5
+ include Common::Focus
5
6
  include Common::Remove
6
7
  include Common::Visibility
7
8
  include Common::UpdatePosition
@@ -25,10 +26,6 @@ class Shoes
25
26
  blk.call @dsl
26
27
  end
27
28
 
28
- def focus
29
- @real.set_focus
30
- end
31
-
32
29
  def click(blk)
33
30
  remove_listeners
34
31
  @real.addSelectionListener { eval_block blk }
@@ -2,6 +2,6 @@
2
2
 
3
3
  class Shoes
4
4
  module Swt
5
- VERSION = "4.0.0.pre11"
5
+ VERSION = "4.0.0.pre12"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shoes-swt
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.0.pre11
4
+ version: 4.0.0.pre12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Team Shoes
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-08-21 00:00:00.000000000 Z
11
+ date: 2017-10-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement
@@ -43,7 +43,7 @@ dependencies:
43
43
  requirements:
44
44
  - - '='
45
45
  - !ruby/object:Gem::Version
46
- version: 4.0.0.pre11
46
+ version: 4.0.0.pre12
47
47
  name: shoes-core
48
48
  prerelease: false
49
49
  type: :runtime
@@ -51,13 +51,13 @@ dependencies:
51
51
  requirements:
52
52
  - - '='
53
53
  - !ruby/object:Gem::Version
54
- version: 4.0.0.pre11
54
+ version: 4.0.0.pre12
55
55
  - !ruby/object:Gem::Dependency
56
56
  requirement: !ruby/object:Gem::Requirement
57
57
  requirements:
58
58
  - - '='
59
59
  - !ruby/object:Gem::Version
60
- version: 4.0.0.pre11
60
+ version: 4.0.0.pre12
61
61
  name: shoes-package
62
62
  prerelease: false
63
63
  type: :runtime
@@ -65,7 +65,7 @@ dependencies:
65
65
  requirements:
66
66
  - - '='
67
67
  - !ruby/object:Gem::Version
68
- version: 4.0.0.pre11
68
+ version: 4.0.0.pre12
69
69
  description: A JRuby and Swt backend for Shoes, the best little GUI toolkit for Ruby.
70
70
  Shoes makes building for Mac, Windows, and Linux super simple.
71
71
  email:
@@ -96,6 +96,7 @@ files:
96
96
  - lib/shoes/swt/common/clickable.rb
97
97
  - lib/shoes/swt/common/container.rb
98
98
  - lib/shoes/swt/common/fill.rb
99
+ - lib/shoes/swt/common/focus.rb
99
100
  - lib/shoes/swt/common/image_handling.rb
100
101
  - lib/shoes/swt/common/painter.rb
101
102
  - lib/shoes/swt/common/painter_updates_position.rb
@@ -178,7 +179,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
178
179
  version: 1.3.1
179
180
  requirements: []
180
181
  rubyforge_project:
181
- rubygems_version: 2.6.11
182
+ rubygems_version: 2.6.13
182
183
  signing_key:
183
184
  specification_version: 4
184
185
  summary: A JRuby and Swt backend for Shoes, the best little GUI toolkit for Ruby.