Made selection bold and underlined instead of reverse colour #263

This commit is contained in:
Maarten van Gompel 2022-12-13 12:18:12 +01:00
parent 2b0c0cf199
commit 6e2176b48d

View file

@ -6,7 +6,7 @@ from typing import Any, Dict, List, Optional, Tuple, Union, cast
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
@ -173,13 +173,13 @@ class ChatView:
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(
@ -192,7 +192,7 @@ class ChatView:
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(
@ -593,7 +593,7 @@ class MsgView:
)
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: