mirror of https://github.com/anoshenko/rui.git
Compare commits
No commits in common. "dcc69ad777b2ab5cf20cbdd6444cea4edd2b7d26" and "9ac68ac0c98b3bc0b6c094c49390ee6a1449ada9" have entirely different histories.
dcc69ad777
...
9ac68ac0c9
|
@ -1,7 +1,6 @@
|
||||||
# v0.14.0
|
# v0.14.0
|
||||||
* Added the ability to work without creating a WebSocket. Added NoSocket property of AppParams.
|
* Added the ability to work without creating a WebSocket. Added NoSocket property of AppParams.
|
||||||
* Added the ability to run a timer on the client side. Added StartTimer and StopTimer methods to Session interface.
|
* Added the ability to run a timer on the client side. Added StartTimer and StopTimer methods to Session interface.
|
||||||
* Added "cell-vertical-self-align", and "cell-horizontal-self-align" properties
|
|
||||||
* Bug fixing
|
* Bug fixing
|
||||||
|
|
||||||
# v0.13.x
|
# v0.13.x
|
||||||
|
|
16
README.md
16
README.md
|
@ -2465,10 +2465,9 @@ The SizeUnit value of type SizeInFraction can be either integer or fractional.
|
||||||
The "grid-row-gap" and "grid-column-gap" SizeUnit properties (GridRowGap and GridColumnGap constants)
|
The "grid-row-gap" and "grid-column-gap" SizeUnit properties (GridRowGap and GridColumnGap constants)
|
||||||
allow you to set the distance between the rows and columns of the container, respectively. The default is 0px.
|
allow you to set the distance between the rows and columns of the container, respectively. The default is 0px.
|
||||||
|
|
||||||
### "cell-vertical-align" and "cell-vertical-self-align" properties
|
### "cell-vertical-align" property
|
||||||
|
|
||||||
The "cell-vertical-align" int property (constant CellVerticalAlign) sets the default vertical alignment of children
|
The "cell-vertical-align" property (constant CellVerticalAlign) of type int sets the vertical alignment of children within the cell they are occupying. Valid values:
|
||||||
within the cell they are occupying. Valid values:
|
|
||||||
|
|
||||||
| Value | Constant | Name | Alignment |
|
| Value | Constant | Name | Alignment |
|
||||||
|:-----:|--------------|-----------|---------------------|
|
|:-----:|--------------|-----------|---------------------|
|
||||||
|
@ -2479,13 +2478,9 @@ within the cell they are occupying. Valid values:
|
||||||
|
|
||||||
The default value is StretchAlign (3)
|
The default value is StretchAlign (3)
|
||||||
|
|
||||||
The "cell-vertical-self-align" int property (constant CellVerticalAlign) sets the vertical alignment of children
|
### "cell-horizontal-align" property
|
||||||
within the cell they are occupying. This property should be set not for the grid, but for the children.
|
|
||||||
|
|
||||||
### "cell-horizontal-align" and "cell-horizontal-self-align" properties
|
The "cell-horizontal-align" property (constant CellHorizontalAlign) of type int sets the horizontal alignment of children within the occupied cell. Valid values:
|
||||||
|
|
||||||
The "cell-horizontal-align" int property (constant CellHorizontalSelfAlign) sets the horizontal alignment
|
|
||||||
of children within the occupied cell. Valid values:
|
|
||||||
|
|
||||||
| Value | Constant | Name | Alignment |
|
| Value | Constant | Name | Alignment |
|
||||||
|:-----:|--------------|-----------|--------------------|
|
|:-----:|--------------|-----------|--------------------|
|
||||||
|
@ -2496,9 +2491,6 @@ of children within the occupied cell. Valid values:
|
||||||
|
|
||||||
The default value is StretchAlign (3)
|
The default value is StretchAlign (3)
|
||||||
|
|
||||||
The "cell-horizontal-self-align" int property (constant CellVerticalSelfAlign) sets the horizontal alignment of children
|
|
||||||
within the cell they are occupying. This property should be set not for the grid, but for the children.
|
|
||||||
|
|
||||||
## ColumnLayout
|
## ColumnLayout
|
||||||
|
|
||||||
ColumnLayout is a container that implements the ViewsContainer interface.
|
ColumnLayout is a container that implements the ViewsContainer interface.
|
||||||
|
|
|
@ -57,10 +57,9 @@ button {
|
||||||
|
|
||||||
textarea {
|
textarea {
|
||||||
margin: 2px;
|
margin: 2px;
|
||||||
padding: 4px;
|
padding: 1px;
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
font-size: inherit;
|
font-size: inherit;
|
||||||
resize: none;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ul:focus {
|
ul:focus {
|
||||||
|
|
|
@ -5,44 +5,6 @@ import (
|
||||||
"strings"
|
"strings"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
|
||||||
// CellVerticalAlign is the constant for the "cell-vertical-align" property tag.
|
|
||||||
// The "cell-vertical-align" int property sets the default vertical alignment
|
|
||||||
// of GridLayout children within the cell they are occupying. Valid values:
|
|
||||||
// * TopAlign (0) / "top"
|
|
||||||
// * BottomAlign (1) / "bottom"
|
|
||||||
// * CenterAlign (2) / "center", and
|
|
||||||
// * StretchAlign (2) / "stretch"
|
|
||||||
CellVerticalAlign = "cell-vertical-align"
|
|
||||||
|
|
||||||
// CellHorizontalAlign is the constant for the "cell-horizontal-align" property tag.
|
|
||||||
// The "cell-horizontal-align" int property sets the default horizontal alignment
|
|
||||||
// of GridLayout children within the occupied cell. Valid values:
|
|
||||||
// * LeftAlign (0) / "left"
|
|
||||||
// * RightAlign (1) / "right"
|
|
||||||
// * CenterAlign (2) / "center"
|
|
||||||
// * StretchAlign (3) / "stretch"
|
|
||||||
CellHorizontalAlign = "cell-horizontal-align"
|
|
||||||
|
|
||||||
// CellVerticalSelfAlign is the constant for the "cell-vertical-self-align" property tag.
|
|
||||||
// The "cell-vertical-align" int property sets the vertical alignment of GridLayout children
|
|
||||||
// within the cell they are occupying. The property is set for the child view of GridLayout. Valid values:
|
|
||||||
// * TopAlign (0) / "top"
|
|
||||||
// * BottomAlign (1) / "bottom"
|
|
||||||
// * CenterAlign (2) / "center", and
|
|
||||||
// * StretchAlign (2) / "stretch"
|
|
||||||
CellVerticalSelfAlign = "cell-vertical-self-align"
|
|
||||||
|
|
||||||
// CellHorizontalSelfAlign is the constant for the "cell-horizontal-self-align" property tag.
|
|
||||||
// The "cell-horizontal-self align" int property sets the horizontal alignment of GridLayout children
|
|
||||||
// within the occupied cell. The property is set for the child view of GridLayout. Valid values:
|
|
||||||
// * LeftAlign (0) / "left"
|
|
||||||
// * RightAlign (1) / "right"
|
|
||||||
// * CenterAlign (2) / "center"
|
|
||||||
// * StretchAlign (3) / "stretch"
|
|
||||||
CellHorizontalSelfAlign = "cell-horizontal-self-align"
|
|
||||||
)
|
|
||||||
|
|
||||||
// GridLayout - grid-container of View
|
// GridLayout - grid-container of View
|
||||||
type GridLayout interface {
|
type GridLayout interface {
|
||||||
ViewsContainer
|
ViewsContainer
|
||||||
|
|
|
@ -666,8 +666,7 @@ const (
|
||||||
|
|
||||||
// Resize is the constant for the "resize" property tag.
|
// Resize is the constant for the "resize" property tag.
|
||||||
// The "resize" int property sets whether an element is resizable, and if so, in which directions.
|
// The "resize" int property sets whether an element is resizable, and if so, in which directions.
|
||||||
// Valid values are "none" / NoneResize (0), "both" / BothResize (1),
|
// Valid values are "none" (0), "both" (1), horizontal (2), and "vertical" (3)
|
||||||
// "horizontal" / HorizontalResize (2), and "vertical" / VerticalResize (3)
|
|
||||||
Resize = "resize"
|
Resize = "resize"
|
||||||
|
|
||||||
// UserSelect is the constant for the "user-select" property tag.
|
// UserSelect is the constant for the "user-select" property tag.
|
||||||
|
|
|
@ -331,16 +331,6 @@ var enumProperties = map[string]struct {
|
||||||
"justify-items",
|
"justify-items",
|
||||||
[]string{"start", "end", "center", "stretch"},
|
[]string{"start", "end", "center", "stretch"},
|
||||||
},
|
},
|
||||||
CellVerticalSelfAlign: {
|
|
||||||
[]string{"top", "bottom", "center", "stretch"},
|
|
||||||
"align-self",
|
|
||||||
[]string{"start", "end", "center", "stretch"},
|
|
||||||
},
|
|
||||||
CellHorizontalSelfAlign: {
|
|
||||||
[]string{"left", "right", "center", "stretch"},
|
|
||||||
"justify-self",
|
|
||||||
[]string{"start", "end", "center", "stretch"},
|
|
||||||
},
|
|
||||||
GridAutoFlow: {
|
GridAutoFlow: {
|
||||||
[]string{"row", "column", "row-dense", "column-dense"},
|
[]string{"row", "column", "row-dense", "column-dense"},
|
||||||
GridAutoFlow,
|
GridAutoFlow,
|
||||||
|
|
|
@ -11,23 +11,22 @@ const (
|
||||||
// The "side" int property determines which side of the container is used to resize.
|
// The "side" int property determines which side of the container is used to resize.
|
||||||
// The value of property is or-combination of TopSide (1), RightSide (2), BottomSide (4), and LeftSide (8)
|
// The value of property is or-combination of TopSide (1), RightSide (2), BottomSide (4), and LeftSide (8)
|
||||||
Side = "side"
|
Side = "side"
|
||||||
|
|
||||||
// ResizeBorderWidth is the constant for the "resize-border-width" property tag.
|
// ResizeBorderWidth is the constant for the "resize-border-width" property tag.
|
||||||
// The "ResizeBorderWidth" SizeUnit property determines the width of the resizing border
|
// The "ResizeBorderWidth" SizeUnit property determines the width of the resizing border
|
||||||
ResizeBorderWidth = "resize-border-width"
|
ResizeBorderWidth = "resize-border-width"
|
||||||
|
// CellVerticalAlign is the constant for the "cell-vertical-align" property tag.
|
||||||
|
CellVerticalAlign = "cell-vertical-align"
|
||||||
|
// CellHorizontalAlign is the constant for the "cell-horizontal-align" property tag.
|
||||||
|
CellHorizontalAlign = "cell-horizontal-align"
|
||||||
|
|
||||||
// TopSide is value of the "side" property: the top side is used to resize
|
// TopSide is value of the "side" property: the top side is used to resize
|
||||||
TopSide = 1
|
TopSide = 1
|
||||||
|
|
||||||
// RightSide is value of the "side" property: the right side is used to resize
|
// RightSide is value of the "side" property: the right side is used to resize
|
||||||
RightSide = 2
|
RightSide = 2
|
||||||
|
|
||||||
// BottomSide is value of the "side" property: the bottom side is used to resize
|
// BottomSide is value of the "side" property: the bottom side is used to resize
|
||||||
BottomSide = 4
|
BottomSide = 4
|
||||||
|
|
||||||
// LeftSide is value of the "side" property: the left side is used to resize
|
// LeftSide is value of the "side" property: the left side is used to resize
|
||||||
LeftSide = 8
|
LeftSide = 8
|
||||||
|
|
||||||
// AllSides is value of the "side" property: all sides is used to resize
|
// AllSides is value of the "side" property: all sides is used to resize
|
||||||
AllSides = TopSide | RightSide | BottomSide | LeftSide
|
AllSides = TopSide | RightSide | BottomSide | LeftSide
|
||||||
)
|
)
|
||||||
|
|
18
view.go
18
view.go
|
@ -650,8 +650,6 @@ func viewPropertyChanged(view *viewData, tag string) {
|
||||||
case ZIndex, Order, TabSize:
|
case ZIndex, Order, TabSize:
|
||||||
if i, ok := intProperty(view, tag, session, 0); ok {
|
if i, ok := intProperty(view, tag, session, 0); ok {
|
||||||
session.updateCSSProperty(htmlID, tag, strconv.Itoa(i))
|
session.updateCSSProperty(htmlID, tag, strconv.Itoa(i))
|
||||||
} else {
|
|
||||||
session.updateCSSProperty(htmlID, tag, "")
|
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@ -699,11 +697,8 @@ func viewPropertyChanged(view *viewData, tag string) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if cssTag, ok := sizeProperties[tag]; ok {
|
if cssTag, ok := sizeProperties[tag]; ok {
|
||||||
if size, ok := sizeProperty(view, tag, session); ok {
|
size, _ := sizeProperty(view, tag, session)
|
||||||
session.updateCSSProperty(htmlID, cssTag, size.cssString("", session))
|
session.updateCSSProperty(htmlID, cssTag, size.cssString("", session))
|
||||||
} else {
|
|
||||||
session.updateCSSProperty(htmlID, cssTag, "")
|
|
||||||
}
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -724,11 +719,8 @@ func viewPropertyChanged(view *viewData, tag string) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if valuesData, ok := enumProperties[tag]; ok && valuesData.cssTag != "" {
|
if valuesData, ok := enumProperties[tag]; ok && valuesData.cssTag != "" {
|
||||||
if n, ok := enumProperty(view, tag, session, 0); ok {
|
n, _ := enumProperty(view, tag, session, 0)
|
||||||
session.updateCSSProperty(htmlID, valuesData.cssTag, valuesData.cssValues[n])
|
session.updateCSSProperty(htmlID, valuesData.cssTag, valuesData.cssValues[n])
|
||||||
} else {
|
|
||||||
session.updateCSSProperty(htmlID, valuesData.cssTag, "")
|
|
||||||
}
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -736,8 +728,6 @@ func viewPropertyChanged(view *viewData, tag string) {
|
||||||
if tag == floatTag {
|
if tag == floatTag {
|
||||||
if f, ok := floatTextProperty(view, floatTag, session, 0); ok {
|
if f, ok := floatTextProperty(view, floatTag, session, 0); ok {
|
||||||
session.updateCSSProperty(htmlID, floatTag, f)
|
session.updateCSSProperty(htmlID, floatTag, f)
|
||||||
} else {
|
|
||||||
session.updateCSSProperty(htmlID, floatTag, "")
|
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue