gtk3app 4.0.210128 → 5.3.210919

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: 82fe60ac20bffaf0840a5df94109d2d842b1f409e6349b80a1f7f8e4061c1b91
4
- data.tar.gz: c7e9504cf4c894c049ecc08da84667746a5c17b372082e113b0ea34b4a00e261
3
+ metadata.gz: 4e50cd215059b6ac181c79bfefb5da19a22eb80a886779be41711ac91c292296
4
+ data.tar.gz: f11fb69cd896ff2435f8c894bd9c5e31019b05ded921cf1d7bd2f9579f007f51
5
5
  SHA512:
6
- metadata.gz: b54f387d4b6b6ca22fe60893bc4055a731261408bf72485f674b62c1a4bd94ea534b9d69bb609cb22494bb903003dd55b48b9d000a9bc6f5189eee79cc7508a1
7
- data.tar.gz: 271c4fc554b1e00d5601c789751d97127b1ee932dfd67b1c3db72ae193d6f5555394596157153b690fdfa6b416c7913b154f54b26491624369e84731991b428c
6
+ metadata.gz: ba23a03eb79edd5cfa6f4746f3826715a4c777a69030e92421925e1e88a8db29edd76c3529b9bb91bd3639309f54ee66fb69ff17a978687c98bfa5b077642ff0
7
+ data.tar.gz: c087515b10feaa0d0a4c593b78f2a1733b5b37b72fdd876a34033f8560dac0e559069ceec6a8ae12ed3e301cf131eadafac556b4f50070d04a3b6532936a2062
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Gtk3App
2
2
 
