-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow other libs/apps to interact with the container-ish items Split …
…and Scroll Simplify for now by adding Stack container as a child in every drop spot.
- Loading branch information
1 parent
375d63b
commit ed66dd1
Showing
2 changed files
with
19 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,25 @@ | ||
package gui | ||
|
||
import "github.com/fyne-io/defyne/internal/guidefs" | ||
import ( | ||
"reflect" | ||
|
||
"fyne.io/fyne/v2" | ||
"github.com/fyne-io/defyne/internal/guidefs" | ||
) | ||
|
||
// WidgetClassList returns the list of supported widget & container classes. | ||
// These can be used for passing to `CreateNew` or `EditorFor`. | ||
func WidgetClassList() []string { | ||
return guidefs.WidgetNames | ||
} | ||
|
||
func DropZonesForObject(o fyne.CanvasObject) []fyne.CanvasObject { | ||
class := reflect.TypeOf(o).String() | ||
info := guidefs.Widgets[class] | ||
|
||
if !info.IsContainer() { | ||
return nil | ||
} | ||
|
||
return info.Children(o) | ||
} |