gtk2notify 0.1.3 → 0.2.1

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
  SHA1:
3
- metadata.gz: 9d2df4da594f3b242a08150b6422aaafd50d9aa0
4
- data.tar.gz: 7d620e0c4be4da078bba6465069f0806f7c6eace
3
+ metadata.gz: 9f45f9510e5a99b48ec561d9c8b4f88e10cbc6f1
4
+ data.tar.gz: 4c8d2f0390ddfcaf020e007fd1c7c5a6067d71af
5
5
  SHA512:
6
- metadata.gz: fc509433e1e5a884d79015820cd5b70599c03186f469392ed661de5b271b9f8afdebca5e712983ca45fd0d75f1febfb88b6dbfcae8cb9274a3c04ac3b8c00ad2
7
- data.tar.gz: b01e832a1170bee6717c594d5144fe01e5b251e444c71c7a53a93190566c2d26e69709de1858dcbfb7c338d39d7abbb5f62a896fbf745070f65f55393e8972bc
6
+ metadata.gz: 0d104fdb76fa26482cb5aa6755086abd9f0b65f4d01be85d95679a19cfe0df3af470f62fd01a50b167507e5016fbe1de9c85a0a2aa2cfd3f9368687a97dd201f
7
+ data.tar.gz: 9615ab24085f1069309f8d5c1e18b1498c592c253fb733bd7d8fdcadbe7844480b3c58eebbcd3bc8828746d00cbd1207dae2f2220ed93744a7c55a4d3e1a70e8
checksums.yaml.gz.sig CHANGED
Binary file
data.tar.gz.sig CHANGED
@@ -1,3 +1,4 @@
1
- pf���Ԥ����@�~�� �����YEW�//���`k���J�FIJ�y���io#]��y��v�<�8٢� ���S^K=HE��T>�y�� ��YgGFw9؟k���j2��yYp�6@����
2
- ������J }y,?� ���)q�B �q����$O����0ק�
3
- ��I2!Z��Ѽ ؃��@W䈂RNP�ۂ���F��F����Te��'��#�|���s.Ha)���@�Ïn:�
1
+ ���`���/91f`MO-h�w 2+��Vɋ$�+/F�5� l9�<�M��T|�r(���@vX|@xv'��iI6�|>P�Rӣh
2
+ 质�VJA�3N%�ͯ�Z���<Ų���ƀzz��k
3
+ _cM�&b0:�t����tK-�˺>er�k�D�o l2��G
4
+ �S�N�
data/lib/gtk2notify.rb CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  # file: gtk2notify.rb
4
4
 
5
- require 'gtk2'
5
+ require 'gtk2svg'
6
6
 
7
7
 
8
8
  # note: If calling this from within an EventMachine defer statement it
@@ -12,13 +12,33 @@ require 'gtk2'
12
12
  class GtkNotify
13
13
 
14
14
  def self.show(body: 'message body goes here', summary: '',
15
- timeout: 2.5, offset: {})
16
-
17
- offset = {x: 30, y: 10}.merge offset
18
-
19
- label = Gtk::Label.new(body)
20
- window = Gtk::Window.new
21
- window.add(label).show_all
15
+ timeout: 3.5, offset: {})
16
+
17
+ offset = {x: 100, y: 10}.merge offset
18
+
19
+ window = Gtk::Window.new
20
+ area = Gtk::DrawingArea.new
21
+
22
+ svg =<<SVG
23
+ <svg width="300" height="80">
24
+ <text x="20" y="10" fill="green">#{body}</text>
25
+ </svg>
26
+ SVG
27
+ doc = Svgle.new(svg, callback: self)
28
+ a = Gtk2SVG::Render.new(doc).to_a
29
+
30
+ area.signal_connect("expose_event") do
31
+ drawing = Gtk2SVG::DrawingInstructions.new area
32
+ drawing.render a
33
+ end
34
+
35
+ svg_width, svg_height = %i(width height).map{|x| doc.root.attributes[x].to_i }
36
+
37
+ if svg_width and svg_height then
38
+ window.set_default_size(svg_width, svg_height)
39
+ end
40
+
41
+ window.add(area).show_all
22
42
 
23
43
  window.decorated = false
24
44
  window.border_width = 10
@@ -40,4 +60,4 @@ if __FILE__ == $0 then
40
60
 
41
61
  GtkNotify.show body: 'Testing the notification system', offset: {x: 120}
42
62
 
43
- end
63
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gtk2notify
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
@@ -31,28 +31,28 @@ cert_chain:
31
31
  AXt2ZUjH/5OGnWgYaV5+l1o1BZmezZMqvwn13GPs71reWPIMBjHcy8b8J0eZuXtO
32
32
  YS4buZ4bwNVRnQ==
33
33
  -----END CERTIFICATE-----
34
- date: 2015-10-19 00:00:00.000000000 Z
34
+ date: 2015-11-24 00:00:00.000000000 Z
35
35
  dependencies:
36
36
  - !ruby/object:Gem::Dependency
37
- name: gtk2
37
+ name: gtk2svg
38
38
  requirement: !ruby/object:Gem::Requirement
39
39
  requirements:
40
40
  - - "~>"
41
41
  - !ruby/object:Gem::Version
42
- version: '3.0'
42
+ version: '0.3'
43
43
  - - ">="
44
44
  - !ruby/object:Gem::Version
45
- version: 3.0.7
45
+ version: 0.3.9
46
46
  type: :runtime
47
47
  prerelease: false
48
48
  version_requirements: !ruby/object:Gem::Requirement
49
49
  requirements:
50
50
  - - "~>"
51
51
  - !ruby/object:Gem::Version
52
- version: '3.0'
52
+ version: '0.3'
53
53
  - - ">="
54
54
  - !ruby/object:Gem::Version
55
- version: 3.0.7
55
+ version: 0.3.9
56
56
  description:
57
57
  email: james@r0bertson.co.uk
58
58
  executables: []
metadata.gz.sig CHANGED
Binary file