glimmer-dsl-libui 0.12.4 → 0.12.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -0
- data/README.md +19 -3
- data/VERSION +1 -1
- data/glimmer-dsl-libui.gemspec +0 -0
- data/lib/glimmer/libui/content_bindable.rb +19 -0
- data/lib/glimmer/libui/control_proxy/editable_combobox_proxy.rb +8 -2
- data/lib/glimmer/libui/control_proxy.rb +2 -14
- data/lib/glimmer/libui/shape.rb +2 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b904f97a0c6ac0f1ab428f1e000325a9ddfee1dfdd5a4d5be71592039ed0c2e0
|
4
|
+
data.tar.gz: 7479c1ca847c105939752122ab0fa8a6319f14e9c68a38ab7a241dbec5947a38
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0a0ca4e301ce0a7edc45af0fb66933ca397c6b653af49688fd86276bb205d90e930a27949abf09e499fc92e66685baa26780a02565059ff26d43fd74a1605fdd
|
7
|
+
data.tar.gz: 02ee7881c7ef54310b5c7a977a63f4fb03ec57f481c7b0c5659846e916e5846e659061a2de66815f69ffa88d2c58f6dc2e332568e07f1d080dace48eb3598e53
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,13 @@
|
|
1
1
|
# Change Log
|
2
2
|
|
3
|
+
## 0.12.6
|
4
|
+
|
5
|
+
- Shape Content Data-Binding
|
6
|
+
|
7
|
+
## 0.12.5
|
8
|
+
|
9
|
+
- Prevent duplication of items in editable_combobox when updating items with an array that contains duplicates
|
10
|
+
|
3
11
|
## 0.12.4
|
4
12
|
|
5
13
|
- Fix issue #67 (The Japanese text is displayed strangely), thanks to PR #68 by @junogura
|
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.12.
|
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.12.6
|
2
2
|
## Prerequisite-Free Ruby Desktop Development Cross-Platform Native GUI Library ([Fukuoka Award Winning](http://www.digitalfukuoka.jp/topics/187?locale=ja))
|
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)
|
@@ -349,7 +349,7 @@ Mac | Windows | Linux
|
|
349
349
|
----|---------|------
|
350
350
|
![glimmer-dsl-libui-mac-area-gallery.png](images/glimmer-dsl-libui-mac-area-gallery.png) | ![glimmer-dsl-libui-windows-area-gallery.png](images/glimmer-dsl-libui-windows-area-gallery.png) | ![glimmer-dsl-libui-linux-area-gallery.png](images/glimmer-dsl-libui-linux-area-gallery.png)
|
351
351
|
|
352
|
-
[Check
|
352
|
+
[Check out many more examples over here!](#examples)
|
353
353
|
|
354
354
|
[![glimmer-dsl-libui-mac-snake.gif](images/glimmer-dsl-libui-mac-snake.gif)](/docs/examples/GLIMMER-DSL-LIBUI-ADVANCED-EXAMPLES.md#snake)
|
355
355
|
|
@@ -357,6 +357,14 @@ Mac | Windows | Linux
|
|
357
357
|
|
358
358
|
[![glimmer-dsl-libui-mac-tetris.gif](images/glimmer-dsl-libui-mac-tetris.gif)](/docs/examples/GLIMMER-DSL-LIBUI-ADVANCED-EXAMPLES.md#tetris)
|
359
359
|
|
360
|
+
[Check out many real apps built with Glimmer DSL for LibUI over here!](#applications)
|
361
|
+
|
362
|
+
![kuiq](https://raw.githubusercontent.com/mperham/kuiq/main/misc/ui.png)
|
363
|
+
|
364
|
+
![rubio-radio](https://raw.githubusercontent.com/kojix2/rubio-radio/main/screenshots/rubio-radio-linux.png)
|
365
|
+
|
366
|
+
![Ruby Go](/images/glimmer-dsl-libui-mac-application-ruby-go.png)
|
367
|
+
|
360
368
|
NOTE: [Glimmer DSL for LibUI](https://rubygems.org/gems/glimmer-dsl-libui) is regularly catching up with changes in the C [libui-ng](https://github.com/libui-ng/libui-ng) library API and in beta mode. The C [libui-ng](https://github.com/libui-ng/libui-ng) is still mid-alpha, which is why [Glimmer DSL for LibUI](https://rubygems.org/gems/glimmer-dsl-libui) cannot be declared v1.0.0 yet. Please help make better by contributing, adopting for small or low risk projects, and providing feedback. The more feedback and issues you report the better.
|
361
369
|
|
362
370
|
Learn more about the differences between various [Glimmer](https://github.com/AndyObtiva/glimmer) DSLs by looking at the **[Glimmer DSL Comparison Table](https://github.com/AndyObtiva/glimmer#glimmer-dsl-comparison-table)**.
|
@@ -456,7 +464,7 @@ gem install glimmer-dsl-libui
|
|
456
464
|
Or install via Bundler `Gemfile`:
|
457
465
|
|
458
466
|
```ruby
|
459
|
-
gem 'glimmer-dsl-libui', '~> 0.12.
|
467
|
+
gem 'glimmer-dsl-libui', '~> 0.12.6'
|
460
468
|
```
|
461
469
|
|
462
470
|
Test that installation worked by running the [Glimmer Meta-Example](#examples):
|
@@ -4509,6 +4517,14 @@ https://github.com/timbot1789/rubygo
|
|
4509
4517
|
|
4510
4518
|
![Ruby Go](/images/glimmer-dsl-libui-mac-application-ruby-go.png)
|
4511
4519
|
|
4520
|
+
### Kuiq - Sidekiq UI
|
4521
|
+
|
4522
|
+
The Sidekiq dashboard as a desktop application.
|
4523
|
+
|
4524
|
+
https://github.com/mperham/kuiq
|
4525
|
+
|
4526
|
+
![kuiq](https://raw.githubusercontent.com/mperham/kuiq/main/misc/ui.png)
|
4527
|
+
|
4512
4528
|
## Design Principles
|
4513
4529
|
|
4514
4530
|
- The Ruby Way (including TIMTOWTDI: There Is More Than One Way To Do It)
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.12.
|
1
|
+
0.12.6
|
data/glimmer-dsl-libui.gemspec
CHANGED
Binary file
|
@@ -0,0 +1,19 @@
|
|
1
|
+
module Glimmer
|
2
|
+
module LibUI
|
3
|
+
module ContentBindable
|
4
|
+
# Data-binds the generation of nested content to a model/property (in binding args)
|
5
|
+
# consider providing an option to avoid initial rendering without any changes happening
|
6
|
+
def bind_content(*binding_args, &content_block)
|
7
|
+
# TODO in the future, consider optimizing code by diffing content if that makes sense
|
8
|
+
content_binding_work = proc do |*values|
|
9
|
+
children.dup.each { |child| child.destroy }
|
10
|
+
content(&content_block)
|
11
|
+
end
|
12
|
+
model_binding_observer = Glimmer::DataBinding::ModelBinding.new(*binding_args)
|
13
|
+
content_binding_observer = Glimmer::DataBinding::Observer.proc(&content_binding_work)
|
14
|
+
content_binding_observer.observe(model_binding_observer)
|
15
|
+
content_binding_work.call # TODO inspect if we need to pass args here (from observed attributes) [but it's simpler not to pass anything at first]
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -33,8 +33,14 @@ module Glimmer
|
|
33
33
|
if values.empty?
|
34
34
|
@values
|
35
35
|
else
|
36
|
-
@values
|
37
|
-
|
36
|
+
@values ||= []
|
37
|
+
values.each do |value|
|
38
|
+
unless @values.include?(value)
|
39
|
+
append(value)
|
40
|
+
@values << value
|
41
|
+
end
|
42
|
+
end
|
43
|
+
@values
|
38
44
|
end
|
39
45
|
end
|
40
46
|
alias set_items items
|
@@ -20,6 +20,7 @@
|
|
20
20
|
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
21
21
|
|
22
22
|
require 'glimmer/libui/data_bindable'
|
23
|
+
require 'glimmer/libui/content_bindable'
|
23
24
|
require 'glimmer/libui/parent'
|
24
25
|
|
25
26
|
module Glimmer
|
@@ -105,6 +106,7 @@ module Glimmer
|
|
105
106
|
end
|
106
107
|
|
107
108
|
include DataBindable
|
109
|
+
include ContentBindable
|
108
110
|
prepend Parent
|
109
111
|
|
110
112
|
KEYWORD_ALIASES = {
|
@@ -395,20 +397,6 @@ module Glimmer
|
|
395
397
|
Glimmer::DSL::Engine.add_content(self, Glimmer::DSL::Libui::ControlExpression.new, @keyword, {post_add_content: @content_added}, &block)
|
396
398
|
end
|
397
399
|
|
398
|
-
# Data-binds the generation of nested content to a model/property (in binding args)
|
399
|
-
# consider providing an option to avoid initial rendering without any changes happening
|
400
|
-
def bind_content(*binding_args, &content_block)
|
401
|
-
# TODO in the future, consider optimizing code by diffing content if that makes sense
|
402
|
-
content_binding_work = proc do |*values|
|
403
|
-
children.dup.each { |child| child.destroy }
|
404
|
-
content(&content_block)
|
405
|
-
end
|
406
|
-
model_binding_observer = Glimmer::DataBinding::ModelBinding.new(*binding_args)
|
407
|
-
content_binding_observer = Glimmer::DataBinding::Observer.proc(&content_binding_work)
|
408
|
-
content_binding_observer.observe(model_binding_observer)
|
409
|
-
content_binding_work.call # TODO inspect if we need to pass args here (from observed attributes) [but it's simpler not to pass anything at first]
|
410
|
-
end
|
411
|
-
|
412
400
|
private
|
413
401
|
|
414
402
|
def build_control
|
data/lib/glimmer/libui/shape.rb
CHANGED
@@ -23,6 +23,7 @@ require 'glimmer/libui/parent'
|
|
23
23
|
require 'glimmer/libui/control_proxy/area_proxy'
|
24
24
|
require 'glimmer/libui/control_proxy/path_proxy'
|
25
25
|
require 'glimmer/libui/data_bindable'
|
26
|
+
require 'glimmer/libui/content_bindable'
|
26
27
|
require 'glimmer/libui/perfect_shaped'
|
27
28
|
|
28
29
|
module Glimmer
|
@@ -72,6 +73,7 @@ module Glimmer
|
|
72
73
|
include Parent
|
73
74
|
include PerfectShaped
|
74
75
|
include DataBindable
|
76
|
+
include ContentBindable
|
75
77
|
|
76
78
|
KEYWORD_ALIASES = {
|
77
79
|
'shape' => 'composite_shape',
|
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.12.
|
4
|
+
version: 0.12.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andy Maleh
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-12-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: glimmer
|
@@ -526,6 +526,7 @@ files:
|
|
526
526
|
- lib/glimmer/launcher.rb
|
527
527
|
- lib/glimmer/libui.rb
|
528
528
|
- lib/glimmer/libui/attributed_string.rb
|
529
|
+
- lib/glimmer/libui/content_bindable.rb
|
529
530
|
- lib/glimmer/libui/control_proxy.rb
|
530
531
|
- lib/glimmer/libui/control_proxy/area_proxy.rb
|
531
532
|
- lib/glimmer/libui/control_proxy/area_proxy/scrolling_area_proxy.rb
|