atome 0.5.6.8.6 → 0.5.6.8.7

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6370fa14baff09e6137332d6c1acb28c9af1471300c1abca20886ed3393b82a0
4
- data.tar.gz: de3ecad7c62684abe3f6cb210d819a670d61d2818461856bc05afc03230fd806
3
+ metadata.gz: 2bb8391acf611cd0f36e1d82282bb76554b558d54d9014a6bf3cf584f39b0b76
4
+ data.tar.gz: 0c92e8b67c476a8ff80e25da5254d7a237b4a7c94437f5bf649a34033a836041
5
5
  SHA512:
6
- metadata.gz: 93703fda1d4a8b00dcbf7430bae2bdeacf2530e02e36e5d99c29dc175ac8d10fa4a7c1f5be6b176943f9a834f90bc75b388082c7e85d02b1e26cf579cf311663
7
- data.tar.gz: d878ddaf5a47323cc31ad8ddf061ddf15b4c7293e49f5312b0892949f44d7e0094a853be4d6796c5c4689985df0394c73fc679d017709249cc0957634619462b
6
+ metadata.gz: e81f72d62647d4bd8d008c0fb9cb0e95efcc8e600652bf73195314e5f745870261faf1465d0c194e95ccd8b22500de953485a850023481c72450fb7ebc062739
7
+ data.tar.gz: 3c61e4f0a6ae722b07b980766586e6e338d1cfac8f788afa46b70cf8ac07d649a8f5957ff96c223bce3e7e66e821d79047899a5c8d33bd9662442b811e492172
@@ -248,7 +248,7 @@ end
248
248
 
249
249
 
250
250
  new({ particle: :tick, store: false }) do |val|
251
- @tick[val] ||= 0
251
+ @tick[val] ||= 1
252
252
  @tick[val]= @tick[val] += 1
253
253
  @tick[val]
254
254
  end
data/lib/atome/version.rb CHANGED
@@ -2,5 +2,5 @@
2
2
 
3
3
  # return atome version
4
4
  class Atome
5
- VERSION = '0.5.6.8.6'
5
+ VERSION = '0.5.6.8.7'
6
6
  end
@@ -23,7 +23,7 @@ new(molecule: :input) do |params, bloc|
23
23
  attach_to = params[:attach] || default_parent
24
24
  renderer_found = grab(attach_to).renderers
