diff --git a/bebop/browser/browser.py b/bebop/browser/browser.py index 9cc7221..f087c90 100644 --- a/bebop/browser/browser.py +++ b/bebop/browser/browser.py @@ -16,7 +16,7 @@ from bebop.bookmarks import ( get_bookmarks_document, save_bookmark, ) -from bebop.colors import ColorPair, init_colors +from bebop.colors import A_ITALIC, ColorPair, init_colors from bebop.config import RENDER_MODES from bebop.command_line import CommandLine from bebop.external import open_external_program @@ -290,7 +290,7 @@ class Browser: def set_status(self, text): """Set a regular message in the status bar.""" - self.status_data = text, ColorPair.NORMAL, curses.A_ITALIC + self.status_data = text, ColorPair.NORMAL, A_ITALIC self.refresh_status_line() def reset_status(self): diff --git a/bebop/colors.py b/bebop/colors.py index 2fa7693..bfa139c 100644 --- a/bebop/colors.py +++ b/bebop/colors.py @@ -21,6 +21,9 @@ class ColorPair(IntEnum): LINK_PREVIEW = 10 +A_ITALIC = curses.A_ITALIC if hasattr(curses, "A_ITALIC") else curses.A_NORMAL + + def init_colors(): curses.use_default_colors() curses.init_pair(ColorPair.NORMAL, curses.COLOR_WHITE, -1) diff --git a/bebop/rendering.py b/bebop/rendering.py index 873b696..81252cd 100644 --- a/bebop/rendering.py +++ b/bebop/rendering.py @@ -2,7 +2,7 @@ import curses -from bebop.colors import ColorPair +from bebop.colors import A_ITALIC, ColorPair from bebop.metalines import LineType @@ -48,7 +48,7 @@ def render_line(metaline, window, max_width): attributes = ( curses.color_pair(ColorPair.LINK_PREVIEW) | curses.A_DIM - | curses.A_ITALIC + | A_ITALIC ) window.addstr(url_text, attributes) @@ -70,6 +70,6 @@ def get_base_line_attributes(line_type) -> int: elif line_type == LineType.PREFORMATTED: return curses.color_pair(ColorPair.PREFORMATTED) elif line_type == LineType.BLOCKQUOTE: - return curses.color_pair(ColorPair.BLOCKQUOTE) | curses.A_ITALIC + return curses.color_pair(ColorPair.BLOCKQUOTE) | A_ITALIC else: # includes LineType.PARAGRAPH return curses.color_pair(ColorPair.NORMAL)