Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Made selection bold and underlined instead of reverse colour #294

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions tg/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from _curses import window # type: ignore

from tg import config
from tg.colors import bold, cyan, get_color, magenta, reverse, white, yellow
from tg.colors import bold, cyan, get_color, magenta, reverse, underline, white, yellow
from tg.models import Model, UserModel
from tg.msg import MsgProxy
from tg.tdlib import ChatType, get_chat_type, is_group
Expand Down Expand Up @@ -173,13 +173,13 @@ def resize(self, rows: int, cols: int, width: int) -> None:
def _msg_color(self, is_selected: bool = False) -> int:
color = get_color(white, -1)
if is_selected:
return color | reverse
return color | underline | bold
return color

def _unread_color(self, is_selected: bool = False) -> int:
color = get_color(magenta, -1)
if is_selected:
return color | reverse
return color | underline | bold
return color

def _chat_attributes(
Expand All @@ -192,7 +192,7 @@ def _chat_attributes(
self._msg_color(is_selected),
)
if is_selected:
return tuple(attr | reverse for attr in attrs)
return tuple(attr | underline | bold for attr in attrs)
return attrs

def draw(
Expand Down Expand Up @@ -593,7 +593,7 @@ def _msg_attributes(self, is_selected: bool, user: str) -> Tuple[int, ...]:
)

if is_selected:
return tuple(attr | reverse for attr in attrs)
return tuple(attr | underline | bold for attr in attrs)
return attrs

def _parse_msg(self, msg: MsgProxy) -> str:
Expand Down