mirror of
https://github.com/markqvist/NomadNet.git
synced 2026-11-22 16:06:22 -05:00
Fixed composite unicode characters breaking text alignment rendering
This commit is contained in:
parent
3e7e55a9ca
commit
5ceb0c671e
5 changed files with 42 additions and 9 deletions
|
|
@ -11,6 +11,7 @@ import threading
|
|||
from .MicronParser import markup_to_attrmaps, make_style, default_state
|
||||
from nomadnet.Directory import DirectoryEntry
|
||||
from nomadnet.vendor.Scrollable import *
|
||||
from nomadnet.util import strip_modifiers
|
||||
|
||||
class BrowserFrame(urwid.Frame):
|
||||
def keypress(self, size, key):
|
||||
|
|
@ -813,7 +814,7 @@ class Browser:
|
|||
fg = self.markup[fgpos+5:endpos]
|
||||
self.page_foreground_color = fg
|
||||
|
||||
self.attr_maps = markup_to_attrmaps(self.markup, url_delegate=self, fg_color=self.page_foreground_color, bg_color=self.page_background_color)
|
||||
self.attr_maps = markup_to_attrmaps(strip_modifiers(self.markup), url_delegate=self, fg_color=self.page_foreground_color, bg_color=self.page_background_color)
|
||||
|
||||
self.response_progress = 0
|
||||
self.response_speed = None
|
||||
|
|
@ -880,7 +881,7 @@ class Browser:
|
|||
fg = self.markup[fgpos+5:endpos]
|
||||
self.page_foreground_color = fg
|
||||
|
||||
self.attr_maps = markup_to_attrmaps(self.markup, url_delegate=self, fg_color=self.page_foreground_color, bg_color=self.page_background_color)
|
||||
self.attr_maps = markup_to_attrmaps(strip_modifiers(self.markup), url_delegate=self, fg_color=self.page_foreground_color, bg_color=self.page_background_color)
|
||||
|
||||
self.response_progress = 0
|
||||
self.response_speed = None
|
||||
|
|
@ -1032,7 +1033,7 @@ class Browser:
|
|||
fg = self.markup[fgpos+5:endpos]
|
||||
self.page_foreground_color = fg
|
||||
|
||||
self.attr_maps = markup_to_attrmaps(self.markup, url_delegate=self, fg_color=self.page_foreground_color, bg_color=self.page_background_color)
|
||||
self.attr_maps = markup_to_attrmaps(strip_modifiers(self.markup), url_delegate=self, fg_color=self.page_foreground_color, bg_color=self.page_background_color)
|
||||
self.response_progress = 0
|
||||
self.response_speed = None
|
||||
self.progress_updated_at = None
|
||||
|
|
|
|||
0
nomadnet/ui/textui/Helpers.py
Normal file
0
nomadnet/ui/textui/Helpers.py
Normal file
|
|
@ -6,6 +6,7 @@ import threading
|
|||
from datetime import datetime
|
||||
from nomadnet.Directory import DirectoryEntry
|
||||
from nomadnet.vendor.additional_urwid_widgets import IndicativeListBox, MODIFIER_KEY
|
||||
from nomadnet.util import strip_modifiers
|
||||
|
||||
from .Browser import Browser
|
||||
|
||||
|
|
@ -279,7 +280,7 @@ class AnnounceStreamEntry(urwid.WidgetWrap):
|
|||
display_str = RNS.hexrep(source_hash, delimit=False)
|
||||
else:
|
||||
try:
|
||||
display_str = announce[2].decode("utf-8")
|
||||
display_str = strip_modifiers(announce[2].decode("utf-8"))
|
||||
if len(display_str) > 32:
|
||||
display_str = display_str[:32] + "..."
|
||||
except:
|
||||
|
|
@ -608,7 +609,7 @@ class KnownNodeInfo(urwid.WidgetWrap):
|
|||
if node_entry == None:
|
||||
display_str = self.app.directory.simplest_display_str(source_hash)
|
||||
else:
|
||||
display_str = node_entry.display_name
|
||||
display_str = strip_modifiers(node_entry.display_name)
|
||||
|
||||
addr_str = "<"+RNS.hexrep(source_hash, delimit=False)+">"
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue