-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: OverflowBox widget model (#33)
- Loading branch information
Showing
4 changed files
with
34 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package duit_flex | ||
|
||
type OverflowBoxFit string | ||
|
||
const ( | ||
Max OverflowBoxFit = "max" | ||
DeferToChild OverflowBoxFit = "deferToChild" | ||
) |
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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package duit_attributes | ||
|
||
import ( | ||
"github.com/lesleysin/duit_go/pkg/duit_attributes/duit_alignment" | ||
"github.com/lesleysin/duit_go/pkg/duit_attributes/duit_flex" | ||
) | ||
|
||
type OverflowBoxAttributes struct { | ||
MinWidth float32 `json:"minWidth,omitempty"` | ||
MaxWidth float32 `json:"maxWidth,omitempty"` | ||
MinHeight float32 `json:"minHeight,omitempty"` | ||
MaxHeight float32 `json:"maxHeight,omitempty"` | ||
Alignment duit_alignment.Alignment `json:"alignment,omitempty"` | ||
Fit duit_flex.OverflowBoxFit `json:"fit,omitempty"` | ||
} |
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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package duit_widget | ||
|
||
import ( | ||
"github.com/lesleysin/duit_go/pkg/duit_attributes" | ||
"github.com/lesleysin/duit_go/pkg/duit_core" | ||
) | ||
|
||
func OverflowBoxUiElement(attributes *duit_attributes.OverflowBoxAttributes, id string, controlled bool) *duit_core.DuitElementModel { | ||
return new(duit_core.DuitElementModel).CreateElement(duit_core.OverflowBox, id, "", attributes, nil, controlled, 1, nil) | ||
} |