Commit Graph

594 Commits

Author SHA1 Message Date
Isaiah Odhner
0ccd9612bc Fix non-replaced background artifacts 2023-05-04 21:13:06 -04:00
Isaiah Odhner
506876893e Make question mark bubble more symmetrical and arguably rounder 2023-05-04 21:13:06 -04:00
Isaiah Odhner
75f13e95ce Remove top row of question mark icon which just had underscores 2023-05-04 21:13:06 -04:00
Isaiah Odhner
918b6d5887 Tweak question mark colors, and hide underlines 2023-05-04 21:13:06 -04:00
Isaiah Odhner
8e067ca48e Remove background from question mark icon 2023-05-04 21:13:06 -04:00
Isaiah Odhner
bf7c4df2d1 Prompt to enlarge the document when image on clipboard is larger 2023-05-04 21:13:06 -04:00
Isaiah Odhner
3544e754ea Add a stopgap to export Rich API console markup 2023-05-04 19:01:23 -04:00
Isaiah Odhner
076b4bd681 Fix AssertionError in bring_to_front 2023-05-04 19:01:23 -04:00
Isaiah Odhner
42ca86f7eb Remove update_styles hack, seemingly not needed anymore
I guess it was for windows with max/min-width/height, which I'm not doing anymore.
That or something else has changed. Yep, covering my bases here.
That, or I'm not covering my bases! You never know.
Or do you knever now?
2023-05-04 16:57:32 -04:00
Isaiah Odhner
40e9dbf88e Bring window to front when clicked 2023-05-04 16:49:13 -04:00
Isaiah Odhner
d1a27a2c9d Bring window to front if descendant gets focus 2023-05-04 16:44:27 -04:00
Isaiah Odhner
55c6bc9966 Maybe don't repaint
No significant difference has been shown between milk derived from rbST-treated and non-rbST treated cows.
2023-05-04 16:17:34 -04:00
Isaiah Odhner
ec718cac81 Make submenu positioning more reliable 2023-05-04 16:03:12 -04:00
Isaiah Odhner
9e2be988af Clean up
Don't need this reference code anymore.
2023-05-04 15:43:14 -04:00
Isaiah Odhner
f5e071f069 Fix menus cut off when viewport height is small
This fix works for the top level menus, and but it's unreliable for
submenus, just as submenus opening at all is unreliable.
2023-05-04 15:40:54 -04:00
Isaiah Odhner
bf2b471733 Implement Edit > Copy To 2023-05-04 15:26:36 -04:00
Isaiah Odhner
6e9fa34cbb Note a defect 2023-05-04 15:26:36 -04:00
Isaiah Odhner
e95407980e Implement Edit > Paste From 2023-05-04 14:57:42 -04:00
Isaiah Odhner
3e29d2a75e Split action_paste and paste 2023-05-04 14:35:14 -04:00
Isaiah Odhner
c2ee9ef2df Simplify: don't need a Task!
This still handles errors, unlike a million things I tried before,
and can still work and exit successfully.
2023-05-04 14:29:12 -04:00
Isaiah Odhner
cf39357641 Clean up 2023-05-04 14:23:32 -04:00
Isaiah Odhner
1656c64ea2 Make --recode-samples handle exceptions, in an insanely complicated way 2023-05-04 13:40:08 -04:00
Isaiah Odhner
c9c58f12c6 Extract Open and Save As dialogs to a file_dialogs module 2023-05-04 13:15:06 -04:00
Isaiah Odhner
3ae8af3ad7 Use default colors instead last, when padding rows from an ANSI file
I'm not sure whether it should continue the color at the end of a row,
or if it should use the default color, but before, it used the last
color set in the entire file, even for earlier rows,
so this is at least better than that.
2023-05-03 20:29:24 -04:00
Isaiah Odhner
426354e986 Add notes to development section of readme 2023-05-03 20:20:49 -04:00
Isaiah Odhner
943151afe9 Set up diffing ANSI files with cat --show-all
I can only set up half of this directly, for the other half,
you have to run the command I mention here.
2023-05-03 19:50:37 -04:00
Isaiah Odhner
1d26df938d Add 2x2.ans sample file (containing a border square) 2023-05-03 19:04:26 -04:00
Isaiah Odhner
fcfe1d354e Add 1x1.ans sample file (containing a smiley face) 2023-05-03 19:04:26 -04:00
Isaiah Odhner
b80f15bfde Find samples folder relative to the Python script, and DRY 2023-05-03 19:04:26 -04:00
Isaiah Odhner
03ce16e100 Allow creating new file via the command line, if file doesn't exist 2023-05-03 17:22:50 -04:00
Isaiah Odhner
cf81a4236a Convert line endings to CRLF in sample ANSI files
I used:
    cd samples && sed -i 's/$/\r/' *

