zui 0.0.3 → 0.0.4
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 +4 -4
- data/README.md +16 -9
- data/lib/zui/builder.rb +5 -1
- data/lib/zui.rb +1 -1
- 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: 4f7497623e2aa2ca54d53fd2277df4d269a0c4bbe27390ae86deb684f018999e
|
|
4
|
+
data.tar.gz: d1ff665f49ed5a91b54d17637007448255a22cdaeb138bd0174d9d7e5e36c4b7
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: dfec98d445bfbae73efd1cc6011e87f15cddce1b13f983244979e808c80bd3bab8e2f174fa67a18bb8eaaa23f6c847ea9bd594d06241d71b5c0515c9616541af
|
|
7
|
+
data.tar.gz: 3ccb5696a474522671beacb24e36dc78d07f63d0115ba4d4c152bb7fdae92a2d6f602d31022648ef61f7f8ff1a31ab48702b3b77c3572857b7a7b16e7033a195
|
data/README.md
CHANGED
|
@@ -23,18 +23,25 @@ Quickshell or an Omarchy installation.
|
|
|
23
23
|
```ruby
|
|
24
24
|
require "zui"
|
|
25
25
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
26
|
+
module Counter
|
|
27
|
+
def self.run
|
|
28
|
+
Zui.app do
|
|
29
|
+
state :count, 0
|
|
30
|
+
|
|
31
|
+
app :main, title: "Counter", width: 640, height: 420 do
|
|
32
|
+
column spacing: 16, padding: 24 do
|
|
33
|
+
label "Counter"
|
|
34
|
+
text { "Count: #{state.count}" }
|
|
35
|
+
button "Increment" do
|
|
36
|
+
state.count += 1
|
|
37
|
+
end
|
|
38
|
+
end
|
|
34
39
|
end
|
|
35
40
|
end
|
|
36
41
|
end
|
|
37
42
|
end
|
|
43
|
+
|
|
44
|
+
Counter.run
|
|
38
45
|
```
|
|
39
46
|
|
|
40
47
|
## Developer workflow
|
|
@@ -52,7 +59,7 @@ Build and install the gem directly from a checkout:
|
|
|
52
59
|
|
|
53
60
|
```bash
|
|
54
61
|
gem build zui.gemspec
|
|
55
|
-
gem install ./zui-0.0.
|
|
62
|
+
gem install ./zui-0.0.4.gem
|
|
56
63
|
```
|
|
57
64
|
|
|
58
65
|
`zui doctor --fix` is the one-time setup for each Zui version and platform. It downloads the
|
data/lib/zui/builder.rb
CHANGED
|
@@ -101,7 +101,11 @@ module Zui
|
|
|
101
101
|
node
|
|
102
102
|
end
|
|
103
103
|
|
|
104
|
-
def label(value, id: nil, **props
|
|
104
|
+
def label(value = UNSET, id: nil, **props, &reader)
|
|
105
|
+
node = component(:label, id:, **props)
|
|
106
|
+
bind_or_set(node, "text", value, reader)
|
|
107
|
+
node
|
|
108
|
+
end
|
|
105
109
|
def rich_text(markup, id: nil, **props) = component(:rich_text, id:, text: markup.to_s, **props)
|
|
106
110
|
def markdown(source, id: nil, **props) = component(:markdown, id:, text: source.to_s, **props)
|
|
107
111
|
def selectable_text(value, id: nil, **props) = component(:selectable_text, id:, text: value.to_s, **props)
|
data/lib/zui.rb
CHANGED