25
25
  input_back = Atome.new(
26
- { renderers: renderer_found,id: new_id, type: :shape, color: back_col,
26
+ { renderers: renderer_found, id: new_id, type: :shape, color: back_col,
27
27
  left: 0, top: 0, data: '', attach: attach_to,
28
28
  smooth: 6, overflow: :hidden,
29
29
  })
@@ -41,12 +41,11 @@ new(molecule: :input) do |params, bloc|
41
41
  end
42
42
 
43
43
  input_back.touch(:up) do
44
- if input_back.tick[:input] == 1
44
+ if input_back.tick[:input] == 1
45
45
  text_input.component({ selected: true })
46
46
  end
47
47
  end
48
48
 
49
-
50
49
  text_input.keyboard(:down) do |native_event|
51
50
  # text_input.component({ selected: { color: :red, text: :red } })
52
51
 
@@ -118,7 +117,7 @@ new(molecule: :list) do |params, _bloc|
118
117
  end
119
118
  attach_to = params[:attach] || default_parent
120
119
  renderer_found = grab(attach_to).renderers
121
- list = Atome.new({ renderers: renderer_found,id: new_id, type: :shape, color: { alpha: 0 }, attach: attach_to }.merge(params))
120
+ list = Atome.new({ renderers: renderer_found, id: new_id, type: :shape, color: { alpha: 0 }, attach: attach_to }.merge(params))
122
121
  # Atome.new(
123
122
  # { renderers: [:html], type: :shape, attach: :view, color: back_col,
124
123
  # left: 0, top: 0, data: '', attach: attach_to,
@@ -147,7 +146,7 @@ new({ molecule: :slider }) do |params, bloc|
147
146
  new_id = params.delete(:id) || identity_generator
148
147
 
149
148
  default_smooth = 9
150
- default_slider_particles = {id: new_id, color: color_found, width: 333, height: 33, left: 0, top: 0, smooth: default_smooth }
149
+ default_slider_particles = { id: new_id, color: color_found, width: 333, height: 33, left: 0, top: 0, smooth: default_smooth }
151
150
  default_cursor_particles = { color: color_found, width: 29, height: 29, left: 0, smooth: '100%' }
152
151
  cursor_found = params.delete(:cursor)
153
152
  slider_particle = default_slider_particles.merge(params)
@@ -186,7 +185,7 @@ new({ molecule: :slider }) do |params, bloc|
186
185
  end
187
186
  cursor_top_initial = ((max_value - new_value).to_f / (max_value - min_value)) * (slider_particle[:height] - cursor_particle[:height])
188
187
  bloc.call(new_value)
189
- slider.instance_variable_set('@value',new_value)
188
+ slider.instance_variable_set('@value', new_value)
190
189
  cursor.top(cursor_top_initial)
191
190
  cursor.left(cursor_left)
192
191
  range.height((slider.height - cursor.top) - cursor.height / 2)
@@ -200,7 +199,7 @@ new({ molecule: :slider }) do |params, bloc|
200
199
  end
201
200
  cursor_left_initial = ((new_value - min_value).to_f / (max_value - min_value)) * (slider_particle[:width] - cursor_particle[:width])
202
201
  bloc.call(new_value)
203
- slider.instance_variable_set('@value',new_value)
202
+ slider.instance_variable_set('@value', new_value)
204
203
  cursor.left(cursor_left_initial)
205
204
  cursor.top(cursor_top)
206
205
  range.width(cursor.left + cursor.width / 2)
@@ -239,7 +238,7 @@ new({ molecule: :slider }) do |params, bloc|
239
238
  value = update_value.call(cursor.top, cursor_particle[:height], slider_particle[:height], orientation)
240
239
  range.height((slider.height - cursor.top) - cursor.height / 2)
241
240
  bloc.call(value)
242
- slider.instance_variable_set('@value',value)
241
+ slider.instance_variable_set('@value', value)
243
242
  end
244
243
 
245
244
  else
@@ -263,7 +262,7 @@ new({ molecule: :slider }) do |params, bloc|
263
262
  value = update_value.call(cursor.left, cursor_particle[:width], slider_particle[:width], orientation)
264
263
  range.width(cursor.left + cursor.width / 2)
265
264
  bloc.call(value)
266
- slider.instance_variable_set('@value',value)
265
+ slider.instance_variable_set('@value', value)
267
266
  end
268
267
  end
269
268
  cursor.touch(:double) do
@@ -282,10 +281,9 @@ end
282
281
  new(molecule: :button) do |params, bloc|
283
282
  params[:height] ||= 25
284
283
  params[:width] ||= 25
285
- states=params.delete(:states) || 1
284
+ states = params.delete(:states) || 1
286
285
  new_id = params.delete(:id) || identity_generator
287
286
 
288
-
289
287
  back_col = params.delete(:back)
290
288
  back_col ||= :grey
291
289
 
@@ -297,25 +295,20 @@ new(molecule: :button) do |params, bloc|
297
295
  attach_to = params[:attach] || default_parent
298
296
  renderer_found = grab(attach_to).renderers
299
297
  button = box(
300
- { renderers: renderer_found,id: new_id, type: :shape, color: back_col,
298
+ { renderers: renderer_found, id: new_id, type: :shape, color: back_col,
301
299
  left: 0, top: 0, data: '', attach: attach_to,
302
300
  smooth: 3, overflow: :hidden,
303
301
  })
304
302
 
305
-
306
-
307
303
  button.touch(:down) do
308
304
  button.tick(:button)
309
- bloc.call(button.tick[:button]%states)
310
- end
311
-
305
+ bloc.call((button.tick[:button]-1) % states)
312
306
 
307
+ end
313
308
 
314
309
  params.each do |part_f, val_f|
315
310
  button.send(part_f, val_f)
316
311
  end
317
- button.left(55)
318
-
319
312
 
320
313
  button
321
314
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: atome
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.6.8.6
4
+ version: 0.5.6.8.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jean-Eric Godard
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-03-22 00:00:00.000000000 Z
11
+ date: 2024-03-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: artoo