A git diff across branches suggests that this command gives the same results:
    src/textual_paint/paint.py --recode-samples

And --recode-samples is now idempotent, for the current set of sample files.
2023-05-03 16:09:31 -04:00
Isaiah Odhner
1eccb1b98a Disable line ending normalization for ANSI files 2023-05-03 16:00:31 -04:00
Isaiah Odhner
799ec9944a Fix color values being rounded when loading an ANSI file 2023-05-03 13:49:52 -04:00
Isaiah Odhner
91e228a239 Use inline styles when exporting HTML
I'd rather it be copy-pastable and larger, than smaller but potentially disappointing or frustrating.
2023-05-03 12:35:40 -04:00
Isaiah Odhner
4f4a65c6fe Fix gaps between lines in HTML export in Chrome/Firefox on Ubuntu
This is dependent on the font.
In both Chrome/Firefox, monospace uses "DejaVu Sans Mono" on my system,
but if I specify "DejaVu Sans Mono" explicitly, it uses a larger
font size (16px, as compared to 12px in Firefox or 13px in Chrome), and
slight gaps are visible.

This fixes a regression when switching over to the Rich API's built-in
HTML exporting — from where I'm sitting — but it may look totally
different on someone else's computer.
2023-05-03 12:30:29 -04:00
Isaiah Odhner
b4af4032f7 Copy HTML template from rich/_export_format.py 2023-05-03 12:05:54 -04:00
Isaiah Odhner
0bed615e74 Exit after --recode-samples
Otherwise it may leave the app in a weird state where
app.image != app.canvas.image (I presume), and you can't draw, at least
not visibly, and it can prompt you to save changes to the document
that isn't visibly open, except in the titlebar (Header).
2023-05-03 11:56:14 -04:00
Isaiah Odhner
0282eb3785 Clarify formatter_class strategy (hack) 2023-05-03 11:39:04 -04:00
Isaiah Odhner
1cdad17fe9 Set a fixed width when updating CLI help on readme
By default it uses the terminal width, which caused the help text to change spuriously.
2023-05-03 11:39:00 -04:00
Isaiah Odhner
77fa6cb444 Fix error after resizing the document if there was an action preview
If you confirmed the dialog with Enter after hovering over the canvas,
previously it got:

    IndexError: list index out of range

when canceling the preview after it became outdated in regard to the
canvas size.
2023-05-03 11:38:56 -04:00
Isaiah Odhner
cbbaf18945 Rename methods dealing with plain text 2023-05-03 11:38:34 -04:00
Isaiah Odhner
eaa64c992e Add --recode-samples for testing 2023-05-03 11:37:40 -04:00
Isaiah Odhner
8463f2069f Automatically update the readme CLI help 2023-05-03 11:37:33 -04:00
Isaiah Odhner
62d0f5043d Use Textual's Color.parse during ANSI export 2023-05-02 14:00:09 -04:00
Isaiah Odhner
afcedccba6 Use Rich API for HTML export
This should handle escaping.
2023-05-02 13:43:53 -04:00
Isaiah Odhner
7f35b96c40 Construct Rich renderable without encoding to ANSI first 2023-05-02 13:33:00 -04:00
Isaiah Odhner
fec1b45a40 Gesture towards a Rich API based ANSI file loading solution 2023-05-02 12:53:18 -04:00
Isaiah Odhner
dd5557c803 Accept spellings 2023-05-02 12:33:48 -04:00
Isaiah Odhner
815a279784 Clean up new SVG code 2023-05-02 01:19:06 -04:00
Isaiah Odhner
e0ec86dce0 Clean up old SVG code 2023-05-02 01:19:06 -04:00