Commit Graph

1277 Commits

Author SHA1 Message Date
Isaiah Odhner
2bbee95142 Sort so folders are grouped together 2023-09-06 17:23:46 -04:00
Isaiah Odhner
25a4b0826b Filter by file extension earlier 2023-09-06 17:20:08 -04:00
Isaiah Odhner
947534df3e Replace complex bash one-liner with the new gallery app 2023-09-06 15:09:18 -04:00
Isaiah Odhner
349f94f69e Add more docstrings
I think that's all the module docstrings.
2023-09-06 14:57:04 -04:00
Isaiah Odhner
769ccee30e Auto-organize imports
I don't really like the style of wrapping to different points depending
on where the opening parenthesis is, especially when it wraps for just
one item, and these changes may remove some semantic grouping or
ordering (i.e. by importance), but I don't think I put THAT much thought
into it, and I think I can accept some lack of control, to freely use
the Organize Imports command in VS Code, which does nicely automate
grouping imports of different types.
2023-09-06 14:15:42 -04:00
Isaiah Odhner
179cceed57 Avoid global statement for ID counter 2023-09-06 13:57:12 -04:00
Isaiah Odhner
ea0d90952a Add some docstrings 2023-09-06 13:48:13 -04:00
Isaiah Odhner
f1d6b266aa Fix multiple error cases reached
With `textual run --dev "src.textual_paint.gallery foobar"` it output:

    Folder not found: foobar
    Not a folder: foobar
    No ANSI art (*.ans, *.txt) found in folder: foobar

    NOTE: 3 errors shown above.

Now it correctly outputs only:

    Folder not found: foobar
2023-09-06 13:34:35 -04:00
Isaiah Odhner
5441c0d3b0 Extract AnsiArtDocument and friends to files
This fixes the gallery app's --help, because before it was importing the "paint" module, which imported "args", which parsed arguments for the paint app instead of the gallery app.

This is also a refactor I've been meaning to do — since the very beginning, really — and it would've been a lot less trouble if I could've done it from the beginning, but I couldn't get imports to work. Yeah, really. Sounds pretty stupid 'cause it is. Python's module system is terrible.
2023-09-06 13:27:47 -04:00
Isaiah Odhner
9c2b48ec21 Fix --restart-on-changes
This fixes "NameError: name 'PaintApp' is not defined"

