Commit Graph

1319 Commits

Author SHA1 Message Date
Isaiah Odhner
14475154b9 If you type a folder's path in a file dialog, expand it 2023-06-27 12:29:18 -04:00
Isaiah Odhner
d0385556d1 Allow ~user and env var substitutions in file dialogs
(The todo removed was already satisfied, as it turns out.)
2023-06-20 00:38:53 -04:00
Isaiah Odhner
99b598c0dc Improve window constraints 2023-06-19 22:15:02 -04:00
Isaiah Odhner
7c420416c3 Prevent prepopulating file name in Copy To and Paste From dialogs 2023-06-19 22:15:02 -04:00
Isaiah Odhner
75928bc1da Clean up 2023-06-19 22:14:06 -04:00
Isaiah Odhner
27e1bbe264 Refactor: use new autofocus handling for file dialogs 2023-06-19 22:14:06 -04:00
Isaiah Odhner
e62eb42bd9 Set default focus in Attributes, Custom Zoom, and Edit Colors windows 2023-06-19 22:14:06 -04:00
Isaiah Odhner
8a5cfa9199 Now where has my pipe been? 2023-06-19 22:14:06 -04:00
Isaiah Odhner
8fdc7b7b8b Now where could my pipe be? 2023-06-17 19:41:00 -04:00
Isaiah Odhner
3600bea25d Load/save color palettes 2023-06-17 19:41:00 -04:00
Isaiah Odhner
53a733ae32 Suggest installing from requirements.txt
I had to blow away my virtual environment, and installing from
requirements.txt worked whereas the existing line didn't, I guess due to
the fixed version number of textual. I don't know exactly, but it seems
pretty silly to try to maintain this list of requirements separately.
2023-06-16 18:07:40 -04:00
Isaiah Odhner
93f98a89e7 Add todos and clarifying notes 2023-06-15 17:46:19 -04:00
Isaiah Odhner
7b32452066 Abort if error occurred when reloading to show information loss during save
I'm not sure about this...
2023-06-14 00:15:53 -04:00
Isaiah Odhner
572d60076f Duplicate error handling for reloading after information loss on save 2023-06-14 00:13:30 -04:00
Isaiah Odhner
faa41d07b2 Confirm discarding information during Save/Open/New, not just Save As 2023-06-13 23:46:30 -04:00
Isaiah Odhner
29e9e7a384 Refactor some encode_based_on_file_extension into encode_to_format
This avoids duplicately detecting the format from the file extension
in one case, and in the other case, avoids using a bogus file name to
implement a default fallback file format.
2023-06-13 19:44:08 -04:00
Isaiah Odhner
737115a00b Refactor confirming information loss 2023-06-13 19:25:44 -04:00
Isaiah Odhner
0a176fc1a4 Prevent unloading document if save fails 2023-06-13 19:14:35 -04:00
Isaiah Odhner
f2facf8a68 Rename is_resize -> is_full_update 2023-06-13 18:27:24 -04:00
Isaiah Odhner
2ed803631b Allow undoing color or character information loss
Of course, this highlights the need to prompt during Save as well,
not just Save As, or to make creating color or character information
impossible depending on the type of file that is open.
2023-06-13 14:50:08 -04:00
Isaiah Odhner
17b4a67455 Fix reloading file after losing color or character information
Can't use self.open_from_file_path because:
1. it short-circuits if the file is already open
2. it clears the undo history*
3. it does stuff with the backup file
4. plus it's not as efficient to use the FS, and it uses a callback,
   which is a pain.

*TODO: make the reload undoable
2023-06-13 14:50:08 -04:00
Isaiah Odhner
3a3a554857 Confirm losing color or character information 2023-06-13 14:50:08 -04:00
Isaiah Odhner
a598f83047 Add source column to key bindings table 2023-06-13 01:56:11 -04:00
Isaiah Odhner
d1318e696b Center checkmarks in the boolean columns 2023-06-13 01:46:55 -04:00
Isaiah Odhner
8ec9056bdf Fix "Nothing selected" text getting pushed down in Keys tab
This is just a workaround.
2023-06-13 01:38:19 -04:00
Isaiah Odhner
a690a45a98 Show key bindings in a DataTable in the inspector
This now shows bindings from ancestors DOM nodes as well.
2023-06-13 01:38:19 -04:00
Isaiah Odhner
adc21a1ef4 Prevent "(edited)" mark for unchanged values (again!)
I implemented this previously in 8278e5da94
and had to redo it after changing it to use merge()
2023-06-12 22:38:49 -04:00
Isaiah Odhner
750c77b0ed Fix editing inline styles after first time 2023-06-12 22:20:01 -04:00
Isaiah Odhner
d69334c102 Fix "(edited)" marks
Update style traces when styles are changed with `merge`/`merge_rules`.

