glimmer-dsl-libui 0.6.0.pre.2 → 0.6.0.pre.3

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: 92740dabc6bcd24626b2f02847b37e81f7a713f787d0dda73457e57ad7c92316
4
- data.tar.gz: 92eabe4c6043527bd218ee867e564883be14d295fd00b6a6ee5d2b1fd6762e64
3
+ metadata.gz: e17aa5f004101c314d48c382a9052b018757de269171b90daadcafdbb8db49ef
4
+ data.tar.gz: 0c9d5e34687149f684e2f9be9d4e357c2c77b9cf4365a1b14b5952802075845b
5
5
  SHA512:
6
- metadata.gz: 20469c207b97d91102f8c864449668c30ae7f34c82c0c8c4c054c1ca63e5bba12810fe437aa78e0fe67e8950b415ff59a401bb8289e267305585b53bec408977
7
- data.tar.gz: 6a56bc7b09ddaf51b2f766da5dd6066cff9db9f93a6e39cd80f2217f4b1ee1f0a7cd3e9cb78c6ae149d4f007bca2cd4b2d335858cc35621ac6048fcfae969f67
6
+ metadata.gz: a3d8cf0a13e945afc8380490ca6791c3321a30515f07bad029c4cd71aa185b712f582f5914892a40b6c6984775365c72a14dcddd51a3f9a101d62355127176af
7
+ data.tar.gz: af45d4e48c481de9151bdc1fbc4a754b93f7e684cc1cf728157aa64a94feb2d99d7272ff2cb94440c47b628bf7fb9bd43045ffa377ff9c85c759f088acaa059a
data/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Change Log
2
2
 
3
+ ## 0.6.0.pre.3
4
+
5
+ - Optimize `table` scrolling performance when having many rows and columns (prevent recalculation of `expanded_cell_rows` on every cell evaluation). Resolve: https://github.com/AndyObtiva/glimmer-dsl-libui/issues/38
6
+ - `refined_table` `pagination: false` option to disable pagination, but keep filtering.
7
+ - Fix issue with `Glimmer::LibUI::interpret_color` support for `[r, g, b, a]` `Array`-based colors, returning `[r, g, b]` only without alpha value
8
+
3
9
  ## 0.6.0.pre.2
4
10
 
5
11
  - Fix issue "Cannot add rows to a table that started empty": https://github.com/AndyObtiva/glimmer-dsl-libui/issues/36
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 LibUI 0.6.0.pre.2
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 LibUI 0.6.0.pre.3
2
2
  ## Prerequisite-Free Ruby Desktop Development GUI Library
3
3
  ### The Quickest Way From Zero To GUI
