uh-layout 0.1.9 → 0.2.0.pre

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
  SHA1:
3
- metadata.gz: 0e7f4858efe8b6d9ee912cb9d44d079196afecec
4
- data.tar.gz: 2310f35802017071d7e96d96c6e58e754fed081a
3
+ metadata.gz: fc164691d2b3d8dc056de7e226bbd5b5bc3ace1d
4
+ data.tar.gz: 7165a0026736e62d2dbe3eff8685104db77f7949
5
5
  SHA512:
6
- metadata.gz: c8fc50f2837acf00921c01adb7b55b2cda10788c79ebdd110712e5545a945b88b08077cfcd7a20ca69b9262a76e87401e233351907ece31dc569e79a62f8b914
7
- data.tar.gz: 1ea07ba5be3797274ff42007feb9386f0970738668a0d1c9e3323d7ce7fb57d4c1bab581810cf2cbf197af25ff40d5c6ccc73994d57606fd1617d35dc538865f
6
+ metadata.gz: 162c88a8afceaa50dc189b20e4c711cd10754d10ede67d5877b7c57e31dd854a3dd28757ed2fa97bacbe04214590742799589603dc36fb0d87c398950bfa4fdc
7
+ data.tar.gz: 6b8426fb7d7c09244555b582f1ceed8edeeba0f503a07e8987788d0a2a65a9f4fcf46ad749ae58285b0cbe06d9fc1512e66dff34385cb5fe7f2f3dc5ea92e153
data/LICENSE ADDED
@@ -0,0 +1,30 @@
1
+ Copyright 2014 Thibault Jouan. All rights reserved.
2
+
3
+ Redistribution and use in source and binary forms, with or without
4
+ modification, are permitted provided that the following conditions are
5
+ met:
6
+
7
+ * Redistributions of source code must retain the above copyright
8
+ notice, this list of conditions and the following disclaimer.
9
+
10
+ * Redistributions in binary form must reproduce the above copyright
11
+ notice, this list of conditions and the following disclaimer in
12
+ the documentation and/or other materials provided with the
13
+ distribution.
14
+
15
+ * Neither the name of the software nor the names of its contributors
16
+ may be used to endorse or promote products derived from this
17
+ software without specific prior written permission.
18
+
19
+
20
+ THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS "AS IS" AND
21
+ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
23
+ PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS
24
+ BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
27
+ BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
28
+ WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
29
+ OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
30
+ IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
data/lib/uh/layout.rb CHANGED
@@ -18,6 +18,13 @@ module Uh
18
18
  RuntimeError = Class.new(RuntimeError)
19
19
  ArgumentError = Class.new(Error)
20
20
 
21
+ COLORS = {
22
+ fg: 'rgb:d0/d0/d0'.freeze,
23
+ bg: 'rgb:0c/0c/0c'.freeze,
24
+ sel: 'rgb:d7/00/5f'.freeze,
25
+ hi: 'rgb:82/00/3a'.freeze
26
+ }.freeze
27
+
21
28
  extend Forwardable
22
29
  def_delegator :@screens, :current, :current_screen
23
30
  def_delegator :current_screen, :==, :current_screen?
@@ -29,9 +36,22 @@ module Uh
29
36
  def initialize
30
37
  @screens = Container.new
31
38
  @widgets = []
39
+ @colors = COLORS
32
40
  @history = History.new
33
41
  end
34
42
 
43
+ def register(display)
44
+ display.screens.each do |screen|
45
+ @screens << scr = Screen.new(screen.id, screen.geo)
46
+ @widgets << bar = Bar.new(display, scr, @colors).show.focus
47
+ bar.on_update do
48
+ bar.active = current_screen? scr
49
+ end
50
+ scr.height = scr.height - bar.height
51
+ end
52
+ update_widgets
53
+ end
54
+
35
55
  def to_s
36
56
  Dumper.new(self).to_s
37
57
  end
@@ -1,5 +1,5 @@
1
1
  module Uh
2
2
  class Layout
3
- VERSION = '0.1.9'
3
+ VERSION = '0.2.0.pre'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: uh-layout
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.9
4
+ version: 0.2.0.pre
5
5
  platform: ruby
6
6
  authors:
7
7
  - Thibault Jouan
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-04-06 00:00:00.000000000 Z
11
+ date: 2015-04-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: uh
@@ -63,6 +63,7 @@ files:
63
63
  - ".travis.yml"
64
64
  - Gemfile
65
65
  - Guardfile
66
+ - LICENSE
66
67
  - Rakefile
67
68
  - lib/uh/layout.rb
68
69
  - lib/uh/layout/arrangers/fixed_width.rb
@@ -104,9 +105,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
104
105
  version: '0'
105
106
  required_rubygems_version: !ruby/object:Gem::Requirement
106
107
  requirements:
107
- - - ">="
108
+ - - ">"
108
109
  - !ruby/object:Gem::Version
109
- version: '0'
110
+ version: 1.3.1
110
111
  requirements: []
111
112
  rubyforge_project:
112
113
  rubygems_version: 2.4.5