Don't display too complex emojis
Signed-off-by: Yohann D'ANELLO <ynerant@crans.org>
This commit is contained in:
parent
90918ddd71
commit
5a212750e6
|
@ -651,7 +651,8 @@ class Squirrel(Hazelnut):
|
|||
self.emoji_pad.addstr(height - 1, 0, "┗" + (width - 2) * "━" + "┛")
|
||||
|
||||
emojis = list(unicode_codes.UNICODE_EMOJI)
|
||||
size = (height - 2) * (width - 4) // 4
|
||||
emojis = [c for c in emojis if len(c) == 1]
|
||||
size = (height - 2) * (width - 4) // 2
|
||||
page = emojis[(self.emoji_panel_page - 1) * size:self.emoji_panel_page * size]
|
||||
|
||||
if self.emoji_panel_page != 1:
|
||||
|
@ -660,10 +661,10 @@ class Squirrel(Hazelnut):
|
|||
self.emoji_pad.addstr(height - 2, width - 2, "⬇")
|
||||
|
||||
for i in range(height - 2):
|
||||
for j in range((width - 4) // 4):
|
||||
index = i * (width - 4) // 4 + j
|
||||
for j in range((width - 4) // 2 + 1):
|
||||
index = i * (width - 4) // 2 + j
|
||||
if index < len(page):
|
||||
self.emoji_pad.addstr(i + 1, 4 * j + 1, page[index])
|
||||
self.emoji_pad.addstr(i + 1, 2 * j + 1, page[index])
|
||||
|
||||
self.emoji_pad.refresh(0, 0, curses.LINES - height - 2, curses.COLS - width - 2,
|
||||
curses.LINES - 2, curses.COLS - 2)
|
||||
|
|
Loading…
Reference in New Issue