Commit Graph

1163 Commits

Author SHA1 Message Date
Emil Segerås
71eda21aca Fix for TBSkinListener. 2014-07-15 07:49:49 +02:00
Emil Segerås
4b6d28d64f Added TBSkinListener that let users read custom properties into skin elements. 2014-07-14 17:08:20 +02:00
Emil Segerås
5ae7178fe8 Added TBTempBuffer::AppendSpace and tuned reserve size. 2014-07-04 14:51:00 +02:00
Emil Segerås
6690a486ee Compilefix for some debug code. 2014-06-28 21:46:10 +02:00
Emil Segerås
e1c4979e18 Removed qsort dependency since platform support is a mess.
Added insert sort implementation.
Also use TBTempBuffer for temp array to anchor its destruction.
2014-06-28 21:44:49 +02:00
Emil Segerås
6b32a96bb2 Added two internal parser methods to the API. 2014-06-16 14:40:19 +02:00
Emil Segerås
f2d1f93b1a Upgraded stb_image.h
This adds jpg, bmp, gif, psd, pic, tga support since there's
no longer any way of disabling those.

Changelog:
      1.38 (2014-06-06) suppress MSVC run-time warnings, fix accidental rename of 'skip'
      1.37 (2014-06-04) remove duplicate typedef
      1.36 (2014-06-03) converted to header file, allow reading incorrect iphoned-images without iphone flag
      1.35 (2014-05-27) warnings, bugfixes, TGA optimization, etc
      1.34 (unknown   ) warning fix
2014-06-15 14:24:46 +02:00
Emil Segerås
d88dfdcc6a Upgraded stb_truetype.h.
Changelog:
  0.8  (2014-05-25) fix a few more warnings
2014-06-15 14:16:18 +02:00
Emil Segerås
8a8e94043a Fix for unit test that may fail when using super high dpi.
The scrollbars could interfere with the expected outcome of
some tests so just make the text field a lot larger.
2014-06-10 22:01:36 +02:00
Emil Segerås
9f342ca88e Fix for undo event merge on insert of single multi byte characters. 2014-06-10 21:58:18 +02:00
Emil Segerås
7594322448 Added generic widget attribute "rect" for absolute positioning. 2014-06-09 18:46:21 +02:00
Emil Segerås
d84ce96bd1 Fix for incorrect size after inflate of widgets with custom fonts.
The widget has to be in the hierarchy with the font set *before*
OnInflateChild is called so the preferred size calculation use the
right font.

tc: Change font in textview and observe size of the embedded TBButton.
2014-06-09 08:38:59 +02:00
Emil Segerås
944fb88bf5 Improved window positioning in some more cases. 2014-05-29 13:41:39 +02:00
Emil Segerås
09d5196243 Fix for applying updates of strong-override skin elements.
- Always InvalidateLayout when a strong-override change. Having different layout properties is what they are for.

- Fixed regression caused by 07d5889f53. I had completely forgot the need
  to update skin states after any change that may resolve conditions differently, and also that updating skin states
  are different from updating widget states.
2014-05-29 13:39:47 +02:00
Emil Segerås
7394f38c72 Handle more escape codes when parsing strings.
Most importantly, support \xXX and \uXXXX.
2014-05-29 13:33:23 +02:00
Emil Segerås
55ad6d1343 Fixed incorrectly encoded source file.
Visual studio scrambled the utf-8 at some point.
Also reduced the number of default rendered glyphs.
2014-05-29 13:33:20 +02:00
Emil Segerås
f25fee7176 Plugged minor memory leak (text fields context menu items). 2014-05-22 20:35:12 +02:00
Emil Segerås
45de1c3be0 Fix for broken rendering after minimizing window in Demo on windows. 2014-05-20 21:56:28 +02:00
Emil Segerås
4f879d0c0c Removed auto-collapsing and added widget visibility modes.
Layout does no longer auto-collapse widgets when they prefer 0x0 size. Instead
there is visibility "gone".

There is also "invisible" that behaves like opacity 0, and "visible".

