Archived
1
0
Fork 0
This repository has been archived on 2023-03-27. You can view files and clone it, but cannot push or open issues or pull requests.
cli-old/lib/widgets/chat/info.rb

42 lines
869 B
Ruby
Raw Normal View History

2017-07-22 04:16:58 -04:00
# frozen_string_literal: true
module Widgets
2017-07-22 05:00:28 -04:00
class Chat < VPanel
class Info < Base
2017-07-25 10:48:37 -04:00
private
2017-07-22 09:03:10 -04:00
def draw
2017-07-22 10:31:38 -04:00
setpos 0, 0
2017-07-25 23:58:05 -04:00
case props[:status]
when Tox::UserStatus::NONE
Style.default.online_mark window do
addstr '[Online]'
end
when Tox::UserStatus::AWAY
Style.default.away_mark window do
addstr '[Away]'
end
when Tox::UserStatus::BUSY
Style.default.busy_mark window do
addstr '[Busy]'
end
else
addstr '[Unknown]'
2017-07-22 07:49:55 -04:00
end
2017-07-25 23:58:05 -04:00
2017-07-22 14:46:50 -04:00
addstr ' '
2017-07-24 05:52:42 -04:00
Style.default.peer_info_name window do
2017-07-25 10:36:28 -04:00
addstr props[:name]
2017-07-22 07:49:55 -04:00
end
2017-07-25 23:32:16 -04:00
addstr ' : '
addstr props[:status_message]
2017-07-22 07:49:55 -04:00
2017-07-22 10:31:38 -04:00
setpos 0, 1
2017-07-22 14:46:50 -04:00
addstr 'Public key: '
2017-07-25 10:36:28 -04:00
addstr props[:public_key]
2017-07-22 07:49:55 -04:00
end
2017-07-22 04:16:58 -04:00
end
end
end