Commit Graph

1450 Commits

Author SHA1 Message Date
Isaiah Odhner
3e9f1dd94b Tidy imports 2023-09-15 23:44:22 -04:00
Isaiah Odhner
22ce654579 Move method next to other ColorsBox event handler 2023-09-15 23:36:08 -04:00
Isaiah Odhner
82e0fbada7 Re-optimize ColorsBox palette updating 2023-09-15 23:31:29 -04:00
Isaiah Odhner
0647e7be8b Decouple ColorsBox from PaintApp
There's no practical utility in this unless I want to make the palette size variable,
and this makes performance worse updating the screen when the palette changes,
but I'm on a mission to remove `from textual_paint.paint import PaintApp`
since it can't be at top level due to cyclic imports, and it has
side effects when importing `textual_paint.args` in turn.
2023-09-15 23:25:21 -04:00
Isaiah Odhner
a2cf93ae99 Update palette reactively 2023-09-15 23:00:29 -04:00
Isaiah Odhner
f1d288d79c Make palette immutable 2023-09-15 22:53:40 -04:00
Isaiah Odhner
b34c03e788 Tweak changelog entry wording 2023-09-15 22:29:19 -04:00
Isaiah Odhner
80d9f38318 Move ThemedIcon to a separate file 2023-09-15 22:07:04 -04:00
Isaiah Odhner
0f617dd8c4 Dynamically theme message box icons 2023-09-15 22:03:34 -04:00
Isaiah Odhner
7a13659d48 Fix "Show Details" not changing to "Hide Details" when expanding error 2023-09-15 20:44:40 -04:00
Isaiah Odhner
0c44759b28 Refactor to avoid using negative coords to mean "no mouse position"
My TODO comment said "add an attribute to ToolPreviewUpdate or make it's x/y Optional", which is both bad grammar ("it's" vs "its") and a bad idea, since the Canvas isn't involved in this update, so its event definition shouldn't have to be complicated by it.

