glimmer-dsl-swt 4.18.4.1 → 4.18.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
  SHA256:
3
- metadata.gz: ed016ed2527818f682cb4247d294bf16ddcc8ccddb81f5bd26fa518b0592d4a1
4
- data.tar.gz: 2c2d0e7fdc9921ab9861d1151686907d809cd072e0e5651889b4f08851c19791
3
+ metadata.gz: 3c4acc7755917941e9c8fd7d94f7712d29701ca4eefd1b31b20a9a46d41ec557
4
+ data.tar.gz: 3f59ee7617453a88165fa57594bcff2dea9831c70a821c11326ace68d66b8936
5
5
  SHA512:
6
- metadata.gz: 646cec122f5b18ffdd57be914bdd84f7a5af7729cf66aa98ecfe35477d7bb9c445bb6c0b00436c7aa06a40052cd5d96613a4d3b4470d97990ebb60cf6813323d
7
- data.tar.gz: c6af13d3fe035da72d5e60b88cbe1c6ab498e07cd061113c46a248c110f2044349b99050fd576ebc4f2923efa49965a0539da512325e9a76d0512c4c6816c88c
6
+ metadata.gz: 22e115579a74734199b02ce5e43cb15fd789424f063e0d805ff3e1058ec63067e01ea63df4b794e530a0268803bdd898211db3f31a99fe27c63f9ed21c1cb857
7
+ data.tar.gz: 85a7683f0e431252bf4e5490895fa029bfc961a17be3a6fa8e1d15ab4a6927acd8ddf834a46ada2dbaa1ce0aaaf68979c477edebae48e77de9c601a5dfd0d658
data/CHANGELOG.md CHANGED
@@ -1,5 +1,20 @@
1
1
  # Change Log
2
2
 
3
+ ### 4.18.4.2
4
+
5
+ - Remove Tetris Clear button from High Score dialog (since it is available via menu and is rarely used)
6
+ - Make right control button rotate right with Tetris
7
+ - Avoid adding the widget listeners for read_only data-binding (instead of just relying on ModelBinding raising exceptions)
8
+ - Clean up the meta sample code_text style by removing root composite margins/spacing
9
+ - Made background for top label of Hello, Table! transparent for Windows
10
+ - Fix `glimmer samples` command and Meta-Sample on Windows
11
+ - Fix Tetris on Windows
12
+ - Fix Hello, Canvas on Windows
13
+ - Fix Hello, Canvas Transform when launched from `glimmer samples`
14
+ - Fix Table editing write_on_cancel option use on Windows
15
+ - Fix issue with adding content to the end of a styled text widget breaking line number scrolling
16
+ - Fix issue with code_text not showing line numbers for extra new lines at the end
17
+
3
18
  ### 4.18.4.1
4
19
 
5
20
  - Support data-binding of `code_text` with lines enabled.
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 SWT 4.18.4.1
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 SWT 4.18.4.2
2
2
  ## JRuby Desktop Development GUI Framework
