Commit Graph

459 Commits

Author SHA1 Message Date
Isaiah Odhner
6e7b04da52 Clean up 2023-04-27 00:57:37 -04:00
Isaiah Odhner
4332ec1d58 Create a script to show an ANSI file centered in the terminal 2023-04-27 00:53:16 -04:00
Isaiah Odhner
594c378e45 Remove try-except around set_wallpaper body 2023-04-26 22:30:59 -04:00
Isaiah Odhner
b764ab6f45 Hook up Set As Wallpaper menu items 2023-04-26 22:30:59 -04:00
Isaiah Odhner
66dad7e3b8 Remove OOP vestiges from wallpaper module 2023-04-26 22:18:28 -04:00
Isaiah Odhner
454c473eff Grab and tweak wallpaper code
I updated the Windows version to use *W (wide char, unicode) version,
and enabled it and the mac one, changed except: to except Exception:
and tweaked a few other things.

I haven't tested any of this.
2023-04-26 22:00:23 -04:00
Isaiah Odhner
06e2ad41e4 Fix cells inverted outside the textbox to the left of the selection after closing a menu over the region
Normally, only the region with the textbox is updated, when the text selection changes, but if the canvas is refreshed by other means, like a menu, it can show up.
2023-04-26 21:32:42 -04:00
Isaiah Odhner
f6b94f67c4 Fix: refresh canvas when selecting all 2023-04-26 21:29:31 -04:00
Isaiah Odhner
dc6ab4d72e Type hint pyperclip.paste() 2023-04-26 21:27:33 -04:00
Isaiah Odhner
f1652c257a Fix: refresh canvas when pasting
Broken in last commit by adding:

        if "ctrl" in key:
            # Don't interfere with Ctrl+C, Ctrl+V, etc.
            return
2023-04-26 21:25:57 -04:00
Isaiah Odhner
a7619b7721 Copy selected text within textbox, instead of whole textbox 2023-04-26 21:25:57 -04:00
Isaiah Odhner
abb1e9128d Refactor: extract selected_text_range and supporting functions 2023-04-26 21:11:26 -04:00
Isaiah Odhner
df2d19af0a Fix background color of text pasted into textbox 2023-04-26 21:02:32 -04:00
Isaiah Odhner
09a03bdcbf Paste text into textbox 2023-04-26 20:35:13 -04:00
Isaiah Odhner
1c9fb0ca1b Delete/backspace ranges of text 2023-04-26 17:54:00 -04:00
Isaiah Odhner
06836d77bb Add textbox variable to shorten code 2023-04-26 17:24:28 -04:00
Isaiah Odhner
66f0e3fd42 Tweak comments in on_key in PaintApp 2023-04-26 17:23:45 -04:00
Isaiah Odhner
e3c985d0a5 Fix indent 2023-04-26 17:15:27 -04:00
Isaiah Odhner
0754db7218 Fix IndexError when pressing Ctrl+A followed by Delete in a textbox 2023-04-26 17:08:32 -04:00
Isaiah Odhner
c1375d81ed Make Select All select text within the textbox, if applicable 2023-04-26 17:04:24 -04:00
Isaiah Odhner
088b7e9b2d Clamp text selection endpoint while dragging
This fixes weird or non-traditional behavior where dragging further away
from the textbox when the mouse is outside the textbox would continue to
offset the cursor index. It wasn't totally unreasonable, but the
traditional behavior is to clamp it, and it makes it easier to select
whole lines.
2023-04-26 17:00:54 -04:00
Isaiah Odhner
c46586cc51 Show text selection within Textbox, and update it with Shift+arrows 2023-04-26 16:47:55 -04:00
Isaiah Odhner
93eac0fc0e Actually, replace NUL only when selected 2023-04-26 15:48:21 -04:00
Isaiah Odhner
22cba20c35 Replace NUL in loop instead of in the string literal 2023-04-26 15:47:03 -04:00
Isaiah Odhner
da3136a2d2 Fix code page 437 string
It had an extra "▀", and skipped the null at the start (which I'm
replacing with a space so it doesn't mess up the screen when inserting.)
2023-04-26 15:36:16 -04:00
Isaiah Odhner
1f171259bb Fix shifted/cutoff selection when melding with negative coordinates
Code intended to prevent errors was also creating an offset between
the source and target regions. The source region needs to be adjusted
to match the clipped target region.
2023-04-26 13:49:33 -04:00
Isaiah Odhner
0c52788843 Fix some type checker errors 2023-04-26 13:35:52 -04:00
Isaiah Odhner
3f3375c1fd Paste to top left of viewport (when scrolled right/down) 2023-04-26 13:13:42 -04:00
Isaiah Odhner
5bd6684ba7 Clean up commented out clipboard code 2023-04-26 13:03:53 -04:00
Isaiah Odhner
5fe0178d36 Note new dependencies in installation instructions 2023-04-26 12:52:27 -04:00
Isaiah Odhner
f114723be4 Make pasting undoable 2023-04-26 12:47:08 -04:00
Isaiah Odhner
55c280cdfb Don't use pyperclip.is_available() 2023-04-26 12:38:14 -04:00
Isaiah Odhner
8c936552b7 Don't delete selection if copy fails during cut 2023-04-26 12:32:12 -04:00
Isaiah Odhner
0c3cc45ddd Start implementing copy/paste with pyperclip 2023-04-26 12:28:42 -04:00
Isaiah Odhner
ed5e399a58 Don't delete the whole textbox when pressing Delete 2023-04-26 11:19:16 -04:00
Isaiah Odhner
fe8c05bdc0 Reorder expanding_directory_tree next to directory_tree_selected_path 2023-04-26 03:21:09 -04:00
Isaiah Odhner
c81d45756b Add docstrings to all PaintApp state, replacing comments 2023-04-26 03:19:23 -04:00
Isaiah Odhner
3849f57ed6 Add docstrings to all functions 2023-04-26 03:01:00 -04:00
Isaiah Odhner
a5518a5894 Remove redundant cancel_preview, handled by stop_action_in_progress 2023-04-26 02:38:27 -04:00
Isaiah Odhner
6d6ef25da4 Cancel active tool by pressing both mouse buttons 2023-04-26 01:30:36 -04:00
Isaiah Odhner
bf8c7fa1a6 Comment/typecheck new CharInput render_line code 2023-04-26 01:24:37 -04:00
Isaiah Odhner
818cf55c5e I drew some galaxies
just messin' around
2023-04-26 01:14:38 -04:00
Isaiah Odhner
63c9a3ea11 Cancel active tool with Escape 2023-04-26 00:38:50 -04:00
Isaiah Odhner
c6967c69f5 Show selected foreground color in the CharInput 2023-04-26 00:06:57 -04:00
Isaiah Odhner
d043d444e9 Hide selection border while dragging 2023-04-25 19:22:57 -04:00
Isaiah Odhner
15ffabbaac Use repr instead of str when formatting exceptions
This is a little better, but not great.
2023-04-25 19:03:50 -04:00
Isaiah Odhner
1ab1dfb037 Fix extraneous white cell at top left when loading ANSI files 2023-04-25 18:43:28 -04:00
Isaiah Odhner
ba7f8e6a0a Don't invert the inner textbox border, that's too visually confusing 2023-04-25 18:31:50 -04:00
Isaiah Odhner
5ba8cbdbb8 Fix assertion error when using Select or Text before any other tool
AssertionError: selection_drag_offset should only be set if there's a selection
2023-04-25 18:26:15 -04:00
Isaiah Odhner
aae99c3247 Add parenthesis in complex canvas rendering conditional 2023-04-25 18:19:54 -04:00