Commit Graph

485 Commits

Author SHA1 Message Date
Isaiah Odhner
27c95a537c Make mouse_at_start an Offset (consistently)
It was already initially defined as an Offset.
2023-04-22 01:12:48 -04:00
Isaiah Odhner
45fb2eb521 Implement polygon tool 2023-04-22 01:07:20 -04:00
Isaiah Odhner
2c469a5ef3 Draw curve preview also on mouse up and mouse down events
It feels more solid now, but it still disappears if the mouse leaves the canvas.
2023-04-21 23:52:23 -04:00
Isaiah Odhner
4f99b9f6a7 Make eraser tool square
I also have an erase_region method I could use now, alternatively.
2023-04-21 23:45:04 -04:00
Isaiah Odhner
6ce1856ec7 Fix brush/pencil/eraser previews 2023-04-21 23:40:48 -04:00
Isaiah Odhner
55e6ed6caf DRY some curve tool preview stuff 2023-04-21 23:38:11 -04:00
Isaiah Odhner
4d86f783be Implement Curve tool 2023-04-21 23:16:58 -04:00
Isaiah Odhner
18b78cea03 Outside the Ministry of Silly Walks's jurisdiction, it's a squaredance. 2023-04-21 23:16:58 -04:00
Isaiah Odhner
cc0bdf0973 Implement Text tool 2023-04-21 22:12:16 -04:00
Isaiah Odhner
7442480979 Optimize/abbreviate repeated integer division by the magnification level 2023-04-21 20:49:41 -04:00
Isaiah Odhner
d602753117 Refactor get_select_region 2023-04-21 20:18:58 -04:00
Isaiah Odhner
d39f491233 Fix selection while zoomed in 2023-04-21 19:45:01 -04:00
Isaiah Odhner
37cdcdfb13 Implement View > Zoom > Custom Zoom 2023-04-21 19:30:37 -04:00
Isaiah Odhner
cbe40406a6 Fix selection region changing on mouse up
It may be wrong (sometimes), but it shouldn't change (on mouse up)!
That's something (not nothing)!
2023-04-21 19:04:50 -04:00
Isaiah Odhner
5b2e4e0f83 Make warning into an assertion 2023-04-21 18:39:18 -04:00
Isaiah Odhner
612bc3d204 Fix: refresh properly when finishing a selection 2023-04-21 18:35:41 -04:00
Isaiah Odhner
c5c9bd9425 Fix dragging selection a second time: Don't replace image data! 2023-04-21 18:25:45 -04:00
Isaiah Odhner
e98931e8ef Implement Edit > Clear Selection (Delete) 2023-04-21 16:45:20 -04:00
Isaiah Odhner
61d3db4714 Fix undo/redo handling for the Select tool 2023-04-21 16:34:38 -04:00
Isaiah Odhner
1eea87c6c9 Fix error if dragging from off the canvas and releasing mouse over it 2023-04-21 16:07:43 -04:00
Isaiah Odhner
e579b005c0 Note difference between tool.name and tool.get_name() 2023-04-21 16:04:33 -04:00
Isaiah Odhner
9932a84554 And the selection tool is working! 2023-04-21 16:04:33 -04:00
Isaiah Odhner
c6873cdde7 Now it feels like progress... 2023-04-21 15:31:38 -04:00
Isaiah Odhner
bbdfa794fc I feel like I made it worse... 2023-04-21 15:24:45 -04:00
Isaiah Odhner
c3280d20d0 WIP: selection tool 2023-04-21 15:05:41 -04:00
Isaiah Odhner
f5bde1bb1f Accept spelling 2023-04-21 15:05:15 -04:00
Isaiah Odhner
1d8dec4ba4 Implement selection tool preview 2023-04-21 13:11:39 -04:00
Isaiah Odhner
f69f2f0009 Use messages for selecting tools/colors/characters
It's more code, but hopefully separating concerns will be worth it.
2023-04-21 12:26:07 -04:00
Isaiah Odhner
cf9eb652a0 Fix incorrect (irrelevant) docstring
copy/pasted or AI autocompleted
2023-04-21 12:15:11 -04:00
Isaiah Odhner
c076a1b5de Simplify further and fix Toolbox hiding behavior
Yay, this is how simple I originally thought it was going to be.
2023-04-21 11:52:22 -04:00
Isaiah Odhner
8040196f10 WIP: simplify hiding/showing Tools box and Colors box
This works for the ColorsBox, since it's the second element,
but not for the ToolsBox, since it's the first.
2023-04-21 11:45:10 -04:00
Isaiah Odhner
04a99f8a1d Remove type check param from query(); it's only allowed on query_one() 2023-04-21 11:38:20 -04:00
Isaiah Odhner
502a68209d Add type check parameters to DOM queries 2023-04-21 11:35:39 -04:00
Isaiah Odhner
41f192a4d3 Separate foreground/background color selection state
- This works differently to MS Paint. Instead of a color for clearing
  (and for the inside of shapes) and a color for brushing (and the
  outline of shapes), here there's a background and text color for each
  cell, collectively treated like the foreground color in MS Paint.
