Commit a1af8a49 authored by Link Mauve's avatar Link Mauve

Store get_theme() in a variable in each function, to avoid redundant calls.

parent 7d6cd695
...@@ -1270,71 +1270,40 @@ class HandlerCore: ...@@ -1270,71 +1270,40 @@ class HandlerCore:
semi_anon = '173' in status_codes semi_anon = '173' in status_codes
full_anon = '174' in status_codes full_anon = '174' in status_codes
modif = False modif = False
info_col = {'info_col': dump_tuple(get_theme().COLOR_INFORMATION_TEXT)}
if show_unavailable or hide_unavailable or non_priv or logging_off\ if show_unavailable or hide_unavailable or non_priv or logging_off\
or non_anon or semi_anon or full_anon: or non_anon or semi_anon or full_anon:
tab.add_message( tab.add_message(
'\x19%(info_col)s}Info: A configuration change not privacy-related occurred.' '\x19%(info_col)s}Info: A configuration change not privacy-related occurred.' % info_col
% {
'info_col': dump_tuple(
get_theme().COLOR_INFORMATION_TEXT)
},
typ=2) typ=2)
modif = True modif = True
if show_unavailable: if show_unavailable:
tab.add_message( tab.add_message(
'\x19%(info_col)s}Info: The unavailable members are now shown.' '\x19%(info_col)s}Info: The unavailable members are now shown.' % info_col
% {
'info_col': dump_tuple(
get_theme().COLOR_INFORMATION_TEXT)
},
typ=2) typ=2)
elif hide_unavailable: elif hide_unavailable:
tab.add_message( tab.add_message(
'\x19%(info_col)s}Info: The unavailable members are now hidden.' '\x19%(info_col)s}Info: The unavailable members are now hidden.' % info_col
% {
'info_col': dump_tuple(
get_theme().COLOR_INFORMATION_TEXT)
},
typ=2) typ=2)
if non_anon: if non_anon:
tab.add_message( tab.add_message(
'\x191}Warning:\x19%(info_col)s} The room is now not anonymous. (public JID)' '\x191}Warning:\x19%(info_col)s} The room is now not anonymous. (public JID)' % info_col
% {
'info_col': dump_tuple(
get_theme().COLOR_INFORMATION_TEXT)
},
typ=2) typ=2)
elif semi_anon: elif semi_anon:
tab.add_message( tab.add_message(
'\x19%(info_col)s}Info: The room is now semi-anonymous. (moderators-only JID)' '\x19%(info_col)s}Info: The room is now semi-anonymous. (moderators-only JID)' % info_col
% {
'info_col': dump_tuple(
get_theme().COLOR_INFORMATION_TEXT)
},
typ=2) typ=2)
elif full_anon: elif full_anon:
tab.add_message( tab.add_message(
'\x19%(info_col)s}Info: The room is now fully anonymous.' % '\x19%(info_col)s}Info: The room is now fully anonymous.' % info_col
{
'info_col': dump_tuple(
get_theme().COLOR_INFORMATION_TEXT)
},
typ=2) typ=2)
if logging_on: if logging_on:
tab.add_message( tab.add_message(
'\x191}Warning: \x19%(info_col)s}This room is publicly logged' '\x191}Warning: \x19%(info_col)s}This room is publicly logged' % info_col
% {
'info_col': dump_tuple(
get_theme().COLOR_INFORMATION_TEXT)
},
typ=2) typ=2)
elif logging_off: elif logging_off:
tab.add_message( tab.add_message(
'\x19%(info_col)s}Info: This room is not logged anymore.' % '\x19%(info_col)s}Info: This room is not logged anymore.' % info_col
{
'info_col': dump_tuple(
get_theme().COLOR_INFORMATION_TEXT)
},
typ=2) typ=2)
if modif: if modif:
self.core.refresh_window() self.core.refresh_window()
...@@ -1352,9 +1321,10 @@ class HandlerCore: ...@@ -1352,9 +1321,10 @@ class HandlerCore:
if subject != tab.topic: if subject != tab.topic:
# Do not display the message if the subject did not change or if we # Do not display the message if the subject did not change or if we
# receive an empty topic when joining the room. # receive an empty topic when joining the room.
theme = get_theme()
fmt = { fmt = {
'info_col': dump_tuple(get_theme().COLOR_INFORMATION_TEXT), 'info_col': dump_tuple(theme.COLOR_INFORMATION_TEXT),
'text_col': dump_tuple(get_theme().COLOR_NORMAL_TEXT), 'text_col': dump_tuple(theme.COLOR_NORMAL_TEXT),
'subject': subject, 'subject': subject,
'user': '', 'user': '',
} }
...@@ -1448,17 +1418,18 @@ class HandlerCore: ...@@ -1448,17 +1418,18 @@ class HandlerCore:
xhtml_text, force=True).rstrip('\x19o').strip() xhtml_text, force=True).rstrip('\x19o').strip()
else: else:
poezio_colored = str(stanza) poezio_colored = str(stanza)
char = get_theme().CHAR_XML_OUT
self.core.add_message_to_text_buffer( self.core.add_message_to_text_buffer(
self.core.xml_buffer, self.core.xml_buffer,
poezio_colored, poezio_colored,
nickname=get_theme().CHAR_XML_OUT) nickname=char)
try: try:
if self.core.xml_tab.match_stanza( if self.core.xml_tab.match_stanza(
ElementBase(ET.fromstring(stanza))): ElementBase(ET.fromstring(stanza))):
self.core.add_message_to_text_buffer( self.core.add_message_to_text_buffer(
self.core.xml_tab.filtered_buffer, self.core.xml_tab.filtered_buffer,
poezio_colored, poezio_colored,
nickname=get_theme().CHAR_XML_OUT) nickname=char)
except: except:
log.debug('', exc_info=True) log.debug('', exc_info=True)
...@@ -1477,16 +1448,17 @@ class HandlerCore: ...@@ -1477,16 +1448,17 @@ class HandlerCore:
xhtml_text, force=True).rstrip('\x19o').strip() xhtml_text, force=True).rstrip('\x19o').strip()
else: else:
poezio_colored = str(stanza) poezio_colored = str(stanza)
char = get_theme().CHAR_XML_IN
self.core.add_message_to_text_buffer( self.core.add_message_to_text_buffer(
self.core.xml_buffer, self.core.xml_buffer,
poezio_colored, poezio_colored,
nickname=get_theme().CHAR_XML_IN) nickname=char)
try: try:
if self.core.xml_tab.match_stanza(stanza): if self.core.xml_tab.match_stanza(stanza):
self.core.add_message_to_text_buffer( self.core.add_message_to_text_buffer(
self.core.xml_tab.filtered_buffer, self.core.xml_tab.filtered_buffer,
poezio_colored, poezio_colored,
nickname=get_theme().CHAR_XML_IN) nickname=char)
except: except:
log.debug('', exc_info=True) log.debug('', exc_info=True)
if isinstance(self.core.tabs.current_tab, tabs.XMLTab): if isinstance(self.core.tabs.current_tab, tabs.XMLTab):
......
...@@ -157,13 +157,14 @@ class MucTab(ChatTab): ...@@ -157,13 +157,14 @@ class MucTab(ChatTab):
def leave_room(self, message: str): def leave_room(self, message: str):
if self.joined: if self.joined:
info_col = dump_tuple(get_theme().COLOR_INFORMATION_TEXT) theme = get_theme()
char_quit = get_theme().CHAR_QUIT info_col = dump_tuple(theme.COLOR_INFORMATION_TEXT)
spec_col = dump_tuple(get_theme().COLOR_QUIT_CHAR) char_quit = theme.CHAR_QUIT
spec_col = dump_tuple(theme.COLOR_QUIT_CHAR)
if config.get_by_tabname('display_user_color_in_join_part', if config.get_by_tabname('display_user_color_in_join_part',
self.general_jid): self.general_jid):
color = dump_tuple(get_theme().COLOR_OWN_NICK) color = dump_tuple(theme.COLOR_OWN_NICK)
else: else:
color = "3" color = "3"
...@@ -301,8 +302,9 @@ class MucTab(ChatTab): ...@@ -301,8 +302,9 @@ class MucTab(ChatTab):
""" """
Print the current topic Print the current topic
""" """
info_text = dump_tuple(get_theme().COLOR_INFORMATION_TEXT) theme = get_theme()
norm_text = dump_tuple(get_theme().COLOR_NORMAL_TEXT) info_text = dump_tuple(theme.COLOR_INFORMATION_TEXT)
norm_text = dump_tuple(theme.COLOR_NORMAL_TEXT)
if self.topic_from: if self.topic_from:
user = self.get_user_by_name(self.topic_from) user = self.get_user_by_name(self.topic_from)
if user: if user:
...@@ -521,7 +523,8 @@ class MucTab(ChatTab): ...@@ -521,7 +523,8 @@ class MucTab(ChatTab):
if (self.core.tabs.current_tab is self if (self.core.tabs.current_tab is self
and self.core.status.show not in ('xa', 'away')): and self.core.status.show not in ('xa', 'away')):
self.send_chat_state('active') self.send_chat_state('active')
new_user.color = get_theme().COLOR_OWN_NICK theme = get_theme()
new_user.color = theme.COLOR_OWN_NICK
if config.get_by_tabname('display_user_color_in_join_part', if config.get_by_tabname('display_user_color_in_join_part',
self.general_jid): self.general_jid):
...@@ -529,14 +532,14 @@ class MucTab(ChatTab): ...@@ -529,14 +532,14 @@ class MucTab(ChatTab):
else: else:
color = "3" color = "3"
info_col = dump_tuple(get_theme().COLOR_INFORMATION_TEXT) info_col = dump_tuple(theme.COLOR_INFORMATION_TEXT)
warn_col = dump_tuple(get_theme().COLOR_WARNING_TEXT) warn_col = dump_tuple(theme.COLOR_WARNING_TEXT)
spec_col = dump_tuple(get_theme().COLOR_JOIN_CHAR) spec_col = dump_tuple(theme.COLOR_JOIN_CHAR)
enable_message = ('\x19%(color_spec)s}%(spec)s\x19%(info_col)s} You ' enable_message = ('\x19%(color_spec)s}%(spec)s\x19%(info_col)s} You '
'(\x19%(nick_col)s}%(nick)s\x19%(info_col)s}) joined' '(\x19%(nick_col)s}%(nick)s\x19%(info_col)s}) joined'
' the room') % { ' the room') % {
'nick': from_nick, 'nick': from_nick,
'spec': get_theme().CHAR_JOIN, 'spec': theme.CHAR_JOIN,
'color_spec': spec_col, 'color_spec': spec_col,
'nick_col': color, 'nick_col': color,
'info_col': info_col, 'info_col': info_col,
...@@ -651,9 +654,10 @@ class MucTab(ChatTab): ...@@ -651,9 +654,10 @@ class MucTab(ChatTab):
color = dump_tuple(user.color) color = dump_tuple(user.color)
else: else:
color = 3 color = 3
info_col = dump_tuple(get_theme().COLOR_INFORMATION_TEXT) theme = get_theme()
spec_col = dump_tuple(get_theme().COLOR_JOIN_CHAR) info_col = dump_tuple(theme.COLOR_INFORMATION_TEXT)
char_join = get_theme().CHAR_JOIN spec_col = dump_tuple(theme.COLOR_JOIN_CHAR)
char_join = theme.CHAR_JOIN
if not jid.full: if not jid.full:
msg = ('\x19%(color_spec)s}%(spec)s \x19%(color)s}%(nick)s' msg = ('\x19%(color_spec)s}%(spec)s \x19%(color)s}%(nick)s'
'\x19%(info_col)s} joined the room') % { '\x19%(info_col)s} joined the room') % {
...@@ -672,7 +676,7 @@ class MucTab(ChatTab): ...@@ -672,7 +676,7 @@ class MucTab(ChatTab):
'color': color, 'color': color,
'jid': jid.full, 'jid': jid.full,
'info_col': info_col, 'info_col': info_col,
'jid_color': dump_tuple(get_theme().COLOR_MUC_JID), 'jid_color': dump_tuple(theme.COLOR_MUC_JID),
'color_spec': spec_col, 'color_spec': spec_col,
} }
self.add_message(msg, typ=2) self.add_message(msg, typ=2)
...@@ -731,8 +735,9 @@ class MucTab(ChatTab): ...@@ -731,8 +735,9 @@ class MucTab(ChatTab):
else: else:
by = None by = None
info_col = dump_tuple(get_theme().COLOR_INFORMATION_TEXT) theme = get_theme()
char_kick = get_theme().CHAR_KICK info_col = dump_tuple(theme.COLOR_INFORMATION_TEXT)
char_kick = theme.CHAR_KICK
if from_nick == self.own_nick: # we are banned if from_nick == self.own_nick: # we are banned
if by: if by:
...@@ -807,8 +812,9 @@ class MucTab(ChatTab): ...@@ -807,8 +812,9 @@ class MucTab(ChatTab):
reason = presence.xml.find('{%s}x/{%s}item/{%s}reason' % reason = presence.xml.find('{%s}x/{%s}item/{%s}reason' %
(NS_MUC_USER, NS_MUC_USER, NS_MUC_USER)) (NS_MUC_USER, NS_MUC_USER, NS_MUC_USER))
by = None by = None
info_col = dump_tuple(get_theme().COLOR_INFORMATION_TEXT) theme = get_theme()
char_kick = get_theme().CHAR_KICK info_col = dump_tuple(theme.COLOR_INFORMATION_TEXT)
char_kick = theme.CHAR_KICK
if actor_elem is not None: if actor_elem is not None:
by = actor_elem.get('nick') or actor_elem.get('jid') by = actor_elem.get('nick') or actor_elem.get('jid')
if from_nick == self.own_nick: # we are kicked if from_nick == self.own_nick: # we are kicked
...@@ -901,8 +907,9 @@ class MucTab(ChatTab): ...@@ -901,8 +907,9 @@ class MucTab(ChatTab):
color = dump_tuple(user.color) color = dump_tuple(user.color)
else: else:
color = 3 color = 3
info_col = dump_tuple(get_theme().COLOR_INFORMATION_TEXT) theme = get_theme()
spec_col = dump_tuple(get_theme().COLOR_QUIT_CHAR) info_col = dump_tuple(theme.COLOR_INFORMATION_TEXT)
spec_col = dump_tuple(theme.COLOR_QUIT_CHAR)
error_leave_txt = '' error_leave_txt = ''
if server_initiated: if server_initiated:
...@@ -914,18 +921,18 @@ class MucTab(ChatTab): ...@@ -914,18 +921,18 @@ class MucTab(ChatTab):
'room%(error_leave)s') % { 'room%(error_leave)s') % {
'nick': from_nick, 'nick': from_nick,
'color': color, 'color': color,
'spec': get_theme().CHAR_QUIT, 'spec': theme.CHAR_QUIT,
'info_col': info_col, 'info_col': info_col,
'color_spec': spec_col, 'color_spec': spec_col,
'error_leave': error_leave_txt, 'error_leave': error_leave_txt,
} }
else: else:
jid_col = dump_tuple(get_theme().COLOR_MUC_JID) jid_col = dump_tuple(theme.COLOR_MUC_JID)
leave_msg = ('\x19%(color_spec)s}%(spec)s \x19%(color)s}' leave_msg = ('\x19%(color_spec)s}%(spec)s \x19%(color)s}'
'%(nick)s\x19%(info_col)s} (\x19%(jid_col)s}' '%(nick)s\x19%(info_col)s} (\x19%(jid_col)s}'
'%(jid)s\x19%(info_col)s}) has left the ' '%(jid)s\x19%(info_col)s}) has left the '
'room%(error_leave)s') % { 'room%(error_leave)s') % {
'spec': get_theme().CHAR_QUIT, 'spec': theme.CHAR_QUIT,
'nick': from_nick, 'nick': from_nick,
'color': color, 'color': color,
'jid': jid.full, 'jid': jid.full,
...@@ -952,16 +959,17 @@ class MucTab(ChatTab): ...@@ -952,16 +959,17 @@ class MucTab(ChatTab):
color = dump_tuple(user.color) color = dump_tuple(user.color)
else: else:
color = 3 color = 3
info_col = dump_tuple(get_theme().COLOR_INFORMATION_TEXT)
if from_nick == self.own_nick: if from_nick == self.own_nick:
msg = '\x19%(color)s}You\x19%(info_col)s} changed: ' % { msg = '\x19%(color)s}You\x19%(info_col)s} changed: ' % {
'info_col': dump_tuple(get_theme().COLOR_INFORMATION_TEXT), 'info_col': info_col),
'color': color 'color': color
} }
else: else:
msg = '\x19%(color)s}%(nick)s\x19%(info_col)s} changed: ' % { msg = '\x19%(color)s}%(nick)s\x19%(info_col)s} changed: ' % {
'nick': from_nick, 'nick': from_nick,
'color': color, 'color': color,
'info_col': dump_tuple(get_theme().COLOR_INFORMATION_TEXT) 'info_col': info_col)
} }
if affiliation != user.affiliation: if affiliation != user.affiliation:
msg += 'affiliation: %s, ' % affiliation msg += 'affiliation: %s, ' % affiliation
...@@ -1496,23 +1504,24 @@ class MucTab(ChatTab): ...@@ -1496,23 +1504,24 @@ class MucTab(ChatTab):
if not self.joined: if not self.joined:
return return
theme = get_theme()
aff = { aff = {
'owner': get_theme().CHAR_AFFILIATION_OWNER, 'owner': theme.CHAR_AFFILIATION_OWNER,
'admin': get_theme().CHAR_AFFILIATION_ADMIN, 'admin': theme.CHAR_AFFILIATION_ADMIN,
'member': get_theme().CHAR_AFFILIATION_MEMBER, 'member': theme.CHAR_AFFILIATION_MEMBER,
'none': get_theme().CHAR_AFFILIATION_NONE, 'none': theme.CHAR_AFFILIATION_NONE,
} }
colors = {} colors = {}
colors["visitor"] = dump_tuple(get_theme().COLOR_USER_VISITOR) colors["visitor"] = dump_tuple(theme.COLOR_USER_VISITOR)
colors["moderator"] = dump_tuple(get_theme().COLOR_USER_MODERATOR) colors["moderator"] = dump_tuple(theme.COLOR_USER_MODERATOR)
colors["participant"] = dump_tuple(get_theme().COLOR_USER_PARTICIPANT) colors["participant"] = dump_tuple(theme.COLOR_USER_PARTICIPANT)
color_other = dump_tuple(get_theme().COLOR_USER_NONE) color_other = dump_tuple(theme.COLOR_USER_NONE)
buff = ['Users: %s \n' % len(self.users)] buff = ['Users: %s \n' % len(self.users)]
for user in self.users: for user in self.users:
affiliation = aff.get(user.affiliation, affiliation = aff.get(user.affiliation,
get_theme().CHAR_AFFILIATION_NONE) theme.CHAR_AFFILIATION_NONE)
color = colors.get(user.role, color_other) color = colors.get(user.role, color_other)
buff.append( buff.append(
'\x19%s}%s\x19o\x19%s}%s\x19o' % '\x19%s}%s\x19o\x19%s}%s\x19o' %
......
...@@ -345,21 +345,22 @@ class PrivateTab(OneToOneTab): ...@@ -345,21 +345,22 @@ class PrivateTab(OneToOneTab):
The user left the associated MUC The user left the associated MUC
""" """
self.deactivate() self.deactivate()
theme = get_theme()
if config.get_by_tabname('display_user_color_in_join_part', if config.get_by_tabname('display_user_color_in_join_part',
self.general_jid): self.general_jid):
color = dump_tuple(user.color) color = dump_tuple(user.color)
else: else:
color = dump_tuple(get_theme().COLOR_REMOTE_USER) color = dump_tuple(theme.COLOR_REMOTE_USER)
if not status_message: if not status_message:
self.add_message( self.add_message(
'\x19%(quit_col)s}%(spec)s \x19%(nick_col)s}' '\x19%(quit_col)s}%(spec)s \x19%(nick_col)s}'
'%(nick)s\x19%(info_col)s} has left the room' % { '%(nick)s\x19%(info_col)s} has left the room' % {
'nick': user.nick, 'nick': user.nick,
'spec': get_theme().CHAR_QUIT, 'spec': theme.CHAR_QUIT,
'nick_col': color, 'nick_col': color,
'quit_col': dump_tuple(get_theme().COLOR_QUIT_CHAR), 'quit_col': dump_tuple(theme.COLOR_QUIT_CHAR),
'info_col': dump_tuple(get_theme().COLOR_INFORMATION_TEXT) 'info_col': dump_tuple(theme.COLOR_INFORMATION_TEXT)
}, },
typ=2) typ=2)
else: else:
...@@ -369,10 +370,10 @@ class PrivateTab(OneToOneTab): ...@@ -369,10 +370,10 @@ class PrivateTab(OneToOneTab):
' (%(status)s)' % { ' (%(status)s)' % {
'status': status_message, 'status': status_message,
'nick': user.nick, 'nick': user.nick,
'spec': get_theme().CHAR_QUIT, 'spec': theme.CHAR_QUIT,
'nick_col': color, 'nick_col': color,
'quit_col': dump_tuple(get_theme().COLOR_QUIT_CHAR), 'quit_col': dump_tuple(theme.COLOR_QUIT_CHAR),
'info_col': dump_tuple(get_theme().COLOR_INFORMATION_TEXT) 'info_col': dump_tuple(theme.COLOR_INFORMATION_TEXT)
}, },
typ=2) typ=2)
return self.core.tabs.current_tab is self return self.core.tabs.current_tab is self
...@@ -385,7 +386,8 @@ class PrivateTab(OneToOneTab): ...@@ -385,7 +386,8 @@ class PrivateTab(OneToOneTab):
self.activate() self.activate()
self.check_features() self.check_features()
tab = self.parent_muc tab = self.parent_muc
color = dump_tuple(get_theme().COLOR_REMOTE_USER) theme = get_theme()
color = dump_tuple(theme.COLOR_REMOTE_USER)
if tab and config.get_by_tabname('display_user_color_in_join_part', if tab and config.get_by_tabname('display_user_color_in_join_part',
self.general_jid): self.general_jid):
user = tab.get_user_by_name(nick) user = tab.get_user_by_name(nick)
...@@ -396,9 +398,9 @@ class PrivateTab(OneToOneTab): ...@@ -396,9 +398,9 @@ class PrivateTab(OneToOneTab):
'%(info_col)s} joined the room' % { '%(info_col)s} joined the room' % {
'nick': nick, 'nick': nick,
'color': color, 'color': color,
'spec': get_theme().CHAR_JOIN, 'spec': theme.CHAR_JOIN,
'join_col': dump_tuple(get_theme().COLOR_JOIN_CHAR), 'join_col': dump_tuple(theme.COLOR_JOIN_CHAR),
'info_col': dump_tuple(get_theme().COLOR_INFORMATION_TEXT) 'info_col': dump_tuple(theme.COLOR_INFORMATION_TEXT)
}, },
typ=2) typ=2)
return self.core.tabs.current_tab is self return self.core.tabs.current_tab is self
...@@ -417,12 +419,13 @@ class PrivateTab(OneToOneTab): ...@@ -417,12 +419,13 @@ class PrivateTab(OneToOneTab):
return [(3, safeJID(self.name).resource), (4, self.name)] return [(3, safeJID(self.name).resource), (4, self.name)]
def add_error(self, error_message): def add_error(self, error_message):
error = '\x19%s}%s\x19o' % (dump_tuple(get_theme().COLOR_CHAR_NACK), theme = get_theme()
error = '\x19%s}%s\x19o' % (dump_tuple(theme.COLOR_CHAR_NACK),
error_message) error_message)
self.add_message( self.add_message(
error, error,
highlight=True, highlight=True,
nickname='Error', nickname='Error',
nick_color=get_theme().COLOR_ERROR_MSG, nick_color=theme.COLOR_ERROR_MSG,
typ=2) typ=2)
self.core.refresh_window() self.core.refresh_window()
...@@ -245,9 +245,10 @@ class BookmarksWin(Win): ...@@ -245,9 +245,10 @@ class BookmarksWin(Win):
return return
if self.current_input == 0: if self.current_input == 0:
return return
theme = get_theme()
self.lines[self.current_input][ self.lines[self.current_input][
self.current_horizontal_input].set_color( self.current_horizontal_input].set_color(
get_theme().COLOR_NORMAL_TEXT) theme.COLOR_NORMAL_TEXT)
self.current_input -= 1 self.current_input -= 1
# Adjust the scroll position if the current_input would be outside # Adjust the scroll position if the current_input would be outside
# of the visible area # of the visible area
...@@ -256,20 +257,21 @@ class BookmarksWin(Win): ...@@ -256,20 +257,21 @@ class BookmarksWin(Win):
self.refresh() self.refresh()
self.lines[self.current_input][ self.lines[self.current_input][
self.current_horizontal_input].set_color( self.current_horizontal_input].set_color(
get_theme().COLOR_SELECTED_ROW) theme.COLOR_SELECTED_ROW)
def go_to_next_horizontal_input(self) -> None: def go_to_next_horizontal_input(self) -> None:
if not self.lines: if not self.lines:
return return
theme = get_theme()
self.lines[self.current_input][ self.lines[self.current_input][
self.current_horizontal_input].set_color( self.current_horizontal_input].set_color(
get_theme().COLOR_NORMAL_TEXT) theme.COLOR_NORMAL_TEXT)
self.current_horizontal_input += 1 self.current_horizontal_input += 1
if self.current_horizontal_input > 3: if self.current_horizontal_input > 3:
self.current_horizontal_input = 0 self.current_horizontal_input = 0
self.lines[self.current_input][ self.lines[self.current_input][
self.current_horizontal_input].set_color( self.current_horizontal_input].set_color(
get_theme().COLOR_SELECTED_ROW) theme.COLOR_SELECTED_ROW)
def go_to_next_page(self) -> bool: def go_to_next_page(self) -> bool:
if not self.lines: if not self.lines:
...@@ -278,9 +280,10 @@ class BookmarksWin(Win): ...@@ -278,9 +280,10 @@ class BookmarksWin(Win):
if self.current_input == len(self.lines) - 1: