uh-layout 0.1.8 → 0.1.9
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/lib/uh/layout/bar.rb +14 -2
- data/lib/uh/layout/version.rb +1 -1
- data/lib/uh/layout.rb +1 -1
- data/spec/uh/layout_spec.rb +8 -0
- metadata +2 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0e7f4858efe8b6d9ee912cb9d44d079196afecec
|
4
|
+
data.tar.gz: 2310f35802017071d7e96d96c6e58e754fed081a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c8fc50f2837acf00921c01adb7b55b2cda10788c79ebdd110712e5545a945b88b08077cfcd7a20ca69b9262a76e87401e233351907ece31dc569e79a62f8b914
|
7
|
+
data.tar.gz: 1ea07ba5be3797274ff42007feb9386f0970738668a0d1c9e3323d7ce7fb57d4c1bab581810cf2cbf197af25ff40d5c6ccc73994d57606fd1617d35dc538865f
|
data/lib/uh/layout/bar.rb
CHANGED
@@ -10,7 +10,7 @@ module Uh
|
|
10
10
|
|
11
11
|
include GeoAccessors
|
12
12
|
|
13
|
-
attr_writer :active
|
13
|
+
attr_writer :active, :status
|
14
14
|
|
15
15
|
def initialize(display, screen, colors)
|
16
16
|
@display = display
|
@@ -40,6 +40,10 @@ module Uh
|
|
40
40
|
@screen.current_tag.columns, @screen.current_tag.current_column
|
41
41
|
draw_tags BORDER_HEIGHT + BORDER_PADDING_Y + text_line_height,
|
42
42
|
@screen.tags, @screen.current_tag
|
43
|
+
if @status
|
44
|
+
draw_status BORDER_HEIGHT + BORDER_PADDING_Y + text_line_height,
|
45
|
+
@status
|
46
|
+
end
|
43
47
|
blit
|
44
48
|
end
|
45
49
|
|
@@ -80,6 +84,10 @@ module Uh
|
|
80
84
|
@display.font.height + TEXT_PADDING_Y * 2
|
81
85
|
end
|
82
86
|
|
87
|
+
def text_width(text, padding_x: TEXT_PADDING_X)
|
88
|
+
text.length * @display.font.width + padding_x * 2
|
89
|
+
end
|
90
|
+
|
83
91
|
def column_offset_x(column)
|
84
92
|
column.x - x
|
85
93
|
end
|
@@ -134,9 +142,13 @@ module Uh
|
|
134
142
|
end
|
135
143
|
end
|
136
144
|
|
145
|
+
def draw_status(y_offset, status)
|
146
|
+
draw_text status, width - text_width(status), y_offset
|
147
|
+
end
|
148
|
+
|
137
149
|
def draw_text(text, x, y, bg: nil, padding_x: TEXT_PADDING_X)
|
138
150
|
text = text.to_s
|
139
|
-
text_width = text
|
151
|
+
text_width = text_width text, padding_x: padding_x
|
140
152
|
text_y = y + @display.font.ascent + TEXT_PADDING_Y
|
141
153
|
if bg
|
142
154
|
@pixmap.gc_color bg
|
data/lib/uh/layout/version.rb
CHANGED
data/lib/uh/layout.rb
CHANGED
data/spec/uh/layout_spec.rb
CHANGED
@@ -350,6 +350,14 @@ module Uh
|
|
350
350
|
end
|
351
351
|
end
|
352
352
|
|
353
|
+
context 'with one column and two clients' do
|
354
|
+
before { layout << client }
|
355
|
+
|
356
|
+
it 'does not raise any error' do
|
357
|
+
expect { layout.handle_client_swap :pred }.not_to raise_error
|
358
|
+
end
|
359
|
+
end
|
360
|
+
|
353
361
|
context 'with one column and two clients' do
|
354
362
|
before { layout << other_client << client }
|
355
363
|
|
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.
|
4
|
+
version: 0.1.9
|
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-
|
11
|
+
date: 2015-04-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: uh
|
@@ -126,4 +126,3 @@ test_files:
|
|
126
126
|
- spec/uh/layout/screen_spec.rb
|
127
127
|
- spec/uh/layout/tag_spec.rb
|
128
128
|
- spec/uh/layout_spec.rb
|
129
|
-
has_rdoc:
|