glimmer-dsl-libui 0.2.1 → 0.2.2

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: 276e4ac15791c16e7f6b8816bba43b7a402484800bc1a11e84037e5511ec9b39
4
- data.tar.gz: b6fcc1cb1e2707452ab8e88140d40446e7e740e6b0d5d2241aa204ec59ee8a11
3
+ metadata.gz: e2d658816439f96cc50c56c93adb7a41798defb44470f47101d65d64fc09bb0d
4
+ data.tar.gz: 37abc1ee1f738d73110b9de2e5e9648c0f20d1a81fc928101b6f4d8bf5ca8e85
5
5
  SHA512:
6
- metadata.gz: 07a11c38a4d2e2a9ea043bab960c20b84cb148ba837d4293157b452a0851d51246373f1b031aa3c79680a28e56c2e95b33c0661c6949aa865a6182151b719872
7
- data.tar.gz: 53c5d5be2ca21d765d81e75d1b6924965536a7c34d5ba63899b7e37f7e2785c19eabf271fbbb801b899cb703ffa7d2ad4357c38dd6bce63673adcc3899b1e00a
6
+ metadata.gz: c7cbb8b5b0a37fef0d7ac89e4ddc7a18a73d9be0d82dbc58d801cc4a4bc1504dd60f803c8268083eb96fc52c2e807cbd300689a3744c9f43c7b5f1f15c778902
7
+ data.tar.gz: 63cfe0c72200e81b196e5cc4fa47473239bc2919db52c027abc5f62ea8de48573a793174d6d61fd2852cc2e19bbb0a5466f0fb6a881af7075bb1e8307c364384
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Change Log
2
2
 
3
+ ## 0.2.2
4
+
5
+ - Automatically add `vertical_box` parent to `area` if it did not have a box parent (otherwise, it seems not to show up on Linux, even when directly under `grid`)
6
+
3
7
  ## 0.2.1
4
8
 
5
9
  - Have examples/timer.rb show `msg_box` on finish
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.2.1
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.2.2
2
2
  ## Prerequisite-Free Ruby Desktop Development GUI Library
3
3
  [![Gem Version](https://badge.fury.io/rb/glimmer-dsl-libui.svg)](http://badge.fury.io/rb/glimmer-dsl-libui)
4
4
  [![Maintainability](https://api.codeclimate.com/v1/badges/ce2853efdbecf6ebdc73/maintainability)](https://codeclimate.com/github/AndyObtiva/glimmer-dsl-libui/maintainability)
@@ -197,7 +197,7 @@ Other [Glimmer](https://rubygems.org/gems/glimmer) DSL gems you might be interes
197
197
 
198
198
  ## Table of Contents
199
199
 
200
- - [Glimmer DSL for LibUI 0.2.1](#-glimmer-dsl-for-libui-021)
200
+ - [Glimmer DSL for LibUI 0.2.2](#-glimmer-dsl-for-libui-022)
201
201
  - [Glimmer GUI DSL Concepts](#glimmer-gui-dsl-concepts)
202
202
  - [Usage](#usage)
203
203
  - [Girb (Glimmer IRB)](#girb-glimmer-irb)
@@ -331,7 +331,7 @@ gem install glimmer-dsl-libui
331
331
  Or install via Bundler `Gemfile`:
332
332
 
333
333
  ```ruby
334
- gem 'glimmer-dsl-libui', '~> 0.2.1'
334
+ gem 'glimmer-dsl-libui', '~> 0.2.2'
335
335
  ```
336
336
 
337
337
  Add `require 'glimmer-dsl-libui'` at the top, and then `include Glimmer` into the top-level main object for testing or into an actual class for serious usage.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.1
1
+ 0.2.2
@@ -183,7 +183,7 @@ class ColorTheCircles
183
183
  }
184
184
  }
185
185
 
186
- vertical_box {
186
+ @area = area {
187
187
  left 0
188
188
  top 4
189
189
  hexpand true
@@ -191,30 +191,27 @@ class ColorTheCircles
191
191
  halign :fill
192
192
  valign :fill
193
193
 
194
- @area = area {
195
- on_draw do |area_draw_params|
194
+ on_draw do |area_draw_params|
195
+ path {
196
+ rectangle(0, 0, WINDOW_WIDTH, WINDOW_HEIGHT)
197
+
198
+ fill :white
199
+ }
200
+
201
+ @circles_data.each do |circle_data|
196
202
  path {
197
- rectangle(0, 0, WINDOW_WIDTH, WINDOW_HEIGHT)
203
+ circle_data[:circle] = circle(*circle_data[:args])
198
204
 
199
- fill :white
205
+ fill circle_data[:fill]
206
+ stroke circle_data[:stroke]
200
207
  }
201
-
202
- @circles_data.each do |circle_data|
203
- path {
204
- circle_data[:circle] = circle(*circle_data[:args])
205
-
206
- fill circle_data[:fill]
207
- stroke circle_data[:stroke]
208
- }
209
- end
210
- end
211
-
212
- on_mouse_down do |area_mouse_event|
213
- color_circle(area_mouse_event[:x], area_mouse_event[:y])
214
208
  end
215
- }
209
+ end
210
+
211
+ on_mouse_down do |area_mouse_event|
212
+ color_circle(area_mouse_event[:x], area_mouse_event[:y])
213
+ end
216
214
  }
217
-
218
215
  }
219
216
  }.show
220
217
  end
Binary file
@@ -60,7 +60,18 @@ module Glimmer
60
60
  end
61
61
 
62
62
  def post_add_content
63
- super
63
+ unless parent_proxy.is_a?(Box)
64
+ original_parent_proxy = @parent_proxy
65
+ @vertical_box_parent_proxy = ControlProxy.create('vertical_box', parent_proxy, []) {} # block prevents calling post add content
66
+ append_properties.each do |property|
67
+ @vertical_box_parent_proxy.append_property(property, append_property(property))
68
+ end
69
+ @vertical_box_parent_proxy.post_add_content
70
+ @parent_proxy = @vertical_box_parent_proxy
71
+ @vertical_box_parent_proxy.post_initialize_child(self)
72
+ else
73
+ super
74
+ end
64
75
  install_listeners
65
76
  end
66
77
 
@@ -72,7 +83,7 @@ module Glimmer
72
83
  def redraw
73
84
  queue_redraw_all
74
85
  end
75
-
86
+
76
87
  private
77
88
 
78
89
  def build_control
@@ -35,12 +35,6 @@ module Glimmer
35
35
  DEFAULT_HAS_MENUBAR = 1
36
36
 
37
37
  def post_initialize_child(child)
38
- if child.is_a?(AreaProxy)
39
- vertical_box_parent = ControlProxy.create('vertical_box', self, [])
40
- child.instance_variable_set(:@parent_proxy, vertical_box_parent)
41
- vertical_box_parent.post_initialize_child(child)
42
- child = vertical_box_parent
43
- end
44
38
  ::LibUI.window_set_child(@libui, child.libui)
45
39
  end
46
40
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: glimmer-dsl-libui
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andy Maleh