I wish `merge` used `merge_rules` so I could define just one extra
instrumentation point. I guess I could make my `merge` use my version of
`merge_rules`, but that feels weird, even if it's probably not any more
fragile to implement it that way.
2023-06-12 21:54:25 -04:00
Isaiah Odhner
8911c406be Add error handling for inline style editing, breaking "(edited)" marks
Using .merge() isn't tracked by the call stack recording (yet), so it
can no longer attribute inline styles to editing with the inspector,
but this lack of tracking was already a problem, it just highlights it.
2023-06-12 20:48:55 -04:00
Isaiah Odhner
8278e5da94 Prevent "(edited)" mark when value was left unchanged 2023-06-12 20:06:53 -04:00
Isaiah Odhner
61eb8631b2 Edit inline styles in CSS tab of inspector 2023-06-12 20:02:29 -04:00
Isaiah Odhner
52c26ade26 Update import in an unused module 2023-06-12 00:43:42 -04:00
Isaiah Odhner
bf675e4c51 Fix two related type checking errors 2023-06-12 00:43:42 -04:00
Isaiah Odhner
93d176e656 Pyright: ignore build folder
Python files get copied to the build folder. It's kinda confusing to see type checking errors for old versions of files.
2023-06-12 00:43:42 -04:00
Isaiah Odhner
5eaabd6754 VS Code: mark files as readonly 2023-06-12 00:43:42 -04:00
Isaiah Odhner
0f5193dc50 Move auto restart code to a module 2023-06-12 00:23:51 -04:00
Isaiah Odhner
6946669a41 Update screenshot, and screenshot methodology, and remove table wrapper
The old screenshot was generated by Select All and Copy As HTML in
Ubuntu's Terminal app (using a keyboard shortcut that had to be set up
first), and post-processed using code included in screenshot.svg, which
I'm now deleting.

The new screenshot is generated using Textual's built-in SVG export.
It displays nicer, with less artifacts (seams between cells).
It doesn't need such silly explanation of the nature of the screenshot,
and was also sizing to the width of the text, so I removed the wrapper
table which was imitating (standing in for) figure/figcaption elements.

The new screenshot also includes a window border, macOS-styled, which is
a little weird since it's a remake of MS Paint (Windows software)
developed entirely on Ubuntu (Linux distro).
2023-06-11 22:59:37 -04:00
Isaiah Odhner
8f40c77d6f Point to .venv/bin/textual in VS Code launch configurations 2023-06-11 18:58:02 -04:00
Isaiah Odhner
a0f626a339 Poke around the UI to find untranslated strings
(This is generally inferior to source code analysis.)

There's also the Help / About Paint dialogs.
2023-06-11 17:42:52 -04:00
Isaiah Odhner
1d089db36b Fix localization support (--language option)
Broken in "Move package files to folder src/textual_paint/" c55620dd35
2023-06-11 17:28:49 -04:00
Isaiah Odhner
1291fd1d47 Add a few todos for the inspector 2023-06-11 16:55:59 -04:00
Isaiah Odhner
e28c7a3c7e Remove paint palette emoji, superseded by logo text art 2023-06-11 02:37:14 -04:00
Isaiah Odhner
07395517ea Update remaining command lines to run the app as a module 2023-06-10 21:20:17 -04:00
Isaiah Odhner
6fae6e501e Expand default target directory (if you Open/Save from a New file) 2023-06-10 21:09:02 -04:00
Isaiah Odhner
4e1f11ab23 Fix expanding directory tree to current folder, in file dialogs
- This regressed due to updates in Textual 0.25.0,
  because DirectoryTree now loads directory contents in a worker:
  https://github.com/Textualize/textual/issues/2456
- Directory tree expansion may be more robust now, although it's using
  more internals now, and it still needs timers for whatever reason.
2023-06-10 21:05:19 -04:00
Isaiah Odhner
9f7f198518 Ignore backup file not existing when comparing file identity 2023-06-10 18:14:56 -04:00
Isaiah Odhner
58cfbfae0a Fix discarding Untitled.ans~ on startup 2023-06-10 18:13:35 -04:00
Isaiah Odhner
1b5d1ce988 Disable most print statements 2023-06-10 02:21:53 -04:00
Isaiah Odhner
2631256994 Try a more heavy-handed way of getting GitHub to detect the language 2023-06-09 23:24:55 -04:00