Strip public key
This commit is contained in:
parent
4361b6e4e3
commit
e60e0a353f
1 changed files with 9 additions and 2 deletions
|
@ -3,6 +3,8 @@
|
||||||
module Widgets
|
module Widgets
|
||||||
class Chat < VPanel
|
class Chat < VPanel
|
||||||
class Info < Base
|
class Info < Base
|
||||||
|
PUBLIC_KEY_LABEL = 'Public key: '
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
def draw
|
def draw
|
||||||
|
@ -33,9 +35,14 @@ module Widgets
|
||||||
addstr props[:status_message]
|
addstr props[:status_message]
|
||||||
|
|
||||||
setpos 0, 1
|
setpos 0, 1
|
||||||
addstr 'Public key: '
|
addstr PUBLIC_KEY_LABEL
|
||||||
|
if PUBLIC_KEY_LABEL.length + props[:public_key].length > props[:width]
|
||||||
|
width = props[:width] - PUBLIC_KEY_LABEL.length
|
||||||
|
addstr "#{props[:public_key][0...(width - 3)]}..."
|
||||||
|
else
|
||||||
addstr props[:public_key]
|
addstr props[:public_key]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
Reference in a new issue