Commit graph

582 commits

Author SHA1 Message Date
David Vanderson
872ee60c12 sdl-test animatingWindow: only init the FloatingWindow once 2023-05-26 14:13:05 -04:00
David Vanderson
e9d7c3377a scrollArea: remove setVirtualSize, pass ScrollInfo instead 2023-05-26 13:59:04 -04:00
David Vanderson
359a822db0 scrollContainer: remove unused logic about corner radius 2023-05-26 13:36:29 -04:00
David Vanderson
133d4035e3 scrollArea and textEntry: make scrollbars optional 2023-05-25 22:34:02 -04:00
David Vanderson
82df716d3e scrollBar: option to float over contents 2023-05-23 14:31:31 -04:00
David Vanderson
e93bef449f textEntry: send events to textLayout before bubbling 2023-05-23 13:42:54 -04:00
David Vanderson
8d97ed5d02 scrollArea: don't show scrollbars if scroll is none 2023-05-23 13:42:11 -04:00
David Vanderson
6a4169b4c3 scrollArea: scrollbars have priority when space is limited 2023-05-23 13:21:28 -04:00
David Vanderson
6c59518036 textLayout: always advance by at least 1 codepoint
Otherwise if it doesn't get enough width the height becomes unbounded.
2023-05-23 13:20:09 -04:00
David Vanderson
4723a2d8b6 textEntry: fix crash when typing at the very end of limit 2023-05-23 13:02:19 -04:00
David Vanderson
b3d53b351e textLayout: only set min width if we aren't breaking lines
Fixes the problem where the vertical scrollbar wouldn't get enough width
when the window was being resized to have smaller total width.

TextLayoutWidget doesn't have a normal min width or height (when
breaking lines).  Given a width it will calculate it's min height.  This
change makes it not set it's min width (when breaking lines).
2023-05-23 11:25:32 -04:00
David Vanderson
8a4466d751 make horizontal scrolling work with ScrollDrag 2023-05-22 20:50:28 -04:00
David Vanderson
c36324433e textEntry: show cursor at end of line with newline 2023-05-22 16:30:00 -04:00
David Vanderson
0274be1ded horizontal scrolling: first parts 2023-05-22 09:45:51 -04:00
David Vanderson
f9436d475d remove workaround for sdl bug 2023-05-22 09:45:28 -04:00
David Vanderson
f5ef8f43ab cueFrame() -> refresh() 2023-05-16 16:39:19 -04:00
David Vanderson
4e9739a1b1 cleanup 2023-05-16 16:33:50 -04:00
David Vanderson
36eaf9e8b3 slider: don't use ButtonWidget 2023-05-16 15:55:16 -04:00
David Vanderson
1b6208e062 vertical sliders 2023-05-16 11:54:06 -04:00
David Vanderson
5f7fde489c TextEntry: move cursor with arrow keys 2023-05-15 22:00:42 -04:00
David Vanderson
aad4190019 demo: add TextEntry example and fix scroll to cursor 2023-05-14 22:01:09 -04:00
David Vanderson
a5952d9c67 toastInfo() -> toast() and use options struct for args 2023-05-10 16:24:37 -04:00
David Vanderson
6e04eb4f48 fix bug where toasts were not sticking above their parent window 2023-05-10 14:16:40 -04:00
David Vanderson
cfb1eb29cf move id_extra inside Options 2023-05-10 13:51:54 -04:00
David Vanderson
a8aad2a2cb exempt mouse wheel events from mouse capture
This allows scrolling with the wheel while dragging to select text in a
TextLayoutWidget.
2023-05-10 08:44:30 -04:00
David Vanderson
9405912ccc add bubbling arg to processEvents()
ScrollContainerWidget needs this so it can handle up/down key press
either when being bubbled from a child widget or if it has keyboard
focus.
2023-05-09 23:32:27 -04:00
David Vanderson
70f449016e scrollBar: add focus target
When you click on a scrollbar, you want to focus a different widget,
usually the scrollContainer but sometimes a parent (like
TextEntryWidget).
2023-05-09 17:13:27 -04:00
David Vanderson
1211475cdc textEntry: draw the cursor ourselves instead of in TextLayout 2023-05-09 15:37:32 -04:00
David Vanderson
5107b1616b textLayout: show in demo how to be able to click on corner widgets 2023-05-09 14:36:21 -04:00
David Vanderson
d66e6cc381 textEntry: text insertion and backspace working 2023-05-09 11:09:23 -04:00
David Vanderson
229f37974f strip(): expand and gravity should be reset 2023-05-06 22:49:57 -04:00
David Vanderson
95a240ef8e textEntry: working on using textLayout under the hood 2023-05-06 22:49:36 -04:00
David Vanderson
ddd0e09148 EventIterator: add separate capture_id parameter
This lets a compound widget's top-most widget get all events and forward
them to an internal widget even when the internal widget captures the
mouse.
2023-05-06 22:46:56 -04:00
David Vanderson
4fbd5cb7d8 use event_num instead of EventIterator to focus remaining events
This way we don't have to pass the EventIterator all over the place.
Instead each normal Event gets an incrementing num value.  Then to focus
remaining events we focus any events that have a larger num than the
event that caused the focus.
2023-05-05 11:07:51 -04:00
David Vanderson
9caedc4d0f fold bubbleEvent into processEvent 2023-05-04 23:21:32 -04:00
David Vanderson
0a4c738435 move event types inside Event 2023-05-04 21:34:34 -04:00
David Vanderson
3d48a4b43a textLayout: fix scrolling by using local coords
Storing screen coords for local stuff is wrong, because when a scroll happens
they are no longer correct.
2023-05-04 11:52:05 -04:00
David Vanderson
f6012cd31a textLayout: shift-up/down use new ScrollTo bubble event to scroll 2023-05-04 08:39:27 -04:00
David Vanderson
5ba3150af9 textLayout: fix shift-up/down when text is zoomed 2023-05-04 08:17:27 -04:00
David Vanderson
597790ab2d textSizeEx: add option to stop at nearest glyph 2023-05-03 20:44:17 -04:00
David Vanderson
01e7dba38b textLayout: shift-up/down search in middle of line, auto addTextDone 2023-05-03 20:16:49 -04:00
David Vanderson
f2cc1cbbb4 textLayout: shift-up/down moves selection up and down lines 2023-05-03 20:07:30 -04:00
David Vanderson
53fc67ea7c rework KeyEvent so you can switch on code or action 2023-05-02 22:18:53 -04:00
David Vanderson
9b0ccad8fb textLayout: changing selection moves cursor 2023-05-02 21:15:14 -04:00
David Vanderson
2916223023 textLayout: render cursor 2023-05-01 22:19:29 -04:00
David Vanderson
036f31da2e floatingWindow - change to use options struct 2023-05-01 13:39:21 -04:00
David Vanderson
dd68303d8c rename CursorKind to Cursor 2023-04-28 12:38:29 -04:00
David Vanderson
deda7a3390 switch text instead of multiple buttons (prevents flashing) 2023-04-28 12:37:00 -04:00
David Vanderson
d472f7c048 rename some dialog stuff, make built-in dialog more useful 2023-04-28 12:19:36 -04:00
David Vanderson
dad5120ea9 detect when a widget id is reused - debug message and highlight 2023-04-28 12:17:58 -04:00