glimmer-dsl-opal 0.25.0 → 0.25.1

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: 3acd64cce93e2c522567f6b10967489a8edb74e19aad32d9b6aef070f8339715
4
- data.tar.gz: 78adb831387641339c046839bf8ccd034354881a1a963c0eb7084c4065167c2b
3
+ metadata.gz: 855549b9862ac8e94af6f69dc6f7a7960137a9ae8e75885ba9df9028f6c33dbf
4
+ data.tar.gz: c212a5470ebb5bda7f44135833f65efb6a0562923c491e035650483f2d277e14
5
5
  SHA512:
6
- metadata.gz: 340aa792a59e2577c818461ef4ebe88a01b06a8becf19e2f138c8895cdfa691872d227ea9c490f1bb48d14fd6edf3bb2b65aabe8f21bb0982e8fcf4bfdb2d5e1
7
- data.tar.gz: c5509de40b089c73879d46aabb4c7440698eda864acd80509e1496b7bb1ca0558b47c399c96d28b295fa9ec088dffdaf7958861f23dcb9b4b24bbb58a798561d
6
+ metadata.gz: 2fdb36225e4b4e99e97c7a0d406f0ac19e9506cb387e29085f0701c5d8b163708e724405d51354e8e72cd47a2a5fb9d7dd20f780d6506fd5f190e35e6b3ebe3b
7
+ data.tar.gz: 11d6c36df71ce583c7dfa162bd5a7db6ad98530e45c923f9625ac30958fcaf64a22fd82df2bc8448d06b36ab69009fd00a1a936ab268c335deb2891b54141981
data/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # Change Log
2
2
 
3
+ ## 0.25.1
4
+
5
+ - Support `progress_bar` `:vertical` SWT style
6
+ - Add `progress_bar` `:vertical` SWT style to Hello, Progress Bar!
7
+
3
8
  ## 0.25.0
4
9
 
5
10
  - Support `progress_bar` widget without `:vertical` SWT style support
data/README.md CHANGED
@@ -143,7 +143,7 @@ Hello, Table! Game Booked
143
143
 
144
144
  NOTE: Glimmer DSL for Opal is an alpha project. Please help make better by contributing, adopting for small or low risk projects, and providing feedback. It is still an early alpha, so the more feedback and issues you report the better.
145
145
 
146
- **Alpha Version** 0.24.0 only supports bare-minimum capabilities for the included [samples](https://github.com/AndyObtiva/glimmer-dsl-opal#samples) (originally written for [glimmer-dsl-swt](https://github.com/AndyObtiva/glimmer-dsl-swt))
146
+ **Alpha Version** 0.25.1 only supports bare-minimum capabilities for the included [samples](https://github.com/AndyObtiva/glimmer-dsl-opal#samples) (originally written for [glimmer-dsl-swt](https://github.com/AndyObtiva/glimmer-dsl-swt))
147
147
 
148
148
  Other [Glimmer](https://github.com/AndyObtiva/glimmer) DSL gems:
149
149
  - [glimmer-dsl-swt](https://github.com/AndyObtiva/glimmer-dsl-swt): Glimmer DSL for SWT (JRuby Desktop Development GUI Framework)
@@ -266,7 +266,7 @@ gem 'opal', '1.0.4'
266
266
  gem 'opal-rails', '1.1.2'
267
267
  gem 'opal-async', '~> 1.3.0'
268
268
  gem 'opal-jquery', '~> 0.4.4'
269
- gem 'glimmer-dsl-opal', '~> 0.24.0'
269
+ gem 'glimmer-dsl-opal', '~> 0.25.1'
270
270
  gem 'glimmer-dsl-xml', '~> 1.2.0', require: false
271
271
  gem 'glimmer-dsl-css', '~> 1.2.0', require: false
272
272
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.25.0
1
+ 0.25.1
@@ -91,14 +91,14 @@ class HelloProgressBar
91
91
  }
92
92
 
93
93
  # :vertical SWT style is unsupported for now
94
- # progress_bar(:vertical) {
95
- # layout_data(:fill, :center, true, false) {
96
- # horizontal_span 4
97
- # }
98
- # minimum <= [@progress_model, :minimum]
99
- # maximum <= [@progress_model, :maximum]
100
- # selection <= [@progress_model, :selection]
101
- # }
94
+ progress_bar(:vertical) {
95
+ layout_data(:fill, :center, true, false) {
96
+ horizontal_span 4
97
+ }
98
+ minimum <= [@progress_model, :minimum]
99
+ maximum <= [@progress_model, :maximum]
100
+ selection <= [@progress_model, :selection]
101
+ }
102
102
 
103
103
  button {
104
104
  layout_data(:fill, :center, true, false) {
@@ -26,8 +26,11 @@ module Glimmer
26
26
  class ProgressBarProxy < WidgetProxy
27
27
  STYLE = <<~CSS
28
28
  .ui-progressbar.vertical {
29
- /* Not Supported */
30
- /* transform: rotate(-90deg); */
29
+ transform: rotate(-180deg);
30
+ height: 140px;
31
+ width: 28px;
32
+ margin-left: auto;
33
+ margin-right: auto;
31
34
  }
32
35
  CSS
33
36
 
@@ -40,7 +43,8 @@ module Glimmer
40
43
  @vertical = args.detect { |arg| SWTProxy[arg] == SWTProxy[:vertical] }
41
44
  @indeterminate = args.detect { |arg| SWTProxy[arg] == SWTProxy[:indeterminate] }
42
45
  super(parent, args, block)
43
- dom_element.progressbar
46
+ # initialize manually if vertical
47
+ dom_element.progressbar if horizontal?
44
48
  self.minimum = 0
45
49
  self.selection = false if indeterminate?
46
50
  end
@@ -59,26 +63,41 @@ module Glimmer
59
63
 
60
64
  def maximum=(value)
61
65
  @maximum = value
62
- dom_element.progressbar('option', 'max', @maximum - @minimum)
66
+ if horizontal?
67
+ dom_element.progressbar('option', 'max', @maximum - @minimum)
68
+ end
63
69
  end
64
70
 
65
71
  def selection=(selection_value)
66
72
  @selection = selection_value
67
- value = @selection ? (@selection - @minimum) : @selection
68
- dom_element.progressbar('option', 'value', value)
73
+ if horizontal?
74
+ value = @selection ? (@selection - @minimum) : @selection
75
+ dom_element.progressbar('option', 'value', value)
76
+ else
77
+ value = ((@selection - @minimum) / (@maximum - @minimum)) * 100
78
+ selection_dom_element.css('height', "#{value}%")
79
+ end
69
80
  end
70
81
 
71
82
  def element
72
83
  'div'
73
84
  end
74
85
 
86
+ def selection_dom_element
87
+ dom_element.find('.ui-progressbar-value')
88
+ end
89
+
75
90
  def dom
76
91
  progress_bar_id = id
77
92
  progress_bar_class = name
78
- progress_bar_class += ' vertical' if vertical?
93
+ progress_bar_class += ' vertical ui-progressbar ui-corner-all ui-widget ui-widget-content' if vertical?
79
94
  progress_bar_class += ' indeterminate' if indeterminate?
80
95
  @dom ||= html {
81
- div(id: progress_bar_id, class: progress_bar_class)
96
+ div(id: progress_bar_id, class: progress_bar_class) {
97
+ if vertical?
98
+ div(class: 'ui-progressbar-value ui-corner-left ui-widget-header', style: 'height: 0%;')
99
+ end
100
+ }
82
101
  }.to_s
83
102
  end
84
103
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: glimmer-dsl-opal
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.25.0
4
+ version: 0.25.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - AndyMaleh