Commit Graph

1129 Commits

Author SHA1 Message Date
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
Isaiah Odhner
3fe9fed6ad Clean up some things 2023-06-09 21:58:46 -04:00
Isaiah Odhner
bb9042a6c0 Fix extraneous space 2023-06-09 21:39:30 -04:00
Isaiah Odhner
9f283458bf Fix color highlight for border properties where it's not the whole value 2023-06-09 21:37:20 -04:00
Isaiah Odhner
3f55179ef7 Fix color highlight for some color syntax 2023-06-09 21:21:25 -04:00
Isaiah Odhner
dfcdd33a7a Highlight color values also within rule sets
This also removes an extraneous newline for an empty inline styles block (by accident)
2023-06-09 21:03:42 -04:00
Isaiah Odhner
675cee043f Clean up 2023-06-09 20:02:52 -04:00
Isaiah Odhner
f677a3337c Highlight color values in inline styles in inspector 2023-06-09 18:17:09 -04:00
Isaiah Odhner
7bae717df1 Mark *args/**kwargs as Any for RuleSet instrumentation 2023-06-09 17:43:04 -04:00
Isaiah Odhner
812d628c42 Add tooltips to tool buttons 2023-06-09 15:13:29 -04:00
Isaiah Odhner
2bc8d33079 Disable DOM inspector when --inspect-layout isn't passed
In the future I could make this more flexible, since you don't always
need the instrumentation in order to benefit from the inspector.
2023-06-09 02:02:36 -04:00
Isaiah Odhner
ca1780ce0d Remove special handling for textual run that's no longer needed
No that it's a run as a module, the arguments are separated:

$ textual run --dev "src.textual_paint.paint --language en --clear-screen --inspect-layout --restart-on-changes samples/ship.ans"
	__name__: src.textual_paint.paint
	sys.argv: ['-c', '--language', 'en', '--clear-screen', '--inspect-layout', '--restart-on-changes', 'samples/ship.ans']

$ python -m "src.textual_paint.paint" --language en --clear-screen --inspect-layout --restart-on
-changes samples/ship.ans
	__name__: __main__
	sys.argv: ['/home/io/Projects/textual-paint/src/textual_paint/paint.py', '--language', 'en', '--clear-screen', '--inspect-layout', '--restart-on-changes', 'samples/ship.ans']

$ python src/textual_paint/paint.py --language en --clear-screen --inspect-layout --restart-on-changes samples/ship.ans
	__name__: __main__
	sys.argv: ['src/textual_paint/paint.py', '--language', 'en', '--clear-screen', '--inspect-layout', '--restart-on-changes', 'samples/ship.ans']

$ src/textual_paint/paint.py --language en --clear-screen --inspect-layout --restart-on-changes 
samples/ship.ans
	__name__: __main__
	sys.argv: ['src/textual_paint/paint.py', '--language', 'en', '--clear-screen', '--inspect-layout', '--restart-on-changes', 'samples/ship.ans']
2023-06-09 01:27:13 -04:00
Isaiah Odhner
178e4c0689 Fix name of program in help text
Originally it was `paint.py`, but after switching to running as a module
(needed to use Python's relative imports for some reason) it became "-c"
when running with the `textual` CLI.
2023-06-09 01:27:13 -04:00
Isaiah Odhner
c15e8ce427 Handle "ValueError: No closing quotation" on paste with MMB
I'm not sure what I had in the clipboard that triggered this,
but it reproduces easily enough with `"unbalanced`
2023-06-09 01:27:13 -04:00
Isaiah Odhner
8c0bb993ad How much shading is too much shading? 2023-06-09 00:12:13 -04:00
Isaiah Odhner
beefe9f560 Tweak Paint icon (the cup, and shading of the cup and folded corner) 2023-06-08 23:54:56 -04:00
Isaiah Odhner
c83efb4ddf Tweak Paint icon, using heavy slashes
- Use very heavy solidus for paint brushes. This renders in a strange
  overlapped way in Ubuntu Terminal and VS Code's terminal, which
  actually works really well here. I just hope it doesn't become
  a wide character in the future, or isn't treated as such on other
  terminals.
- Add brush tips to the other brushes, each using a different character.
- Remove top border, since it conflicts with brush tips.
2023-06-08 23:54:56 -04:00
Isaiah Odhner
7e30f39374 Add Paint icon ANSI art to Help > About Paint 2023-06-08 23:54:56 -04:00
Isaiah Odhner
b1951cb555 Note about virtual environments 2023-06-08 23:54:56 -04:00
Isaiah Odhner
a166a6af29 Note how to install CLI for development 2023-06-08 23:54:56 -04:00
Isaiah Odhner
349f87c3e7 Disable automatic updating of CLI info on the readme
This caused an error when running from the console entry point,
as it's not intended to work in production/release.
2023-06-08 23:54:56 -04:00
Isaiah Odhner
512fe69e9e Get console entry point working 2023-06-08 23:53:33 -04:00
Isaiah Odhner
d77a785a64 Update commands now that it must be run as a module 2023-06-08 23:47:53 -04:00
Isaiah Odhner
3364e11b5d Convert to relative imports
It no longer runs except with `python -m src.textual_paint.paint`
2023-06-07 22:38:09 -04:00
Isaiah Odhner
c4c1572dac Add meta data to inspector module 2023-06-07 16:12:26 -04:00
Isaiah Odhner
c17e1a905d Ignore more stack frames for framework style setter shortcuts
This lets it jump directly to `my_widget.display = False`, rather than
the `display` setter method in dom.py, for example.
2023-06-07 16:01:26 -04:00
Isaiah Odhner
3dfc1985b1 This is done (basically) 2023-06-07 15:38:26 -04:00
Isaiah Odhner
e414e46400 Fix inline styles left by inspector after resetting highlight
`widget.styles.tint` will return a default transparent (#00000000)
value, rather than None, when not set.

`border` doesn't work the same as the others here, but I'm not using it,
so I can just disable the styles I'm not using.
2023-06-07 15:31:22 -04:00
Isaiah Odhner
789f1776cb Fix linking to code that set inline styles for hyphenated/shorthand properties 2023-06-07 15:01:06 -04:00
Isaiah Odhner
2a8395581a Improve source code link formatting 2023-06-07 03:26:35 -04:00
Isaiah Odhner
ddcff5c955 DRY source code location info formatting 2023-06-07 03:05:30 -04:00
Isaiah Odhner
d10d5d33ba Fix opening file without a known line number 2023-06-07 02:55:44 -04:00
Isaiah Odhner
9f84b6206c Link to source code for CSS rule sets 2023-06-07 02:55:44 -04:00
Isaiah Odhner
3409992ae6 Link to source code that set inline styles
Impossible? No! Just add a little instrumentation magic... 🪄
2023-06-07 01:27:40 -04:00
Isaiah Odhner
10491e3d16 Show actual CSS rule sets in the inspector, not just a style dump 2023-06-06 22:28:43 -04:00
Isaiah Odhner
79ff919e14 Fix aborting picking when closing inspector with F12 2023-06-06 18:46:49 -04:00
Isaiah Odhner
b1e1a5ea4d Make resize handles subtle (invisible until hover)
I surveyed `def render_line` in the Textual codebase to find the right
property to get the `color` CSS property working for ResizeHandle:

- `self.styles`: wrong type
- `self.get_component_rich_style()`: would overcomplicate things
- `self.text_style`: wrong
- `self.rich_style`: right

Now I can use `:hover` styles, and restore some of the elegance of the
look of the inspector by hiding the resize handles until mouse over.
2023-06-06 18:33:27 -04:00
Isaiah Odhner
5e6bdbf323 Add internal resize handle to inspector 2023-06-06 18:16:44 -04:00
Isaiah Odhner
1620f3b5d3 Fix tab underline in inspector
It was an overly general CSS rule, confusingly applying to Tab,
because it's a *subclass* of Static.

Inspector features that would make this easier to understand would be:
- Showing what rules apply to a given widget, instead of just a CSS dump
- Showing better why exactly it was invisible
2023-06-06 17:40:08 -04:00
Isaiah Odhner
5ddb5c22a8 Found another good candidate for crosshair symbol 2023-06-05 15:58:23 -04:00
Isaiah Odhner
ce1b26543d Add resize handle to inspector panel 2023-06-04 20:04:51 -04:00