Implement attributes for Curses::React::Nodes::TextLine
This commit is contained in:
parent
e1501a26f3
commit
a04191ecc9
2 changed files with 4 additions and 2 deletions
|
@ -17,8 +17,10 @@ module Curses
|
||||||
|
|
||||||
def draw
|
def draw
|
||||||
return if props[:text].nil?
|
return if props[:text].nil?
|
||||||
|
@window.attron props[:attr] if props[:attr]
|
||||||
setpos props[:x], props[:y]
|
setpos props[:x], props[:y]
|
||||||
addstr props[:text].ljustetc props[:width]
|
addstr props[:text].ljustetc props[:width]
|
||||||
|
@window.attroff props[:attr] if props[:attr]
|
||||||
end
|
end
|
||||||
|
|
||||||
def setpos(x, y)
|
def setpos(x, y)
|
||||||
|
|
|
@ -127,8 +127,6 @@ class Style
|
||||||
window.attroff message_error_attr
|
window.attroff message_error_attr
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
|
||||||
|
|
||||||
def logo_attr
|
def logo_attr
|
||||||
Curses.color_pair(logo_id) | Curses::A_BOLD
|
Curses.color_pair(logo_id) | Curses::A_BOLD
|
||||||
end
|
end
|
||||||
|
@ -185,6 +183,8 @@ private
|
||||||
Curses.color_pair message_error_id
|
Curses.color_pair message_error_id
|
||||||
end
|
end
|
||||||
|
|
||||||
|
private
|
||||||
|
|
||||||
def logo_id
|
def logo_id
|
||||||
@logo_id ||= self.class.counter
|
@logo_id ||= self.class.counter
|
||||||
end
|
end
|
||||||
|
|
Reference in a new issue