- There's no way to select a foreground color yet other than opening
  an image and using the color picker.
2023-04-21 11:25:22 -04:00
Isaiah Odhner
43d213fe46 Rename palette selection area elements 2023-04-21 11:04:30 -04:00
Isaiah Odhner
68d069fa8d Implement View > Zoom > Large Size / Normal Size 2023-04-21 01:40:26 -04:00
Isaiah Odhner
da9813ea9b Tweak titlebar close button colors
Don't dim the highlight sides on hover. I feel like that makes it feel
like it's disabled. But don't dim the center as much, so the highlight
doesn't _stand out_ when hovering.
2023-04-21 00:36:08 -04:00
Isaiah Odhner
07757edc24 Make titlebar close button appear smaller 2023-04-21 00:31:04 -04:00
Isaiah Odhner
8e82203bb5 Note another attempt at fixing flickering when using the magnifier tool
I tried `refresh(layout=True, repaint=False)` before `_scroll_to`, but no luck.
2023-04-21 00:05:01 -04:00
Isaiah Odhner
51767d05c8 Use a shared class .filename_input 2023-04-20 23:41:59 -04:00
Isaiah Odhner
0f4a154eda Use straightforward properties instead of storing information in IDs
Sure, I'm tacking on these properties, but it's better to tack onto
objects than to tack onto strings. I'm not using a type checker yet,
but this is a better situation for type checking. (I could extend Button
with mini classes within ToolsBox and ColorsBox, if need be, to give
clear ownership of these properties.)
2023-04-20 23:31:29 -04:00
Isaiah Odhner
24076d9af5 Disable focusing tool and color buttons 2023-04-20 23:05:59 -04:00
Isaiah Odhner
149676f497 Add some todo notes 2023-04-20 22:54:51 -04:00
Isaiah Odhner
e9218e1c75 Rename dir_name -> path_segment since it can refer to a file 2023-04-20 22:54:39 -04:00
Isaiah Odhner
1f260aaeef Refactor empty filename handling in Save As to use a negative condition 2023-04-20 22:41:45 -04:00
Isaiah Odhner
a23eeaf1dd Fix handling empty filename input in Open
I added the filename = os.path.join(...) which invalidated the positive
filename check. I could move the check earlier, but a negative check
should do nicely.

This commit is mostly a dedent, though git may display the diff poorly
due to the shared line window.close()
2023-04-20 22:38:55 -04:00
Isaiah Odhner
2ee021e236 Move expand_directory_tree logic into an EnhancedDirectoryTree class 2023-04-20 22:23:06 -04:00
Isaiah Odhner
9d4cccfe6e Fix type annotation for on_tree_node_highlighted 2023-04-20 22:20:20 -04:00
Isaiah Odhner
5ed2180d7e Fix releasing window drag 2023-04-20 21:39:38 -04:00
Isaiah Odhner
15af8f6403 Fix warning icon visibility after the first display
It gets set to `display = False` when unmounting, I think.
2023-04-20 21:01:33 -04:00