This makes the layout cleaner, and makes it easier to change visibility.
2014-05-20 21:56:28 +02:00
Emil Segerås
16e13dc622 Changed listener API for OnWidgetAdded/OnWidgetRemoved.
NOTE: Local listeners are now called on the parent widget instead of the child!
It makes more sense to use a listener to listen for additions/removes in a certain
widget, than listening to when a specific widget is added/removed anywhere.
2014-05-20 21:56:27 +02:00
Emil Segerås
90c9766166 Added "toggle-mode" attribute for TBButton. 2014-05-20 21:56:26 +02:00
Emil Segerås
fbc5a8139c ResourceEditWindow should open files on drop. 2014-05-20 21:56:26 +02:00
Emil Segerås
55cf1ca9bc Minor optimization in fragment allocator.
Reuse Space object.
Make sure available space is updated so early bail in HasSpace happens more often.
2014-05-20 21:56:25 +02:00
Emil Segerås
29f0f68b45 Workaround for glfw keyboard issue on linux.
Fixed issue #10
2014-05-18 21:46:55 +02:00
Emil Segerås
ebf485e7b8 Introduced font glyph cache, shared between faces & sizes. 2014-05-03 14:00:57 +02:00
Emil Segerås
09f2529122 Optimized reuse of fragment space.
-Sort rows.
-Merge empty rows so larger fragments have a chance of allocating the space.
2014-05-03 12:49:43 +02:00
Emil Segerås
52049fbaa0 Debugging improvement of TBBitmapFragment
-Clear in different shades
-Worked around bug with visual studio variable watcher
2014-05-03 12:49:42 +02:00
Emil Segerås
776dc5bba6 Added TBBitmapFragment GetAllocatedHeight. 2014-05-03 12:49:42 +02:00
Emil Segerås
d7f56ab800 Minor optimization in TBSpaceAllocator 2014-05-03 12:49:41 +02:00
Emil Segerås
a0a41e2959 Default map size should be customizable. 2014-05-03 12:49:40 +02:00
Emil Segerås
9ddd2526e5 .gitignore Demo.exe 2014-05-01 13:36:05 +02:00
Emil Segerås
b5fab7570e Fixed so Demo windows adapt better to high DPI skin.
-Position and sizes should of course be read as dimensions (dp by default).
-MoveIn and clip windows after getting preferred size.
2014-05-01 13:35:01 +02:00
Emil Segerås
80a88ee62c Extracted TBWindow::ResizeToFitContent logic into new method. 2014-05-01 13:23:24 +02:00
Emil Segerås
cbbaa15678 Added TBRect methods MoveIn and CenterIn. 2014-05-01 13:19:35 +02:00
Emil Segerås
6da81244c9 Added ClampClipMax 2014-05-01 13:14:07 +02:00
Emil Segerås
3d8843acd7 Fixed shortcut keys on osx. 2014-04-26 20:18:45 +02:00
Emil Segerås
7a2467a0d9 Fixed linking on osx with glfw 3.0.4. 2014-04-26 20:15:51 +02:00
Emil Segerås
66e2c349bf Switched to glfw version 3.0.4 for demo. 2014-04-21 14:51:53 +02:00
Emil Segerås
d6c9c0b720 Moved GLFW defines to makefile (linux/mac). 2014-04-21 14:45:34 +02:00
Emil Segerås
e690e301c4 Moved GLFW defines to project (windows). 2014-04-21 14:34:44 +02:00
Emil Segerås
b51fb79bac Added flag to read-append node trees. 2014-04-21 14:05:38 +02:00
Emil Segerås
ebd3d111f0 Added EVENT_TYPE_FILE_DROP, and CUSTOM.
Extend TBWidgetEvent by making it a TBTypedObject instead of adding even
more to it. Should perhaps refactorize it, but that will require lots of changes.

Implemented EVENT_TYPE_FILE_DROP for upcoming version of glfw (not used yet).
2014-04-21 13:48:08 +02:00
Emil Segerås
3b4b737822 Added const version of TBSafeCast. 2014-04-21 13:48:06 +02:00
Emil Segerås
1524019a4b Always Invalidate automatically from InvalidateLayout.
InvalidateLayout actually depend on Invalidate since the relayout
is driven by paint.

Fixes bug that nothing happened if a widget called InvalidateLayout
but not Invalidate.
2014-04-21 13:48:04 +02:00
Emil Segerås
5ccd321369 Optimization: removed pointless clearing of unused fragment map data.
CopyData will set used parts of the map.
2014-04-21 13:47:59 +02:00
Emil Segerås
c5614f091f Fix issue with TBID debug code and build order.
The static hash table used for debuggung should only be accessed
if turbo badger is initialized, to guarantee that the hashtable itself
has been initialized properly.
2014-04-14 20:23:07 +02:00
Emil Segerås
7cf3178398 Only scroll on wheel events without modifier key. Fixes #11.
It's common to use wheel and modifier combos for other things.
2014-04-13 20:45:02 +02:00
Emil Segerås
bdbfeec4f6 Removed unintentional allocation in android demo onDrawFrame. 2014-04-05 19:34:05 +02:00
Emil Segerås
c2cfa0b5a5 Clarified skin unit comment 2014-03-29 21:50:00 +01:00
Emil Segerås
3c770dc840 Replaced unnecessary dimmer image with background-color. 2014-03-29 21:50:00 +01:00