Compare commits

...

5 Commits

Author SHA1 Message Date
Alexei Anoshenko d3b07f35ca Bug fixing 2025-03-13 11:50:57 +03:00
Alexei Anoshenko 31489dbc03 Bug fixing 2025-02-07 22:14:21 +03:00
Alexei Anoshenko f49b73e979 Bug fixing 2025-02-07 21:45:02 +03:00
Alexei Anoshenko b6832dac40 updated go.mod 2025-01-21 10:47:03 -05:00
Alexei Anoshenko 5d50d5b772 Bug fining 2024-12-18 19:11:51 +03:00
17 changed files with 46 additions and 47 deletions

View File

@ -1,3 +1,7 @@
# v0.18.2
* fixed typo: GetShadowPropertys -> GetShadowProperty
# v0.18.0
* Property name type changed from string to PropertyName.

View File

@ -201,7 +201,7 @@ func (view *viewData) handleTransitionEvents(tag PropertyName, data DataObject)
if tag == TransitionEndEvent || tag == TransitionCancelEvent {
if animation, ok := view.singleTransition[property]; ok {
delete(view.singleTransition, property)
setTransition(view, tag, animation)
setTransition(view, property, animation)
session := view.session
session.updateCSSProperty(view.htmlID(), "transition", transitionCSS(view, session))
}

View File

@ -147,6 +147,11 @@ ul:focus {
.ruiListLayout {
display: flex;
overflow: auto;
}
.ruiColumnLayout {
overflow: auto;
}
.ruiStackLayout {

View File

@ -197,7 +197,7 @@ func (button *checkboxData) cssStyle(self View, builder cssBuilder) {
builder.add("align-items", "stretch")
builder.add("justify-items", "stretch")
button.viewsContainerData.cssStyle(self, builder)
button.viewData.cssStyle(self, builder)
}
func checkboxHtml(button View, buffer *strings.Builder, checked bool) (int, int) {

View File

@ -140,9 +140,9 @@ func newColumnLayout(session Session) View {
func (columnLayout *columnLayoutData) init(session Session) {
columnLayout.viewsContainerData.init(session)
columnLayout.tag = "ColumnLayout"
columnLayout.systemClass = "ruiColumnLayout"
columnLayout.normalize = normalizeColumnLayoutTag
columnLayout.changed = columnLayout.propertyChanged
//columnLayout.systemClass = "ruiColumnLayout"
}
func normalizeColumnLayoutTag(tag PropertyName) PropertyName {

10
go.mod
View File

@ -2,6 +2,12 @@ module github.com/anoshenko/rui
go 1.18
require github.com/gorilla/websocket v1.5.1
require (
github.com/gorilla/websocket v1.5.1
golang.org/x/crypto v0.14.0
)
require golang.org/x/net v0.17.0 // indirect
require (
golang.org/x/net v0.17.0 // indirect
golang.org/x/text v0.13.0 // indirect
)

4
go.sum
View File

@ -1,4 +1,8 @@
github.com/gorilla/websocket v1.5.1 h1:gmztn0JnHVt9JZquRuzLw3g4wouNVzKL15iLr/zn/QY=
github.com/gorilla/websocket v1.5.1/go.mod h1:x3kM2JMyaluk02fnUJpQuwD2dCS5NDG2ZHL0uE0tcaY=
golang.org/x/crypto v0.14.0 h1:wBqGXzWJW6m1XrIKlAH0Hs1JJ7+9KBwnIO8v66Q9cHc=
golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4=
golang.org/x/net v0.17.0 h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM=
golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE=
golang.org/x/text v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k=
golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=

View File

@ -505,12 +505,6 @@ func gridCellSizes(properties Properties, tag PropertyName, session Session) []S
return []SizeUnit{}
}
/*
func (gridLayout *gridLayoutData) cssStyle(self View, builder cssBuilder) {
gridLayout.viewsContainerData.cssStyle(self, builder)
}
*/
// GetCellVerticalAlign returns the vertical align of a GridLayout cell content: TopAlign (0), BottomAlign (1), CenterAlign (2), StretchAlign (3)
// If the second argument (subviewID) is not specified or it is "" then a value from the first argument (view) is returned.
func GetCellVerticalAlign(view View, subviewID ...string) int {

View File

@ -20,7 +20,7 @@ const (
// Set the title of the tab. The property is set for the child view of TabsLayout.
//
// Supported types: string.
Title = "title"
Title PropertyName = "title"
// TitleStyle is the constant for "title-style" property tag.
//
@ -161,7 +161,7 @@ const (
// - string - string representation of Transform interface. Example:
//
// "_{ translate-x = 10px, scale-y = 1.1}"
ShowTransform = "show-transform"
ShowTransform PropertyName = "show-transform"
// ShowDuration is the constant for "show-duration" property tag.
//
@ -171,7 +171,7 @@ const (
// Supported types: float, int, string.
//
// Internal type is float, other types converted to it during assignment.
ShowDuration = "show-duration"
ShowDuration PropertyName = "show-duration"
// ShowTiming is the constant for "show-timing" property tag.
//
@ -188,7 +188,7 @@ const (
// - "linear" (LinearTiming) - Constant speed.
// - "step(n)" (StepTiming(n int) function) - Timing function along stepCount stops along the transition, displaying each stop for equal lengths of time.
// - "cubic-bezier(x1, y1, x2, y2)" (CubicBezierTiming(x1, y1, x2, y2 float64) function) - Cubic-Bezier curve timing function. x1 and x2 must be in the range [0, 1].
ShowTiming = "show-timing"
ShowTiming PropertyName = "show-timing"
// ShowOpacity is the constant for "show-opacity" property tag.
//
@ -199,7 +199,7 @@ const (
// Supported types: float, int, string.
//
// Internal type is float, other types converted to it during assignment.
ShowOpacity = "show-opacity"
ShowOpacity PropertyName = "show-opacity"
// ArrowOffset is the constant for "arrow-offset" property tag.
//
@ -369,7 +369,7 @@ func (arrow *popupArrow) createView(popupView View) View {
params := Params{BackgroundColor: GetBackgroundColor(popupView)}
if shadow := GetShadowPropertys(popupView); shadow != nil {
if shadow := GetShadowProperty(popupView); shadow != nil {
params[Shadow] = shadow
}

View File

@ -22,7 +22,7 @@ const (
// - 4 (BottomSide) or "bottom" - Bottom frame side.
// - 8 (LeftSide) or "left" - Left frame side.
// - 15 (AllSides) or "all" - All frame sides.
Side = "side"
Side PropertyName = "side"
// ResizeBorderWidth is the constant for "resize-border-width" property tag.
//
@ -33,7 +33,7 @@ const (
//
// Internal type is SizeUnit, other types converted to it during assignment.
// See SizeUnit description for more details.
ResizeBorderWidth = "resize-border-width"
ResizeBorderWidth PropertyName = "resize-border-width"
)
// Constants for values of [Resizable] "side" property. These constants can be ORed if needed.

View File

@ -20,7 +20,7 @@ const (
// Conversion rules:
// - TransformProperty - stored as is, no conversion performed.
// - string - string representation of Transform interface. Example: "_{translate-x = 10px, scale-y = 1.1}".
PushTransform = "push-transform"
PushTransform PropertyName = "push-transform"
// PushDuration is the constant for "push-duration" property tag.
//
@ -30,7 +30,7 @@ const (
// Supported types: float, int, string.
//
// Internal type is float, other types converted to it during assignment.
PushDuration = "push-duration"
PushDuration PropertyName = "push-duration"
// PushTiming is the constant for "push-timing" property tag.
//
@ -47,7 +47,7 @@ const (
// - "linear" (LinearTiming) - Constant speed.
// - "step(n)" (StepTiming(n int) function) - Timing function along stepCount stops along the transition, displaying each stop for equal lengths of time.
// - "cubic-bezier(x1, y1, x2, y2)" (CubicBezierTiming(x1, y1, x2, y2 float64) function) - Cubic-Bezier curve timing function. x1 and x2 must be in the range [0, 1].
PushTiming = "push-timing"
PushTiming PropertyName = "push-timing"
// MoveToFrontAnimation is the constant for "move-to-front-animation" property tag.
//
@ -59,7 +59,7 @@ const (
// Values:
// - true, 1, "true", "yes", "on", "1" - animation is used (default value).
// - false, 0, "false", "no", "off", "0" - animation is not used.
MoveToFrontAnimation = "move-to-front-animation"
MoveToFrontAnimation PropertyName = "move-to-front-animation"
// PushPerspective is the constant for "push-perspective" property tag.
//

View File

@ -35,7 +35,7 @@ const (
// Defines the icon name that is displayed in the tab. The property is set for the child view of TabsLayout.
//
// Supported types: string.
Icon = "icon"
Icon PropertyName = "icon"
// TabCloseButton is the constant for "tab-close-button" property tag.
//
@ -666,7 +666,7 @@ func (tabsLayout *tabsLayoutData) htmlProperties(self View, buffer *strings.Buil
}
func (tabsLayout *tabsLayoutData) cssStyle(self View, builder cssBuilder) {
tabsLayout.viewsContainerData.cssStyle(self, builder)
tabsLayout.viewData.cssStyle(self, builder)
switch tabsLayout.tabsLocation() {
case TopTabs:
builder.add(`grid-template-rows`, `auto 1fr`)

View File

@ -499,19 +499,19 @@ func (transform *transformPropertyData) transformCSS(session Session) string {
if z.Type != Auto && z.Value != 0 {
buffer.WriteString(`translate3d(`)
buffer.WriteString(x.cssString("0", session))
buffer.WriteString(x.cssString("0px", session))
buffer.WriteRune(',')
buffer.WriteString(y.cssString("0", session))
buffer.WriteString(y.cssString("0px", session))
buffer.WriteRune(',')
buffer.WriteString(z.cssString("0", session))
buffer.WriteString(z.cssString("0px", session))
buffer.WriteString(") ")
} else if (x.Type != Auto && x.Value != 0) || (y.Type != Auto && y.Value != 0) {
buffer.WriteString(`translate(`)
buffer.WriteString(x.cssString("0", session))
buffer.WriteString(x.cssString("0px", session))
buffer.WriteRune(',')
buffer.WriteString(y.cssString("0", session))
buffer.WriteString(y.cssString("0px", session))
buffer.WriteString(") ")
}

View File

@ -805,15 +805,6 @@ func (view *viewData) addToCSSStyle(addCSS map[string]string) {
func (view *viewData) cssStyle(self View, builder cssBuilder) {
view.viewStyle.cssViewStyle(builder, view.session)
/*
switch GetVisibility(view) {
case Invisible:
builder.add(`visibility`, `hidden`)
case Gone:
builder.add(`display`, `none`)
}
*/
if view.addCSS != nil {
for tag, value := range view.addCSS {
builder.add(tag, value)

View File

@ -191,7 +191,7 @@ func (style *viewStyle) cssViewStyle(builder cssBuilder, session Session) {
for _, tag := range []PropertyName{BackgroundClip, BackgroundOrigin, MaskClip, MaskOrigin} {
if value, ok := enumProperty(style, tag, session, 0); ok {
if data, ok := enumProperties[tag]; ok {
builder.add(data.cssTag, data.values[value])
builder.add(data.cssTag, data.cssValues[value])
}
}
}

View File

@ -334,9 +334,9 @@ func GetOutlineOffset(view View, subviewID ...string) SizeUnit {
return sizeStyledProperty(view, subviewID, OutlineOffset, false)
}
// GetShadowPropertys returns shadows of the subview.
// GetShadowProperty returns shadows of the subview.
// If the second argument (subviewID) is not specified or it is "" then shadows of the first argument (view) is returned.
func GetShadowPropertys(view View, subviewID ...string) []ShadowProperty {
func GetShadowProperty(view View, subviewID ...string) []ShadowProperty {
view = getSubview(view, subviewID)
if view == nil {
return []ShadowProperty{}

View File

@ -155,11 +155,6 @@ func (container *viewsContainerData) ViewIndex(view View) int {
return -1
}
func (container *viewsContainerData) cssStyle(self View, builder cssBuilder) {
container.viewData.cssStyle(self, builder)
builder.add(`overflow`, `auto`)
}
func (container *viewsContainerData) htmlSubviews(self View, buffer *strings.Builder) {
if container.views != nil {
for _, view := range container.views {