Commit Graph
30 Commits
Author SHA1 Message Date
eoineoineoinandGitHub 5b06066fcb Make some Control properties animatable (#6376) 2026-01-10 23:35:08 +01:00
ShadowCommanderandGitHub 40a9048704 Add margin input value order as a comment (#5067)
* Add margin input value order as a comment

* Make a better comment and move value to remark
2024-04-27 20:17:11 +02:00
Pieter-Jan BriersandGitHub 0fadfc2d9b Allow control layout properties to be set via style sheet. (take 2) (#5037)
* Reapply "Allow control layout properties to be set via style sheet." (#5035)

This reverts commit af36d24892.

* Fix tests

MaxSize properties had wrong default. Oops.
2024-04-17 00:42:12 +02:00
metalgearslothandGitHub af36d24892 Revert "Allow control layout properties to be set via style sheet." (#5035)
This reverts commit 8c4deb2067.

# Conflicts:
#	RELEASE-NOTES.md
2024-04-14 14:14:44 +10:00
Pieter-Jan Briers 8c4deb2067 Allow control layout properties to be set via style sheet.
This works by setting the stylesheet values into the regular control property fields when updated. This means 0 performance overhead except when updating styles, and even then it's probably negligible. A bitfield is used to track which properties are set and how.

This code is all done manual for now. I wanted to make a source gen for this but couldn't be arsed at the moment. The code manually written here is basically what a future source gen would generate optimally.
2024-04-14 02:09:00 +02:00
754d5a1fbb Add GetLocalPosition to controls (#4872)
* Add GetLocalPosition to controls

In my case I want the mouse's position inside of the control to show something under it unless there's a better way.

* weh

---------

Co-authored-by: Pieter-Jan Briers <pieterjan.briers+git@gmail.com>
2024-01-30 13:27:28 +01:00
394d1e6cc2 Add global rectangles for controls (#4873)
* Add global rectangles for controls

Like my other PR used to check if mouse is inbounds on the control without doing some skrunkly caching with mousemove.

* weh

---------

Co-authored-by: Pieter-Jan Briers <pieterjan.briers+git@gmail.com>
2024-01-29 11:08:02 +01:00
DmitriyMXandGitHub 62315f7c2e fix: crash client when window set maxsize (#4291) 2023-08-23 16:59:57 +10:00
Leon FriedrichandGitHub ce3b92aea2 Try prevent infinite measure/arrange loops (#4176) 2023-07-10 17:36:22 +10:00
metalgearslothandGitHub 7d1ad527d9 Replace Robust Vector2 with System.Numerics (#4092) 2023-07-08 14:08:26 +10:00
0eba350eb1 Fix bug where ScrollContainer could cause layout engine to loop forever. (#3723)
Co-authored-by: Eoin Mcloughlin <helloworld@eoinrul.es>
2023-02-06 23:37:26 +01:00
mirrorcultandGitHub f5a1e06f21 Merge pull request #2051 from Visne/sizeflags
Remove SizeFlags
2021-10-23 15:00:49 -07:00
Visne 58ea614c1f Specify defaults for alignment explicitly 2021-09-29 19:12:17 +02:00
VisneandGitHub a5be8e723e Remove some unused obsolete stuff (#2049) 2021-09-20 10:59:50 +02:00
Visne 5cbad8b3d9 Remove SizeFlags 2021-09-20 02:15:14 +02:00
Pieter-Jan Briers 2f6fb22473 Remove obsolete layout APIs. 2021-09-07 01:38:13 +02:00
Pieter-Jan Briers 96d66c57c1 Comments for Control.Layout.cs. 2021-09-07 01:24:10 +02:00
Pieter-Jan Briers b523cfddb7 Fix some layout calculation bugs.
1. Fix a copy paste typo in ApplySizeConstraints().
2. Fix negative sizes passed to MeasureCore() causing exceptions.
2021-08-22 02:07:42 +02:00
Pieter-Jan BriersandGitHub 8efffc471d Multi-window support (#1713) 2021-05-02 14:05:50 +02:00
c4946b8466 Viewport Improvements (#1528)
Co-authored-by: 20kdc <asdd2808@gmail.com>
Co-authored-by: Pieter-Jan Briers <pieterjan.briers+git@gmail.com>
2021-04-19 09:47:20 +02:00
Pieter-Jan BriersandGitHub 583b7ebf38 WPF layout (#1581) 2021-02-21 12:28:13 +01:00
b8e5b47e7a Use 'new' expression in places where the type is evident for the engine (#1415)
Co-authored-by: Pieter-Jan Briers <pieterjan.briers+git@gmail.com>
2020-11-26 00:16:55 +01:00
chairbenderandGitHub ee381804ec New GridContainer capabilities and customizable tooltips (#1395)
* #272 avoid mouse overlapping tooltip when near edges,
change tooltip colors to match mockups

* #272 WIP customizable tooltips, old approach currently working still

* #272 WIP customizable tooltips, old approach currently working still

* #272 ensure tooltips go away when disposing control

* #272 implement row-oriented GridContainer

* #272 generalize GridContainer to support
rows or cols

* #272 improve readability in new GridContainer
logic

* #272 GridContainer can expand in opposite
direction

* #272 GridContainer can expand in opposite
direction

* #272 GridContainer can expand in opposite
direction, fix test

* #272 add GridContainer capability to
limit by size rather than count

* #272 add some clarifications about ui scale and vp / rp

* #272 don't spam showtooltip
event, calculate tooltip
positioning using combined
minimum size
2020-11-10 15:21:32 +11:00
Pieter-Jan BriersandGitHub 6674be3adc Client NRTs (#1121) 2020-06-12 12:57:39 +02:00
ShadowCommanderandGitHub 726341981e Fix StyleBox (#1009) 2020-02-28 06:34:26 +01:00
Pieter-Jan BriersandGitHub ab1f4fb0e7 UI layout v2. (#908)
* UI layout v2.

All controls now act like containers.
Moved anchor/margin layout model to LayoutContainer

Implement basic WPF-like attached properties for the above LayoutContainer.

* Fix VV.
2019-12-05 13:37:58 +01:00
Pieter-Jan Briers 13ef4e8423 Various optimizations focused on the entity spawn panel:
Give BoxContainer a preset capacity to reduce allocations in layout.

Removed Control.GetChild(string) and similar. This was no longer used (and was a pretty bad idea in general), and the implementation had a lot of wasted book keeping to do.

Use UpdateLayout() instead of DoUpdateLayout() in Control minsize changed to avoid doing redundant layout, and by extension style & minsize, updates.

Used RemoveAllChildren instead of DisposeAllChildren in EntitySpawnWindow because it's faster (way less stuff to clear, just let the GC handle it).

Optimized ResourcePath with a better GetHashCode(), better Equals, replacement for List<T>.ToArray()

Fixed enumerator allocations in stylesheet SelectorElement matching to speed up style updates.

ResourceCache now caches fallbacks to avoid constructing Resource instance when fetching fallback explicitly.

ResourceCache now has nested dictionaries for Type -> ResourcePath -> BaseResource storage of resources.

Use calculated property instead of auto property for TextureResource.Fallback
2019-11-28 14:19:02 +01:00
Pieter-Jan Briers e2fcf919c5 Fix changing minsize not updating controls outside containers. 2019-10-20 01:16:56 +02:00
Pieter-Jan Briers 081ced42df Make fetching minimum size force style update if necessary. 2019-08-25 12:55:16 +02:00
Pieter-Jan BriersandGitHub cb5f2ffae1 Refactor UI system. (#843)
* Refactor UI system.

Deferred updating is used for styling & layout. This fixes the awful time complexity of containers.
Removed SetDefaults and Initialize. They were a bad idea alright.

* Fix build on .NET Framework.
2019-08-14 22:03:51 +02:00