3
- * [VERSION 4.0.210128](https://github.com/carlosjhr64/gtk3app/releases)
3
+ * [VERSION 5.3.210919](https://github.com/carlosjhr64/gtk3app/releases)
4
4
  * [github](https://www.github.com/carlosjhr64/gtk3app)
5
5
  * [rubygems](https://rubygems.org/gems/gtk3app)
6
6
 
@@ -18,7 +18,7 @@ The other for your main stage area.
18
18
 
19
19
  ## INSTALL:
20
20
 
21
- ```shell
21
+ ```console
22
22
  $ sudo gem install gtk3app
23
23
  ```
24
24
 
@@ -46,6 +46,11 @@ directory fully explains the rest of what Gtk3App can do for you.
46
46
  * default application menu
47
47
  * minime window
48
48
 
49
+ ## EXEMPLAR:
50
+
51
+ * [gtk2passwordapp](https://github.com/carlosjhr64/gtk2passwordapp)
52
+
53
+ ![demo](examples/demo.png)
49
54
 
50
55
  ## LICENSE:
51
56
 
@@ -6,8 +6,9 @@ module Gtk3App
6
6
  Usage:
7
7
  #{File.basename $0} [:options+]
8
8
  Options:
9
- --notoggle Minime wont toggle decorated and keep above
10
- --notdecorated Dont decorate window
9
+ --minime \tReal minime
10
+ --notoggle \tMinime wont toggle decorated and keep above
11
+ --notdecorated\tDont decorate window
11
12
  HELP
12
13
 
13
14
  # CONFIG follows the following conventions:
@@ -16,7 +17,7 @@ module Gtk3App
16
17
  # * Hashes are all lower case.
17
18
  # * Lower case bang! keys have special meaning in Such.
18
19
  # * Note that method keys may have mixed case as the method itself.
19
- CONFIG = {
20
+ @@CONFIG = {
20
21
  # Application SHOULD modify LOGO to use it's own logo image.
21
22
  Logo: "#{UserSpace::XDG['data']}/gtk3app/logo.png",
22
23
  # Scale logo to this size.
@@ -103,4 +104,6 @@ module Gtk3App
103
104
  # s0 tells AppMenu not to connect to any signal, otherwise it assumes "clicked".
104
105
  app_menu!: [:APP_MENU, :app_menu, s0],
105
106
  }
107
+ CONFIG = lambda{|k| @@CONFIG[k]}
108
+ def CONFIG.to_h = @@CONFIG
106
109
  end
@@ -1,21 +1,21 @@
1
1
  module Gtk3App
2
2
  class << self
3
- # Gtk2App.run(version:String?, help:String?, klass:(Class | Module)?), appdir:String?, appname:String?, config:Hash?)
3
+ # Gtk3App.run(version:String?, help:String?, klass:(Class | Module)?), appdir:String?, appname:String?, config:Hash?)
4
4
  def run(**kw)
5
5
  kw[:appdir] ||= UserSpace.appdir
6
6
  ensure_keywords(kw)
7
7
  @options = HelpParser[kw[:version], kw[:help]]
8
8
  install(kw)
9
9
 
10
- Such::Thing.configure CONFIG
10
+ Such::Thing.configure @@CONFIG
11
11
  @main = Such::Window.new :main!, 'delete-event' do quit! end
12
12
  @main.set_decorated false if @options.notdecorated
13
13
 
14
14
  vbox = Such::Box.new @main, [:vertical]
15
15
  hbox = Such::Box.new vbox, [:horizontal]
16
16
 
17
- size = CONFIG[:LogoSize]
18
- @pixbuf = GdkPixbuf::Pixbuf.new(file:CONFIG[:Logo]).scale(size,size)
17
+ size = @@CONFIG[:LogoSize]
18
+ @pixbuf = GdkPixbuf::Pixbuf.new(file: @@CONFIG[:Logo]).scale(size,size)
19
19
  logo = Gtk3App::EventImage.new hbox, [pixbuf:@pixbuf]
20
20
  Gtk3App::AppMenu.new(logo, :app_menu!) do |widget,*e,signal|
21
21
  case signal
@@ -29,7 +29,11 @@ class << self
29
29
  @stage = Such::Expander.new vbox, :stage!
30
30
  @toolbar = Such::Expander.new hbox, :toolbar!
31
31
 
32
- kw[:klass]&.new(@stage, @toolbar, @options) or yield(@stage, @toolbar, @options)
32
+ if block_given?
33
+ yield(@stage, @toolbar, @options)
34
+ else
35
+ kw[:klass]&.new(@stage, @toolbar, @options)
36
+ end
33
37
 
34
38
  @minime = @fs = false
35
39
  @main.show_all
@@ -94,7 +98,7 @@ class << self
94
98
  end
95
99
 
96
100
  def help!
97
- system "#{CONFIG[:Open]} '#{CONFIG[:HelpFile]}'"
101
+ system(@@CONFIG[:Open], @@CONFIG[:HelpFile])
98
102
  end
99
103
 
100
104
  def minime!
@@ -106,6 +110,10 @@ class << self
106
110
  end
107
111
  @stage.set_expanded true
108
112
  @toolbar.set_expanded true
113
+ if @options.minime?
114
+ @stage.show
115
+ @toolbar.show
116
+ end
109
117
  else
110
118
  @minime = true
111
119
  unless @options.notoggle
@@ -114,6 +122,10 @@ class << self
114
122
  end
115
123
  @stage.set_expanded false
116
124
  @toolbar.set_expanded false
125
+ if @options.minime?
126
+ @stage.hide
127
+ @toolbar.hide
128
+ end
117
129
  @main.resize 1,1
118
130
  end
119
131
  end
@@ -146,7 +158,7 @@ class << self
146
158
  stub = UserSpace.new parser:RBON,
147
159
  appname:'gtk3app',
148
160
  config:"config-#{VERSION.semantic(0..1)}"
149
- stub.configures CONFIG
161
+ stub.configures @@CONFIG
150
162
 
151
163
  # :klass and :config flags user wants xdg maintainance.
152
164
  # :appname, :appdir, and :version are sanity checks.
@@ -158,7 +170,17 @@ class << self
158
170
  config:"config-#{kw[:version].semantic(0..1)}"
159
171
  app.configures kw[:config]
160
172
  end
161
- CONFIG.merge! kw[:config] if kw[:config]
173
+ # Pad-up klass::CONFIG and switch to it:
174
+ if cfg = kw[:config]
175
+ @@CONFIG.each do |k,v|
176
+ if cfg.key? k
177
+ $stderr.puts "Overriding Gtk3App::CONFIG[#{k}]" if $VERBOSE
178
+ else
179
+ cfg[k]=v
180
+ end
181
+ end
182
+ @@CONFIG = cfg
183
+ end
162
184
  end
163
185
  end
164
186
  end
data/lib/gtk3app.rb CHANGED
@@ -11,7 +11,7 @@ Such::Things.in Gtk::Widget
11
11
 
12
12
  # This Gem
13
13
  module Gtk3App
14
- VERSION = '4.0.210128'
14
+ VERSION = '5.3.210919'
15
15
 
16
16
  require 'gtk3app/config'
17
17
  require 'gtk3app/widgets'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gtk3app
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.210128
4
+ version: 5.3.210919
5
5
  platform: ruby
6
6
  authors:
7
- - carlosjhr64
7
+ - CarlosJHR64
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-01-28 00:00:00.000000000 Z
11
+ date: 2021-09-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: help_parser
@@ -16,40 +16,40 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '7.0'
19
+ version: '8.0'
20
20
  - - ">="
21
21
  - !ruby/object:Gem::Version
22
- version: 7.0.200907
22
+ version: 8.0.210917
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
26
26
  requirements:
27
27
  - - "~>"
28
28
  - !ruby/object:Gem::Version
29
- version: '7.0'
29
+ version: '8.0'
30
30
  - - ">="
31
31
  - !ruby/object:Gem::Version
32
- version: 7.0.200907
32
+ version: 8.0.210917
33
33
  - !ruby/object:Gem::Dependency
34
34
  name: user_space
35
35
  requirement: !ruby/object:Gem::Requirement
36
36
  requirements:
37
37
  - - "~>"
38
38
  - !ruby/object:Gem::Version
39
- version: '5.0'
39
+ version: '5.1'
40
40
  - - ">="
41
41
  - !ruby/object:Gem::Version
42
- version: 5.0.210123
42
+ version: 5.1.210201
43
43
  type: :runtime
44
44
  prerelease: false
45
45
  version_requirements: !ruby/object:Gem::Requirement
46
46
  requirements:
47
47
  - - "~>"
48
48
  - !ruby/object:Gem::Version
49
- version: '5.0'
49
+ version: '5.1'
50
50
  - - ">="
51
51
  - !ruby/object:Gem::Version
52
- version: 5.0.210123
52
+ version: 5.1.210201
53
53
  - !ruby/object:Gem::Dependency
54
54
  name: rafini
55
55
  requirement: !ruby/object:Gem::Requirement
@@ -99,7 +99,7 @@ dependencies:
99
99
  version: '3.4'
100
100
  - - ">="
101
101
  - !ruby/object:Gem::Version
102
- version: 3.4.3
102
+ version: 3.4.9
103
103
  type: :runtime
104
104
  prerelease: false
105
105
  version_requirements: !ruby/object:Gem::Requirement
@@ -109,27 +109,27 @@ dependencies:
109
109
  version: '3.4'
110
110
  - - ">="
111
111
  - !ruby/object:Gem::Version
112
- version: 3.4.3
112
+ version: 3.4.9
113
113
  - !ruby/object:Gem::Dependency
114
114
  name: such
115
115
  requirement: !ruby/object:Gem::Requirement
116
116
  requirements:
117
117
  - - "~>"
118
118
  - !ruby/object:Gem::Version
119
- version: '1.0'
119
+ version: '2.0'
120
120
  - - ">="
121
121
  - !ruby/object:Gem::Version
122
- version: 1.0.210117
122
+ version: 2.0.210201
123
123
  type: :runtime
124
124
  prerelease: false
125
125
  version_requirements: !ruby/object:Gem::Requirement
126
126
  requirements:
127
127
  - - "~>"
128
128
  - !ruby/object:Gem::Version
129
- version: '1.0'
129
+ version: '2.0'
130
130
  - - ">="
131
131
  - !ruby/object:Gem::Version
132
- version: 1.0.210117
132
+ version: 2.0.210201
133
133
  description: |
134
134
  Gtk3App provides a
135
135
  [Ruby Gnome Gtk3](https://rubygems.org/gems/gtk3)
@@ -168,8 +168,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
168
168
  - !ruby/object:Gem::Version
169
169
  version: '0'
170
170
  requirements:
171
- - 'ruby: ruby 3.0.0p0 (2020-12-25 revision 95aff21468) [x86_64-linux]'
172
- rubygems_version: 3.2.3
171
+ - 'ruby: ruby 3.0.2p107 (2021-07-07 revision 0db68f0233) [x86_64-linux]'
172
+ rubygems_version: 3.2.22
173
173
  signing_key:
174
174
  specification_version: 4
175
175
  summary: Gtk3App provides a [Ruby Gnome Gtk3](https://rubygems.org/gems/gtk3) application