I like this much better, just splitting the event handler into two functions, giving room to express the optional nature of the coordinate in the signature, and avoiding constructing two message objects at both of the callsites.
2023-09-15 20:21:19 -04:00
Isaiah Odhner
fc1baa9815 Move imports so that Organize Imports doesn't break it
Before, if I ran Organize Imports in VS Code, it reordered things such that `sys.path.insert` was after the import that needed it.
Now it's stable.
2023-09-15 19:56:27 -04:00
Isaiah Odhner
b6e2c245a2 Get file dialog snapshot tests passing on Windows
Now it's just a few round trip tests failing, and maybe a flaky snapshot test for the character selector dialog.
2023-09-15 17:13:15 -04:00
Isaiah Odhner
8cd164bb37 Fix preventing icon swaps during pytest, for Windows Terminal and Kitty
If git blame tools were smarter/easier to use, or if I was using a node-based programming paradigm, I would've never made this mistake. I would have done the natural and correct thing in the first place, but instead, I tried to avoid indenting a large block of code, which generates a noisy commit, and a barrier when using git blame.
2023-09-15 17:08:13 -04:00
Isaiah Odhner
857e459b2d Get tests running, if not passing, on Windows 2023-09-15 17:08:13 -04:00
Isaiah Odhner
40291f29fd Add fake folders to mask OS differences in snapshot tests
Now the tests pass on macOS, not just Ubuntu. Not sure about Windows.
2023-09-15 17:08:13 -04:00
Isaiah Odhner
7838b6373b Tweak changelog 2023-09-14 20:50:48 -04:00
Isaiah Odhner
7fa80b853c Fix flaky test due to pressed button style 2023-09-14 20:22:48 -04:00
Isaiah Odhner
ba4d023387 Fix status bar showing -100, -100 value I used for color updates 2023-09-14 20:21:05 -04:00
Isaiah Odhner
d229bc4108 Ignore new snapshot testing related files for spell checking 2023-09-14 20:08:00 -04:00
Isaiah Odhner
91b2c285fe Re-color in-progress polygon/curve immediately 2023-09-14 20:04:31 -04:00
Isaiah Odhner
ad39f34084 Add Polygon test with dragging 2023-09-14 16:58:47 -04:00
Isaiah Odhner
3f1c6c964a Fix Polygon tool detecting double clicks despite distance 2023-09-14 16:32:40 -04:00
Isaiah Odhner
da7f8f350e Not sure about un-dimming colors in header icon 2023-09-14 16:13:10 -04:00
Isaiah Odhner
b6d0d2cc7b Delete debug scratchpad for polygon test 2023-09-14 15:09:22 -04:00
Isaiah Odhner
bf8e445f69 Make palette state local to the app instance 2023-09-14 02:31:49 -04:00
Isaiah Odhner
faa9c76ba8 Test file drag-and-drop handling 2023-09-14 02:03:52 -04:00
Isaiah Odhner
070e253394 Move fixtures to conftest.py 2023-09-14 01:17:01 -04:00
Isaiah Odhner
9280dcdb92 Fix ASCII-only mode test failures 2023-09-13 23:41:37 -04:00
Isaiah Odhner
3b247cde1a Move window titlebar icons to icons module 2023-09-13 23:27:46 -04:00
Isaiah Odhner
3922d1e3d0 Move ColorsBox to a new file 2023-09-13 22:36:32 -04:00
Isaiah Odhner
548f381ad1 Move CharInput to a new file 2023-09-13 22:36:20 -04:00
Isaiah Odhner
9efc2592aa Move selected tool highlighting to ToolsBox 2023-09-13 22:15:15 -04:00
Isaiah Odhner
072f8327c0 Move ToolsBox to a new file 2023-09-13 22:07:16 -04:00
Isaiah Odhner
88b1de94ed Improve Canvas docstring 2023-09-13 21:54:46 -04:00
Isaiah Odhner
5e561c02b0 Move Canvas widget and MetaGlyphFont class to new files 2023-09-13 21:54:39 -04:00
Isaiah Odhner
1946188927 Move Action class to a new file 2023-09-13 19:19:05 -04:00
Isaiah Odhner
5ee858f4f2 Move Tool enum to new file 2023-09-13 19:09:40 -04:00
Isaiah Odhner
5d579a61c4 Move header icon to icons module 2023-09-13 19:01:02 -04:00
Isaiah Odhner
326d7b551a Remove unused import
was used by --recode-samples
2023-09-13 18:58:03 -04:00
Isaiah Odhner
6c55c31696 Move icons to a new file 2023-09-13 18:51:54 -04:00
Isaiah Odhner
4a0b91e323 Move CharacterSelectorDialogWindow to a separate file 2023-09-13 12:55:36 -04:00
Isaiah Odhner
5a7ba995c0 Accept super trivial change to About dialog snapshots
The scrollbar handle is slightly taller now because I removed the `--recode-samples` option.
2023-09-13 02:37:37 -04:00
Isaiah Odhner
c538787ff2 Recurse into subfolders for re-encoding round trip test
There are many more failures now, which I should probably take a look at
at some point, but I don't know how to best inspect the changes yet.
I'll mark these as xfail (expected to fail) for now.
2023-09-13 02:24:25 -04:00
Isaiah Odhner
bb047c04e7 Move --recode-samples to an automated test 2023-09-12 21:54:19 -04:00
Isaiah Odhner
6f13a5a302 Clean up 2023-09-12 21:23:36 -04:00
Isaiah Odhner
1f1bf577f2 Disable tool icon swaps when running in pytest 2023-09-12 21:08:24 -04:00
Isaiah Odhner
e288d5d41c Update changelog and readme 2023-09-12 20:50:57 -04:00
Isaiah Odhner
08847ca91b Fix Free-Form Select behavior when melding with negative coordinates 2023-09-12 20:16:55 -04:00
Isaiah Odhner
96fe28269d Accept changes to file dialog snapshots
...but NOT the Free-Form Select test! I'm noticing that when marked
as skipped, running with --snapshot-update deletes the snapshot.
So neither xfail or skip (or xfail with run=False) is a good solution.
It's almost as if people don't normally do TDD with snapshots.

Anyways, HOPEFULLY I can move on now, to actually fixing things,
like the Polygon tool, and new bugs I've found while adding tests.
2023-09-12 19:45:41 -04:00