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 +4 -4
- data/CHANGELOG.md +5 -0
- data/README.md +2 -2
- data/VERSION +1 -1
- data/lib/glimmer-dsl-opal/samples/hello/hello_progress_bar.rb +8 -8
- data/lib/glimmer/swt/progress_bar_proxy.rb +27 -8
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 855549b9862ac8e94af6f69dc6f7a7960137a9ae8e75885ba9df9028f6c33dbf
|
4
|
+
data.tar.gz: c212a5470ebb5bda7f44135833f65efb6a0562923c491e035650483f2d277e14
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2fdb36225e4b4e99e97c7a0d406f0ac19e9506cb387e29085f0701c5d8b163708e724405d51354e8e72cd47a2a5fb9d7dd20f780d6506fd5f190e35e6b3ebe3b
|
7
|
+
data.tar.gz: 11d6c36df71ce583c7dfa162bd5a7db6ad98530e45c923f9625ac30958fcaf64a22fd82df2bc8448d06b36ab69009fd00a1a936ab268c335deb2891b54141981
|
data/CHANGELOG.md
CHANGED
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.
|
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.
|
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.
|
1
|
+
0.25.1
|
@@ -91,14 +91,14 @@ class HelloProgressBar
|
|
91
91
|
}
|
92
92
|
|
93
93
|
# :vertical SWT style is unsupported for now
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
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
|
-
|
30
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
68
|
-
|
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
|