-
Notifications
You must be signed in to change notification settings - Fork 59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve extensibility of the DiagramWidget #83
base: master
Are you sure you want to change the base?
Conversation
Added background graphic capability and an example of extending a DiagramNode so that vertical movement and resizing are disallowed.
Added DiagramWidget override callbacks for the drawing area Dragged() and DragEnd() functions. Added DiagramElement.SetConnectionPad() function so that custom pads can be added to a DiagramElement. Added example custom pads to the demo.
Pull Request Test Coverage Report for Build 7492839566
💛 - Coveralls |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My apologies this has sat so long. I like the overall improvements but I think some of the API / docs could be improved as noted inline
@@ -105,12 +116,12 @@ type PointPad struct { | |||
|
|||
// NewPointPad creates a PointPad and associates it with the DiagramElement. Note that, by default, | |||
// the position of the PointPad will be (0,0), i.e. the origin of the DiagramElement. | |||
func NewPointPad(padOwner DiagramElement) *PointPad { | |||
func NewPointPad(lineWidth float32) *PointPad { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The documentation here is now out of date.
@@ -223,11 +234,9 @@ type RectanglePad struct { | |||
|
|||
// NewRectanglePad creates a RectanglePad and associates it with the DiagramElement. The size of the | |||
// pad becomes the size of the padOwner. | |||
func NewRectanglePad(padOwner DiagramElement) *RectanglePad { | |||
func NewRectanglePad() *RectanglePad { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With this change of signature the documents no longer correctly describe what it does.
What this API break intentional?
@@ -38,6 +37,9 @@ type DiagramWidget struct { | |||
// DesiredSize specifies the size of the displayed diagram. Defaults to 800 x 600 | |||
DesiredSize fyne.Size | |||
|
|||
// MinimumSize is the minimum size for the diagram widget | |||
MinimumSize fyne.Size |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this should be exposed as a field - the function MinSize()
already returns that information.
// AnchoredTextChangedCallback is called when the position, offset, or text of the anchored text has changed | ||
AnchoredTextChangedCallback func(*AnchoredText) | ||
// DragEndCallback is called when a dragEnd event occurs in the drawing area | ||
DragEndCallback func() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are pretty much duplicating the existing Fyne events for DragEnd
etc - can they be exposed in the way of other widgets such that someone extending the widget can do that and replace the method, delegating back upward to the embedded widget?
These changes improve the extensibility of the DiagramWidget. Changes include: