Commit Graph

33 Commits

Author SHA1 Message Date
Isaiah Odhner
bf2b5ec94e Fix dragging windows
This was broken in "Fix a type checker error" e62064a307 
where I just added `and self.offset_at_drag_start`.
The problem is that Offset defines __bool__ and are falsy when (0,0),
and the windows, despite starting out in the center, initially have an
offset of (0,0) FROM this center position.
2023-04-25 14:29:13 -04:00
Isaiah Odhner
e62064a307 Fix a type checker error 2023-04-24 20:52:49 -04:00
Isaiah Odhner
1c7f7015cb Fix unlocalized buttons 2023-04-24 20:28:57 -04:00
Isaiah Odhner
86fe09cc6e Use a DataTable instead of a grid of buttons for Choose Character dialog
Improve performance, compactness, and keyboard navigation
2023-04-24 20:26:47 -04:00
Isaiah Odhner
91883d06cd Tweak warning icon, with a rounder exclamation mark, and smaller overall
I'm not sure I like this better.
2023-04-24 16:31:57 -04:00
Isaiah Odhner
a4f6b0fe35 Improve warning icon 2023-04-24 16:06:16 -04:00
Isaiah Odhner
a07606fc70 Navigate buttons with left/right or up/down in message boxes 2023-04-23 15:43:45 -04:00
Isaiah Odhner
60ff2c27f8 Fix Cancel buttons in Edit Colors and Choose Character dialogs 2023-04-23 14:50:56 -04:00
Isaiah Odhner
9f6a8fd559 Trap focus within window when cycling with Tab / Shift+Tab
Too easy!
2023-04-23 02:09:40 -04:00
Isaiah Odhner
5d778c1879 Annotate **kwargs as Any 2023-04-22 21:44:05 -04:00
Isaiah Odhner
9f06373cb7 Add a bunch more type checking hints/assertions 2023-04-22 20:51:51 -04:00
Isaiah Odhner
2e839b2564 Clean up unused imports 2023-04-22 17:49:15 -04:00
Isaiah Odhner
065c5be2cb Appease the type checker by using maps of buttons 2023-04-22 13:46:02 -04:00
Isaiah Odhner
77295bd622 Int, innit? Init int 2023-04-22 13:11:23 -04:00
Isaiah Odhner
1b56d78f70 Start type checking code 2023-04-22 02:31:58 -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
Isaiah Odhner
48f0303a54 Refactor create_warning_message_box into MessageBox 2023-04-20 21:01:14 -04:00
Isaiah Odhner
093a314d60 Move bits of warning_message_box that need App back into App 2023-04-20 18:09:49 -04:00
Isaiah Odhner
37ff810616 Move warning_message_box implementation to windows.py 2023-04-20 18:02:07 -04:00
Isaiah Odhner
9ab748f255 Use Python class names for window CSS 2023-04-20 17:47:20 -04:00
Isaiah Odhner
5e72708fd8 Rename Python class for character selector dialog for consistency
If I want it to be less verbose, I should rename the super-class
from "DialogWindow" to just "Dialog".
2023-04-20 17:42:17 -04:00
Isaiah Odhner
e39fd52381 Rename CSS class for character selector dialog for consistency 2023-04-20 17:40:15 -04:00
Isaiah Odhner
4bca563358 Remove timer for setting focus
Interestingly, this moves the filename input's cursor to the start,
whereas it was positioned at the end when using the timer.
Unfortunately the Input control doesn't support selection,
which is what I would really want as the behavior.
2023-04-20 12:43:14 -04:00
Isaiah Odhner
8a51bd325c Focus default control within window after opening 2023-04-20 12:31:23 -04:00
Isaiah Odhner
b955aaf361 Input or pick character to draw with 2023-04-20 01:21:06 -04:00
Isaiah Odhner
8ec24a8fdc Prompt to save changes when unloading a document
- Confirm discarding changes for Open, New, or Exit, including for
  exit via Ctrl+C which was previously handled by a built-in binding.
- Await Save As dialog closing, including when Save triggers Save As.
  This is my first time using asynchronous features in Python,
  (as far as I remember,) so it's a bit messy.
- Make DialogWindow callback also for Cancel, which means all
  DialogWindow usage sites care what button is selected.
- Send RequestClose event for Esc key.
2023-04-17 23:09:13 -04:00
Isaiah Odhner
eeaee41747 Submit dialogs with enter, unless a button has focus 2023-04-16 02:03:28 -04:00
Isaiah Odhner
35e93210c8 Close dialogs with Escape key 2023-04-16 00:16:15 -04:00
Isaiah Odhner
d4becd2da0 Refactor dumb button handling using new class DialogWindow 2023-04-16 00:11:59 -04:00
Isaiah Odhner
73d8f04329 Enable dragging windows by their title bars 2023-04-15 22:18:45 -04:00
Isaiah Odhner
e988bf787f Move window layout fix to Window 2023-04-15 22:04:15 -04:00
Isaiah Odhner
c2e86d5eae Implement Save As dialog 2023-04-15 00:57:43 -04:00