Skip to content

Commit

Permalink
remove gridcontent type parameterization (#30)
Browse files Browse the repository at this point in the history
* remove gridcontent type parameterization

* remove needs_update observable

* remove unnecessary field

* make aligns convert correctly

* simplify setproperty

* change tellheight to Observable{Bool}

* fix width/height types

* make GridDir an enum

* change Side to enum

* simplify precompilation

* snoopcompile precompile script

* use simple precompilation again

* fix a couple of type instabilities

* make size categories closed unions

* schematic of gridlayout updates

* Revert "make GridDir an enum"

This reverts commit 412e16d.

* Revert "change Side to enum"

This reverts commit 8a1393a.

* switch back to old types completely

* simplify filterenum

* fix more type instabilities

* make alignmode closed union
  • Loading branch information
jkrumbiegel authored Feb 4, 2022
1 parent d3700e2 commit cf512cb
Show file tree
Hide file tree
Showing 8 changed files with 292 additions and 200 deletions.
85 changes: 85 additions & 0 deletions gridlayout_updates.drawio
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
<mxfile host="65bd71144e">
<diagram id="nZj995Magr6oX6BYIyyJ" name="Page-1">
<mxGraphModel dx="368" dy="689" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="827" pageHeight="1169" math="0" shadow="0">
<root>
<mxCell id="0"/>
<mxCell id="1" parent="0"/>
<mxCell id="2" value="GridLayout" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxGeometry x="80" y="40" width="400" height="40" as="geometry"/>
</mxCell>
<mxCell id="18" style="edgeStyle=orthogonalEdgeStyle;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" edge="1" parent="1" source="3" target="15">
<mxGeometry relative="1" as="geometry"/>
</mxCell>
<mxCell id="3" value="update!" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxGeometry x="80" y="80" width="110" height="40" as="geometry"/>
</mxCell>
<mxCell id="4" value="LayoutObservables" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxGeometry x="220" y="80" width="120" height="40" as="geometry"/>
</mxCell>
<mxCell id="21" style="edgeStyle=orthogonalEdgeStyle;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" edge="1" parent="1" source="5" target="20">
<mxGeometry relative="1" as="geometry"/>
</mxCell>
<mxCell id="5" value="align_to_bbox!&lt;br&gt;(for c in content)" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxGeometry x="225" y="220" width="110" height="40" as="geometry"/>
</mxCell>
<mxCell id="14" style="edgeStyle=orthogonalEdgeStyle;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;endArrow=none;endFill=0;" edge="1" parent="1" source="6" target="7">
<mxGeometry relative="1" as="geometry"/>
</mxCell>
<mxCell id="23" style="edgeStyle=orthogonalEdgeStyle;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;endArrow=none;endFill=0;fillColor=#f5f5f5;strokeColor=#666666;" edge="1" parent="1" source="6" target="22">
<mxGeometry relative="1" as="geometry"/>
</mxCell>
<mxCell id="25" style="edgeStyle=orthogonalEdgeStyle;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;endArrow=none;endFill=0;fillColor=#f5f5f5;strokeColor=#666666;" edge="1" parent="1" source="6" target="24">
<mxGeometry relative="1" as="geometry"/>
</mxCell>
<mxCell id="6" value="content" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxGeometry x="360" y="80" width="120" height="40" as="geometry"/>
</mxCell>
<mxCell id="10" style="edgeStyle=orthogonalEdgeStyle;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" edge="1" parent="1" source="11" target="3">
<mxGeometry relative="1" as="geometry">
<Array as="points">
<mxPoint x="480" y="380"/>
<mxPoint x="60" y="380"/>
<mxPoint x="60" y="100"/>
</Array>
</mxGeometry>
</mxCell>
<mxCell id="7" value="GridContent" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxGeometry x="360" y="240" width="120" height="40" as="geometry"/>
</mxCell>
<mxCell id="8" value="LayoutObservables" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxGeometry x="360" y="280" width="120" height="40" as="geometry"/>
</mxCell>
<mxCell id="11" value="computedsize" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxGeometry x="420" y="320" width="120" height="40" as="geometry"/>
</mxCell>
<mxCell id="13" style="edgeStyle=orthogonalEdgeStyle;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" edge="1" parent="1" source="12" target="3">
<mxGeometry relative="1" as="geometry">
<Array as="points">
<mxPoint x="600" y="390"/>
<mxPoint x="50" y="390"/>
<mxPoint x="50" y="100"/>
</Array>
</mxGeometry>
</mxCell>
<mxCell id="12" value="protrusions" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxGeometry x="540" y="320" width="120" height="40" as="geometry"/>
</mxCell>
<mxCell id="19" style="edgeStyle=orthogonalEdgeStyle;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" edge="1" parent="1" source="15" target="5">
<mxGeometry relative="1" as="geometry"/>
</mxCell>
<mxCell id="15" value="suggestedbbox" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxGeometry x="220" y="120" width="120" height="40" as="geometry"/>
</mxCell>
<mxCell id="20" value="suggestedbbox" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxGeometry x="300" y="320" width="120" height="40" as="geometry"/>
</mxCell>
<mxCell id="22" value="GridContent" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#f5f5f5;fontColor=#333333;strokeColor=#666666;" vertex="1" parent="1">
<mxGeometry x="490" y="240" width="120" height="40" as="geometry"/>
</mxCell>
<mxCell id="24" value="GridContent" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#f5f5f5;fontColor=#333333;strokeColor=#666666;" vertex="1" parent="1">
<mxGeometry x="620" y="240" width="120" height="40" as="geometry"/>
</mxCell>
</root>
</mxGraphModel>
</diagram>
</mxfile>
5 changes: 2 additions & 3 deletions src/GridLayoutBase.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ module GridLayoutBase
using GeometryBasics
using Observables

const DEFAULT_COLGAP = Ref{Any}(20.0)
const DEFAULT_ROWGAP = Ref{Any}(20.0)
const DEFAULT_COLGAP = Ref{Float64}(20.0)
const DEFAULT_ROWGAP = Ref{Float64}(20.0)
# These function refs can be mutated by other packages to override the default
# way of retrieving default column and row gap sizes
const DEFAULT_ROWGAP_GETTER = Ref{Function}(() -> DEFAULT_ROWGAP[])
Expand Down Expand Up @@ -38,7 +38,6 @@ export tight_bbox

if Base.VERSION >= v"1.4.2"
include("precompile.jl")
_precompile_()
end

end
Loading

0 comments on commit cf512cb

Please sign in to comment.