PaintApp is only defined during type checking (i.e. if TYPE_CHECKING).
It would be nice if the type checker warned about usage of such vars outside of type annotations.
2023-09-06 13:27:47 -04:00
Isaiah Odhner
d8bc66d610 Clean up gallery styles 2023-09-06 13:27:47 -04:00
Isaiah Odhner
220509f33f Sort files in gallery, taking into account X.Y numbers 2023-09-06 13:27:47 -04:00
Isaiah Odhner
bf8b60f5e0 Show directory better in case of error 2023-09-06 13:27:47 -04:00
Isaiah Odhner
ce3def0ec5 Include .txt files 2023-09-06 13:27:47 -04:00
Isaiah Odhner
ace77e04a9 Recursively find the .ans files 2023-09-06 13:27:47 -04:00
Isaiah Odhner
23f7aa0703 Allow scrolling when ANSI art is larger than the viewport 2023-09-06 13:27:47 -04:00
Isaiah Odhner
5dca142d6e This doesn't show up, though, if left/right are first
I believe the scrollable container's left/right bindings are winning
in terms of display in the Footer, even though mine have priority
in terms of functionality.
2023-09-06 13:26:53 -04:00
Isaiah Odhner
8cde322a3d Get keyboard navigation working in gallery 2023-09-06 13:26:53 -04:00
Isaiah Odhner
eeef27e99b Disable ugly debug styles 2023-09-06 11:50:38 -04:00
Isaiah Odhner
3e2ded8abd Hide dev feature key bindings from footer, clean up 2023-09-06 11:50:38 -04:00
Isaiah Odhner
652e18f76c Center image vertically 2023-09-06 11:48:23 -04:00
Isaiah Odhner
0c725d5217 Fix Quit binding in gallery 2023-09-06 11:48:23 -04:00
Isaiah Odhner
988a82addb Get the image centered
This is somewhat mysterious, but it's working finally!
2023-09-06 11:48:23 -04:00
Isaiah Odhner
d90f83de21 Ignore lack of discard_backup on GalleryApp 2023-09-06 11:46:32 -04:00
Isaiah Odhner
59feafc309 WIP: bindings for gallery app
Why are the bindings not working? Ctrl+Q doesn't work, left/right don't even show up!
2023-09-06 11:45:44 -04:00
Isaiah Odhner
32a10ab1d1 Try to center image (not working) 2023-09-06 11:45:01 -04:00
Isaiah Odhner
9140d14405 Set up development features for gallery app 2023-09-06 11:44:16 -04:00
Isaiah Odhner
937dabb73c Start making a gallery app for ANSI art 2023-09-06 01:17:58 -04:00
Isaiah Odhner
3d8142bb50 Maybe a heart is cuter, for a cat's nose 2023-09-06 00:33:01 -04:00
Isaiah Odhner
8626fa775c Update note about watchdog
It's no longer required, since commit "Make watchdog properly optional" da0e5e52da
2023-09-06 00:05:26 -04:00
Isaiah Odhner
751c4f2bbd Make radio buttons rounder in --ascii-only mode 2023-09-05 22:15:23 -04:00
Isaiah Odhner
ec988c2b4c Prepare v0.2.0 2023-09-05 21:30:54 -04:00
Isaiah Odhner
707f180fe7 Ensure scrollbar thumb is small enough to move when scrolling
In the normal scrollbar render implementation, which uses fractional block characters, thumb_size makes sense as a float, but here, it can lead to cases where the scrollbar thumb takes up the entire scrollbar even though scrolling is possible, if it's not snapped to an integer number of cells. (In the original implementation, perhaps it can still run into such cases, but it would need a more extreme fraction?)
2023-09-05 20:03:05 -04:00
Isaiah Odhner
96f5c959eb Clean up ASCIIScrollBarRender 2023-09-05 20:03:05 -04:00
Isaiah Odhner
7c4947df12 ASCII-ize scrollbar in --ascii-only mode 2023-09-05 19:24:52 -04:00
Isaiah Odhner
e2c53e48a0 Finish ASCIIficating radio buttons in --ascii-only mode 2023-09-05 18:58:48 -04:00
Isaiah Odhner
ab29b0f5ae Group development options in CLI help 2023-09-05 17:57:33 -04:00
Isaiah Odhner
c610019430 Automatically update CLI help on readme, during development 2023-09-05 17:39:07 -04:00
Isaiah Odhner
e200501518 Ignore some private accesses
It's fiiiiine... (until these things change, and the type: ignore comment starts hiding an actual problem)
2023-09-04 22:05:42 -04:00
Isaiah Odhner
38c40f4b77 Set HeaderIcon instance's icon instead of overwriting class variable 2023-09-04 22:02:10 -04:00
Isaiah Odhner
c9757a4549 Remove all trailing whitespace
using regular expression: \s+$
2023-09-04 21:47:58 -04:00
Isaiah Odhner
bd6ce9b3a7 Press 'f' to pay respects 2023-09-04 21:43:48 -04:00
Isaiah Odhner
379249c237 Update changelog 2023-09-04 21:22:36 -04:00
Isaiah Odhner
8101c9c962 Bold brush handles in Paint icon in header 2023-09-04 21:22:36 -04:00
Isaiah Odhner
576778de45 Un-bold parts of the Windows logo icon 2023-09-04 20:20:36 -04:00
Isaiah Odhner
724762e110 Crop header icon to hide shadow of hidden page curl 2023-09-04 19:53:43 -04:00
Isaiah Odhner
b818c2c99b Handle running from outside repo when reporting version 2023-09-04 19:37:07 -04:00
Isaiah Odhner
1897dbe386 Tweak Header icon 2023-09-04 19:06:59 -04:00
Isaiah Odhner
fea5cf8894 Show tiny Paint icon ASCII art in Header (regardless of --ascii-only) 2023-09-04 18:27:44 -04:00
Isaiah Odhner
79b9c37c09 ASCIItulate radio buttons in --ascii-only mode
I think that's the last thing! Except for the weird circle in the Header widget, and my NanoTiny font when zoomed in.
2023-09-04 17:54:43 -04:00