diff --git a/TODO.mkdn b/TODO.mkdn index 0568133..87601af 100644 --- a/TODO.mkdn +++ b/TODO.mkdn @@ -51,6 +51,7 @@ Features * Add more comprehensive status support - IDLE, DND, INVISIBLE for now - or at least add similar functionality. * SEPARATE FUNCTIONALITY from CONNECTED STATE!! This is a huge problem! Being shunted off our nick closes windows and breaks things! Just D/C and reconnect? * It'd probably be best to give an option to either CHANGE NICKS or DISCONNECT upon nick collision...? But, then how would we GHOST? + * Auto-disconnect if collsion before joining channels, make it possible to disconnect (but not send messages, obviously) without losing everything * Maybe GHOSTing should use auto-identify to ensure- no, that doesn't work, because we can't ident into a specified nick without being ON it. Need GD's help to fix.... * Separate Pesterchum system handling from window handling. Dicts should be stored and maintained via dicts - even a refined version of what I used for textsub. @@ -71,6 +72,7 @@ Todo/Done * Make sound work on Windows through QSound (disables volume control) * Toggle individual tab flash / alert sounds (from the same right-click memo that lets us toggle OOC) * Make CTRL+PGUP/PGDN switch memo/pester tabs +* Color tags are now posted as their shorter hexadecimal forms, if applicable (255,255,255 -> #FFFFFF, for example) Debugging ---- diff --git a/pnc/lexercon.py b/pnc/lexercon.py index 3bf9769..81891c9 100644 --- a/pnc/lexercon.py +++ b/pnc/lexercon.py @@ -121,10 +121,22 @@ class CTag(Specifier): else: if color.name: text = "" % color.name - elif self.compact: - text = "" % color.reduce_hexstr(color.hexstr) else: - text = "" % color.to_rgb_tuple() + # We should have a toggle here, just in case this isn't + # acceptable for some reason, but it usually will be. + rgb = "" % color.to_rgb_tuple() + hxs = color.hexstr + if self.compact: + # Try to crush it down even further. + hxs = color.reduce_hexstr(hxs) + hxs = "" % hxs + if len(rgb) <= len(hxs): + # Prefer the more widely-recognized default format + text = rgb + else: + # Hex is shorter, and recognized by everything thus + # far; use it. + text = hxs elif format == "plaintext": text = '' return text