The pixel image preference is show_mcoimg
Renamed from chat_images, which no released version ever had, so the old name is not retired. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
6f63cfbad3
commit
24b7690870
5 files changed
+9
-9
No files matched your search
@@ -328,7 +328,7 @@ deliberately, one at a time, and say why in the code.
|
||||
and URL can't share the frame the code is whole at the top and the URL a page down.
|
||||
A picked message that is a pixel image (MCOimg, `ui/pixelart.py`) opens its image on the
|
||||
same bare frame instead, grown by a whole number to fill it (`ImageScreen`; the chip
|
||||
reads `Image`, the hint `^U image`); with `chat_images` off, that is the only view.
|
||||
reads `Image`, the hint `^U image`); with `show_mcoimg` off, that is the only view.
|
||||
A chat message's links open there too, on every platform: ^U on the picked message,
|
||||
and with several, one code at a time that ←→ step through, clamped. That screen's URL
|
||||
line is flanked `←`/`→`, lit toward another code and dim at an end — the one mark the
|
||||
|
||||
@@ -600,7 +600,7 @@ PREFERENCES: tuple[PrefSpec, ...] = (
|
||||
unit="s",
|
||||
),
|
||||
PrefSpec(
|
||||
key="chat_images",
|
||||
key="show_mcoimg",
|
||||
label="Chat images",
|
||||
help="Draw the pixel images of messages. Off: ^U shows one",
|
||||
group="Display",
|
||||
|
||||
+3
-3
@@ -393,7 +393,7 @@ class ChatScreen(Screen):
|
||||
self._render_cache: dict | None = None
|
||||
# The clock tolerance of the last render: which times show as corrected.
|
||||
self._tolerance_s = clock_tolerance_s()
|
||||
# Whether the last render drew the pixel images (the ``chat_images`` preference).
|
||||
# Whether the last render drew the pixel images (the ``show_mcoimg`` preference).
|
||||
self._show_images = True
|
||||
# Strong references to the sends, resends, and spinner tickers that a key handler
|
||||
# starts. The event loop holds only a *weak* reference. Thus the garbage collector
|
||||
@@ -684,7 +684,7 @@ class ChatScreen(Screen):
|
||||
locks = self._pages.locked_keys() if self._pages is not None else frozenset()
|
||||
tolerance = clock_tolerance_s()
|
||||
self._tolerance_s = tolerance
|
||||
images = bool(preferences.current().chat_images)
|
||||
images = bool(preferences.current().show_mcoimg)
|
||||
self._show_images = images
|
||||
if (
|
||||
cache is not None
|
||||
@@ -1367,7 +1367,7 @@ class ChatScreen(Screen):
|
||||
"""Show the pixel image of the selected message on a bare frame (^U).
|
||||
|
||||
The image is as large as the frame permits (refer to
|
||||
:class:`~meshterm.ui.pixelart.ImageScreen`). When the ``chat_images`` preference is
|
||||
:class:`~meshterm.ui.pixelart.ImageScreen`). When the ``show_mcoimg`` preference is
|
||||
off, this is the way to see an image. When it is on, this is the large view.
|
||||
|
||||
Returns:
|
||||
|
||||
@@ -12,7 +12,7 @@ but an image that is cut loses more: the user sees only a part of it.
|
||||
|
||||
On the picked message, ^U opens the image on a bare frame (:class:`ImageScreen`). There it
|
||||
becomes as large as the frame permits, by a whole number, so each pixel stays square. When
|
||||
the ``chat_images`` preference is off, the chat shows only the line about the image, and
|
||||
the ``show_mcoimg`` preference is off, the chat shows only the line about the image, and
|
||||
^U is the way to see it.
|
||||
"""
|
||||
|
||||
|
||||
+3
-3
@@ -991,13 +991,13 @@ def test_a_pixel_image_shows_a_short_line_not_its_text() -> None:
|
||||
assert lines[1].strip() and set(lines[1].strip()) <= set("▀▄█")
|
||||
|
||||
|
||||
def test_with_chat_images_off_the_image_is_behind_ctrl_u(monkeypatch) -> None:
|
||||
"""With ``chat_images`` off, only the line shows, and ^U on the picked image opens it."""
|
||||
def test_with_show_mcoimg_off_the_image_is_behind_ctrl_u(monkeypatch) -> None:
|
||||
"""With ``show_mcoimg`` off, only the line shows, and ^U on the picked image opens it."""
|
||||
from meshterm.core import preferences
|
||||
from meshterm.ui.pixelart import ImageScreen
|
||||
|
||||
prefs = preferences.Preferences()
|
||||
prefs.set("chat_images", False)
|
||||
prefs.set("show_mcoimg", False)
|
||||
monkeypatch.setattr(preferences, "current", lambda: prefs)
|
||||
text = "im3:g/5WjAL`NA"
|
||||
messages = [ChatMessage(text=text, peer="d4e5f6a7")]
|
||||
|
||||
Reference in new issue
Block a user