3
3
  [![Gem Version](https://badge.fury.io/rb/glimmer-dsl-swt.svg)](http://badge.fury.io/rb/glimmer-dsl-swt)
4
4
  [![Travis CI](https://travis-ci.com/AndyObtiva/glimmer-dsl-swt.svg?branch=master)](https://travis-ci.com/github/AndyObtiva/glimmer-dsl-swt)
@@ -490,7 +490,7 @@ jgem install glimmer-dsl-swt
490
490
 
491
491
  Or this command if you want a specific version:
492
492
  ```
493
- jgem install glimmer-dsl-swt -v 4.18.4.1
493
+ jgem install glimmer-dsl-swt -v 4.18.4.2
494
494
  ```
495
495
 
496
496
  `jgem` is JRuby's version of `gem` command.
@@ -508,7 +508,7 @@ Note: if you're using activerecord or activesupport, keep in mind that Glimmer u
508
508
 
509
509
  Add the following to `Gemfile`:
510
510
  ```
511
- gem 'glimmer-dsl-swt', '~> 4.18.4.1'
511
+ gem 'glimmer-dsl-swt', '~> 4.18.4.2'
512
512
  ```
513
513
 
514
514
  And, then run:
@@ -566,7 +566,7 @@ bin/glimmer samples
566
566
  Below are the full usage instructions that come up when running `glimmer` without args.
567
567
 
568
568
  ```
569
- Glimmer (JRuby Desktop Development GUI Framework) - JRuby Gem: glimmer-dsl-swt v4.18.4.1
569
+ Glimmer (JRuby Desktop Development GUI Framework) - JRuby Gem: glimmer-dsl-swt v4.18.4.2
570
570
 
571
571
  Usage: glimmer [--bundler] [--pd] [--quiet] [--debug] [--log-level=VALUE] [[ENV_VAR=VALUE]...] [[-jruby-option]...] (application.rb or task[task_args]) [[application2.rb]...]
572
572
 
@@ -588,8 +588,8 @@ Tasks are run via rake. Some tasks take arguments in square brackets.
588
588
 
589
589
  Available tasks are below (if you do not see any, please add `require 'glimmer/rake_task'` to Rakefile and rerun or run rake -T):
590
590
 
591
- Select a Glimmer task to run: (Press ↑/↓ arrow to move, Enter to select and letters to filter)
592
- glimmer list:gems:customshell[query] # List Glimmer custom shell gems available at rubygems.org (query is optional) [alt: list:gems:cs]
591
+ Select a Glimmer task to run: (Press ↑/↓ arrow to move, Enter to select and letters to filter)
592
+ ‣ glimmer list:gems:customshell[query] # List Glimmer custom shell gems available at rubygems.org (query is optional) [alt: list:gems:cs]
593
593
  glimmer list:gems:customwidget[query] # List Glimmer custom widget gems available at rubygems.org (query is optional) [alt: list:gems:cw]
594
594
  glimmer list:gems:dsl[query] # List Glimmer DSL gems available at rubygems.org (query is optional)
595
595
  glimmer package[type] # Package app for distribution (generating config, jar, and native files) (type is optional)
@@ -1045,7 +1045,7 @@ Output:
1045
1045
 
1046
1046
  Css glimmer-dsl-css 1.1.0 AndyMaleh Glimmer DSL for CSS
1047
1047
  Opal glimmer-dsl-opal 0.10.2 AndyMaleh Glimmer DSL for Opal
1048
- Swt glimmer-dsl-swt 4.18.4.1 AndyMaleh Glimmer DSL for SWT
1048
+ Swt glimmer-dsl-swt 4.18.4.2 AndyMaleh Glimmer DSL for SWT
1049
1049
  Tk glimmer-dsl-tk 0.0.6 AndyMaleh Glimmer DSL for Tk
1050
1050
  Xml glimmer-dsl-xml 1.1.0 AndyMaleh Glimmer DSL for XML
1051
1051
  ```
data/VERSION CHANGED
@@ -1 +1 @@
1
- 4.18.4.1
1
+ 4.18.4.2
@@ -2,16 +2,16 @@
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
3
  # Instead, edit Juwelier::Tasks in Rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
- # stub: glimmer-dsl-swt 4.18.4.1 ruby lib
5
+ # stub: glimmer-dsl-swt 4.18.4.2 ruby lib
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "glimmer-dsl-swt".freeze
9
- s.version = "4.18.4.1"
9
+ s.version = "4.18.4.2"
10
10
 
11
11
  s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
12
12
  s.require_paths = ["lib".freeze]
13
13
  s.authors = ["AndyMaleh".freeze]
14
- s.date = "2021-02-03"
14
+ s.date = "2021-02-04"
15
15
  s.description = "Glimmer DSL for SWT (JRuby Desktop Development GUI Framework) is a native-GUI cross-platform desktop development library written in JRuby, an OS-threaded faster JVM version of Ruby. Glimmer's main innovation is a declarative Ruby DSL that enables productive and efficient authoring of desktop application user-interfaces by relying on the robust Eclipse SWT library. Glimmer additionally innovates by having built-in data-binding support, which greatly facilitates synchronizing the GUI with domain models, thus achieving true decoupling of object oriented components and enabling developers to solve business problems (test-first) without worrying about GUI concerns, or alternatively drive development GUI-first, and then write clean business models (test-first) afterwards. Not only does Glimmer provide a large set of GUI widgets, but it also supports drawing Canvas Graphics like Shapes and Animations. To get started quickly, Glimmer offers scaffolding options for Apps, Gems, and Custom Widgets. Glimmer also includes native-executable packaging support, sorely lacking in other libraries, thus enabling the delivery of desktop apps written in Ruby as truly native DMG/PKG/APP files on the Mac + App Store, MSI/EXE files on Windows, and Gem Packaged Shell Scripts on Linux.".freeze
16
16
  s.email = "andy.am@gmail.com".freeze
17
17
  s.executables = ["glimmer".freeze, "girb".freeze]
@@ -156,6 +156,7 @@ Gem::Specification.new do |s|
156
156
  "samples/hello/hello_canvas.rb",
157
157
  "samples/hello/hello_canvas_animation.rb",
158
158
  "samples/hello/hello_canvas_transform.rb",
159
+ "samples/hello/hello_canvas_transform/hello_canvas_transform_image.png",
159
160
  "samples/hello/hello_checkbox.rb",
160
161
  "samples/hello/hello_checkbox_group.rb",
161
162
  "samples/hello/hello_code_text.rb",
@@ -95,15 +95,19 @@ module Glimmer
95
95
 
96
96
  @line_numbers_styled_text_proxy = styled_text(swt(swt(swt_style), :h_scroll!, :v_scroll!)) {
97
97
  layout_data(:right, :fill, false, true)
98
- text ' '*lines_width.to_i
99
98
  text bind(self, :styled_text_proxy_text, read_only: true) { |text_value|
100
- line_count = text_value.to_s.split("\n").count
99
+ line_count = "#{text_value} ".split("\n").count
101
100
  line_count = 1 if line_count == 0
102
101
  lines_text_size = [line_count.to_s.size, @lines_width].max
103
102
  if lines_text_size > @lines_width
104
- async_exec { swt_widget.layout }
103
+ async_exec {
104
+ swt_widget.layout
105
+ }
105
106
  @lines_width = lines_text_size
106
107
  end
108
+ async_exec {
109
+ @line_numbers_styled_text_proxy&.top_pixel = styled_text_proxy_top_pixel
110
+ }
107
111
  line_count.times.map {|n| (' ' * (lines_text_size - (n+1).to_s.size)) + (n+1).to_s }.join("\n") + "\n"
108
112
  }
109
113
  top_pixel bind(self, :styled_text_proxy_top_pixel, read_only: true)
@@ -497,12 +497,12 @@ module Glimmer
497
497
  @finish_edit = lambda do |event=nil|
498
498
  new_value = @table_editor_widget_proxy&.send(widget_value_property)
499
499
  if table_item.isDisposed
500
- @cancel_edit.call
500
+ @cancel_edit.call unless write_on_cancel
501
501
  elsif !new_value.nil? && !action_taken && !@edit_in_progress && !@cancel_in_progress
502
502
  action_taken = true
503
503
  @edit_in_progress = true
504
504
  if new_value == model.send(model_editing_property)
505
- @cancel_edit.call
505
+ @cancel_edit.call unless write_on_cancel
506
506
  else
507
507
  if before_write&.arity == 0
508
508
  before_write&.call
@@ -565,9 +565,11 @@ module Glimmer
565
565
 
566
566
  # Used for data-binding only. Consider renaming or improving to avoid the confusion it causes
567
567
  def add_observer(observer, property_name)
568
- property_listener_installers = @swt_widget.class.ancestors.map {|ancestor| widget_property_listener_installers[ancestor]}.compact
569
- widget_listener_installers = property_listener_installers.map{|installer| installer[property_name.to_s.to_sym]}.compact if !property_listener_installers.empty?
570
- widget_listener_installers.to_a.first&.call(observer)
568
+ if !observer.respond_to?(:binding_options) || !observer.binding_options[:read_only]
569
+ property_listener_installers = @swt_widget.class.ancestors.map {|ancestor| widget_property_listener_installers[ancestor]}.compact
570
+ widget_listener_installers = property_listener_installers.map{|installer| installer[property_name.to_s.to_sym]}.compact if !property_listener_installers.empty?
571
+ widget_listener_installers.to_a.first&.call(observer)
572
+ end
571
573
  end
572
574
 
573
575
  def remove_observer(observer, property_name)
@@ -20,7 +20,6 @@
20
20
  # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21
21
 
22
22
  require 'fileutils'
23
- require 'etc'
24
23
 
25
24
  class Sample
26
25
  include Glimmer::DataBinding::ObservableModel
@@ -31,7 +30,7 @@ class Sample
31
30
  end
32
31
 
33
32
  def user_glimmer_directory
34
- File.join(Etc.getpwuid.dir, '.glimmer-dsl-swt')
33
+ File.join(File.expand_path('~'), '.glimmer-dsl-swt')
35
34
  end
36
35
 
37
36
  def ensure_user_glimmer_directory
@@ -264,12 +263,21 @@ class MetaSampleApplication
264
263
  }
265
264
  }
266
265
 
267
- @code_text = code_text(lines: {width: 2}) {
268
- text bind(SampleDirectory, 'selected_sample.code', read_only: true)
269
- editable bind(SampleDirectory, 'selected_sample.editable')
266
+ @code_text = code_text(lines: {width: 3}) {
267
+ root {
268
+ grid_layout(2, false) {
269
+ horizontal_spacing 0
270
+ margin_width 0
271
+ margin_height 0
272
+ }
273
+ }
270
274
  line_numbers {
271
275
  background :white
272
276
  }
277
+ text bind(SampleDirectory, 'selected_sample.code', read_only: true)
278
+ editable bind(SampleDirectory, 'selected_sample.editable')
279
+ left_margin 7
280
+ right_margin 7
273
281
  }
274
282
 
275
283
  weights 4, 11
@@ -69,14 +69,12 @@ class Tetris
69
69
  game.left!
70
70
  when swt(:arrow_right), 'd'.bytes.first
71
71
  game.right!
72
- when swt(:shift), swt(:alt)
72
+ when swt(:shift), swt(:alt), swt(:ctrl)
73
73
  if key_event.keyLocation == swt(:right) # right shift key
74
74
  game.rotate!(:right)
75
75
  elsif key_event.keyLocation == swt(:left) # left shift key
76
76
  game.rotate!(:left)
77
77
  end
78
- when swt(:ctrl)
79
- game.rotate!(:left)
80
78
  end
81
79
  }
82
80
 
@@ -20,7 +20,6 @@
20
20
  # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21
21
 
22
22
  require 'fileutils'
23
- require 'etc'
24
23
  require 'json'
25
24
  require 'glimmer/data_binding/observer'
26
25
  require 'glimmer/config'
@@ -112,7 +111,7 @@ class Tetris
112
111
  end
113
112
 
114
113
  def tetris_dir
115
- @tetris_dir ||= File.join(Etc.getpwuid.dir, '.glimmer-tetris')
114
+ @tetris_dir ||= File.join(File.expand_path('~'), '.glimmer-tetris')
116
115
  end
117
116
 
118
117
  def tetris_high_score_file
@@ -71,13 +71,6 @@ class Tetris
71
71
  composite {
72
72
  row_layout :horizontal
73
73
 
74
- button {
75
- text 'Clear'
76
-
77
- on_widget_selected {
78
- game.clear_high_scores!
79
- }
80
- }
81
74
  @play_close_button = button {
82
75
  text bind(game, :game_over) {|game_over| game_over ? 'Play Again?' : 'Close'}
83
76
  focus true # initial focus
@@ -1,6 +1,6 @@
1
1
  include Glimmer
2
2
 
3
- glimmer_logo = File.expand_path('../../images/glimmer-logo-hi-res.png', __dir__)
3
+ glimmer_logo = File.expand_path('./hello_canvas_transform/hello_canvas_transform_image.png', __dir__)
4
4
 
5
5
  shell {
6
6
  text 'Hello, Canvas Transform!'
@@ -192,6 +192,7 @@ class HelloTable
192
192
  layout_data :center, :center, true, false
193
193
 
194
194
  text 'BASEBALL PLAYOFF SCHEDULE'
195
+ background :transparent
195
196
  foreground rgb(94, 107, 103)
196
197
  font name: 'Optima', height: 38, style: :bold
197
198
  }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: glimmer-dsl-swt
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.18.4.1
4
+ version: 4.18.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - AndyMaleh
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-02-03 00:00:00.000000000 Z
11
+ date: 2021-02-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement
@@ -489,6 +489,7 @@ files:
489
489
  - samples/hello/hello_canvas.rb
490
490
  - samples/hello/hello_canvas_animation.rb
491
491
  - samples/hello/hello_canvas_transform.rb
492
+ - samples/hello/hello_canvas_transform/hello_canvas_transform_image.png
492
493
  - samples/hello/hello_checkbox.rb
493
494
  - samples/hello/hello_checkbox_group.rb
494
495
  - samples/hello/hello_code_text.rb