4
4
  [![Gem Version](https://badge.fury.io/rb/glimmer-dsl-libui.svg)](http://badge.fury.io/rb/glimmer-dsl-libui)
@@ -542,7 +542,7 @@ gem install glimmer-dsl-libui
542
542
  Or install via Bundler `Gemfile`:
543
543
 
544
544
  ```ruby
545
- gem 'glimmer-dsl-libui', '~> 0.6.0.pre.2'
545
+ gem 'glimmer-dsl-libui', '~> 0.6.0.pre.3'
546
546
  ```
547
547
 
548
548
  Test that installation worked by running the [Meta-Example](#examples):
@@ -971,6 +971,7 @@ Options (passed as kwargs hash):
971
971
  - `table_editable` (Boolean) [default: `false`]: this indicates if all table columns are editable or not.
972
972
  - `per_page` (`Integer`) [default: `10`]: number of rows per page
973
973
  - `page` (`Integer`) [default: `1`]: initial page displayed
974
+ - `pagination` (Boolean) [default: `true`]: pagination is enabled (disabling still keeps the filter field)
974
975
  - `visible_page_count` (Boolean) [default: `false`]: shows "of PAGE_COUNT pages" after page `entry` field
975
976
  - `filter` (Lambda) [default: `Glimmer::LibUI::CustomControl::RefinedTable::FILTER_DEFAULT`]: enables setting custom filter that accepts `row_hash` (mapping table column names to row values) and `query` string as arguments, and it is supposed to return `true` or `false` for whether to show a row or filter it out.
976
977
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.6.0.pre.2
1
+ 0.6.0.pre.3
Binary file
@@ -97,7 +97,12 @@ module Glimmer
97
97
  alias set_cell_rows cell_rows
98
98
 
99
99
  def expanded_cell_rows
100
- expand(cell_rows)
100
+ expanded_cell_rows_dependency_cell_rows = cell_rows
101
+ if expanded_cell_rows_dependency_cell_rows != @expanded_cell_rows_dependency_cell_rows
102
+ @expanded_cell_rows_dependency_cell_rows = expanded_cell_rows_dependency_cell_rows
103
+ @expanded_cell_rows = expand(@expanded_cell_rows_dependency_cell_rows)
104
+ end
105
+ @expanded_cell_rows
101
106
  end
102
107
 
103
108
  def expand(cell_rows)
@@ -272,6 +277,7 @@ module Glimmer
272
277
  @cell_rows[row].send(attribute)[0] = ::LibUI.table_value_int(val).to_i == 1
273
278
  end
274
279
  end
280
+ @expanded_cell_rows_dependency_cell_rows = nil
275
281
  notify_custom_listeners('on_edited', row, @cell_rows[row])
276
282
  end
277
283
 
@@ -306,6 +312,7 @@ module Glimmer
306
312
  @last_cell_rows.each_with_index do |old_row_data, row|
307
313
  if old_row_data != @cell_rows[row] && model
308
314
  ::LibUI.table_model_row_changed(model, row)
315
+ @expanded_cell_rows_dependency_cell_rows = nil
309
316
  notify_custom_listeners('on_changed', row, :changed, @cell_rows[row])
310
317
  end
311
318
  end
@@ -313,6 +320,7 @@ module Glimmer
313
320
  row = @last_cell_rows.size - n - 1
314
321
  if model
315
322
  ::LibUI.table_model_row_deleted(model, row)
323
+ @expanded_cell_rows_dependency_cell_rows = nil
316
324
  notify_custom_listeners('on_changed', row, :deleted, @last_cell_rows[row])
317
325
  end
318
326
  end
@@ -321,12 +329,14 @@ module Glimmer
321
329
  row = @last_cell_rows.size + n
322
330
  if model
323
331
  ::LibUI.table_model_row_inserted(model, row)
332
+ @expanded_cell_rows_dependency_cell_rows = nil
324
333
  notify_custom_listeners('on_changed', row, :inserted, @cell_rows[row])
325
334
  end
326
335
  end
327
336
  @cell_rows.each_with_index do |new_row_data, row|
328
337
  if new_row_data != @last_cell_rows[row] && model
329
338
  ::LibUI.table_model_row_changed(model, row)
339
+ @expanded_cell_rows_dependency_cell_rows = nil
330
340
  notify_custom_listeners('on_changed', row, :changed, @cell_rows[row])
331
341
  end
332
342
  end
@@ -334,6 +344,7 @@ module Glimmer
334
344
  @cell_rows.each_with_index do |new_row_data, row|
335
345
  if new_row_data != @last_cell_rows[row] && model
336
346
  ::LibUI.table_model_row_changed(model, row)
347
+ @expanded_cell_rows_dependency_cell_rows = nil
337
348
  notify_custom_listeners('on_changed', row, :changed, @cell_rows[row])
338
349
  end
339
350
  end
@@ -76,6 +76,7 @@ module Glimmer
76
76
  option :table_editable, default: false
77
77
  option :per_page, default: 10
78
78
  option :page, default: 1
79
+ option :pagination, default: true
79
80
  option :visible_page_count, default: false
80
81
  option :filter_query, default: ''
81
82
  option :filter, default: FILTER_DEFAULT
@@ -85,6 +86,7 @@ module Glimmer
85
86
  attr_reader :table_proxy
86
87
 
87
88
  before_body do
89
+ self.per_page = 1_000_000_000 if !pagination
88
90
  init_model_array
89
91
  end
90
92
 
data/lib/glimmer/libui.rb CHANGED
@@ -50,11 +50,11 @@ module Glimmer
50
50
  result = if value.is_a?(Array)
51
51
  old_value = value
52
52
  value = {
53
- r: value[0],
54
- g: value[1],
55
- b: value[2],
53
+ r: old_value[0],
54
+ g: old_value[1],
55
+ b: old_value[2],
56
56
  }
57
- value[:a] = value[3] unless value[3].nil?
57
+ value[:a] = old_value[3] unless old_value[3].nil?
58
58
  value
59
59
  elsif value.is_a?(Hash)
60
60
  old_value = value
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: glimmer-dsl-libui
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0.pre.2
4
+ version: 0.6.0.pre.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andy Maleh
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-12-02 00:00:00.000000000 Z
11
+ date: 2022-12-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: glimmer