forked from mbk-lab/rui_orig
Added "column-span-all" property
This commit is contained in:
parent
c7a7b3ed1e
commit
01e2e2e00b
|
@ -1,7 +1,7 @@
|
||||||
# v.11.0
|
# v.11.0
|
||||||
|
|
||||||
* Added "tabindex", "order", "column-fill", "background-blend-mode", and "mix-blend-mode" properties
|
* Added "tabindex", "order", "column-fill", "column-span-all", "background-blend-mode", and "mix-blend-mode" properties
|
||||||
* Added GetTabIndex, GetOrder, GetColumnFill, GetBackgroundBlendMode, and GetMixBlendMode functions
|
* Added GetTabIndex, GetOrder, GetColumnFill, IsColumnSpanAll, GetBackgroundBlendMode, and GetMixBlendMode functions
|
||||||
* ClientItem, SetClientItem, and RemoveAllClientItems method added to Session interface
|
* ClientItem, SetClientItem, and RemoveAllClientItems method added to Session interface
|
||||||
* PropertyWithTag method of DataObject interface renamed to PropertyByTag
|
* PropertyWithTag method of DataObject interface renamed to PropertyByTag
|
||||||
|
|
||||||
|
|
14
README-ru.md
14
README-ru.md
|
@ -2603,6 +2603,20 @@ ViewBorder описана как
|
||||||
|
|
||||||
func GetAvoidBreak(view View, subviewID ...string) bool
|
func GetAvoidBreak(view View, subviewID ...string) bool
|
||||||
|
|
||||||
|
### Свойство "column-span-all"
|
||||||
|
|
||||||
|
Свойство "column-span-all" (константа ColumnSpanAll) типа bool устанавливается для View помещенных в ColumnLayout.
|
||||||
|
Если данное свойство установлено в true, то View расширяется на всю ширину ColumnLayout, занимая все колонки.
|
||||||
|
Такое View будет как бы разрывать контейнер.
|
||||||
|
|
||||||
|
Обычно данное свойство используется для заголовков.
|
||||||
|
|
||||||
|
Значение по умолчанию "false".
|
||||||
|
|
||||||
|
Получить значение данного свойства можно с помощью функции
|
||||||
|
|
||||||
|
func IsColumnSpanAll(view View, subviewID ...string) bool
|
||||||
|
|
||||||
## StackLayout
|
## StackLayout
|
||||||
|
|
||||||
StackLayout является контейнером, реализующим интерфейс ViewsContainer. Все дочерние View
|
StackLayout является контейнером, реализующим интерфейс ViewsContainer. Все дочерние View
|
||||||
|
|
14
README.md
14
README.md
|
@ -2579,6 +2579,20 @@ You can get the value of this property using the function
|
||||||
|
|
||||||
func GetAvoidBreak(view View, subviewID ...string) bool
|
func GetAvoidBreak(view View, subviewID ...string) bool
|
||||||
|
|
||||||
|
### "column-span-all" property
|
||||||
|
|
||||||
|
The "column-span-all" bool property (ColumnSpanAll constant) is set for Views placed in the ColumnLayout.
|
||||||
|
If this property is set to true, then the View expands to the full width of the ColumnLayout, covering all columns.
|
||||||
|
Such a View will, as it were, break the container.
|
||||||
|
|
||||||
|
Typically, this property is used for headers.
|
||||||
|
|
||||||
|
The default value is "false".
|
||||||
|
|
||||||
|
You can get the value of this property using the function
|
||||||
|
|
||||||
|
func IsColumnSpanAll(view View, subviewID ...string) bool
|
||||||
|
|
||||||
## StackLayout
|
## StackLayout
|
||||||
|
|
||||||
StackLayout is a container that implements the ViewsContainer interface.
|
StackLayout is a container that implements the ViewsContainer interface.
|
||||||
|
|
|
@ -426,6 +426,7 @@ function mouseOutEvent(element, event) {
|
||||||
function clickEvent(element, event) {
|
function clickEvent(element, event) {
|
||||||
mouseEvent(element, event, "click-event")
|
mouseEvent(element, event, "click-event")
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
|
event.stopPropagation();
|
||||||
}
|
}
|
||||||
|
|
||||||
function doubleClickEvent(element, event) {
|
function doubleClickEvent(element, event) {
|
||||||
|
|
|
@ -46,6 +46,10 @@ const (
|
||||||
// * ColumnFillBalance (0) - Content is equally divided between columns (default value);
|
// * ColumnFillBalance (0) - Content is equally divided between columns (default value);
|
||||||
// * ColumnFillAuto (1) - Columns are filled sequentially. Content takes up only the room it needs, possibly resulting in some columns remaining empty.
|
// * ColumnFillAuto (1) - Columns are filled sequentially. Content takes up only the room it needs, possibly resulting in some columns remaining empty.
|
||||||
ColumnFill = "column-fill"
|
ColumnFill = "column-fill"
|
||||||
|
|
||||||
|
// ColumnSpanAll is the constant for the "column-span-all" property tag.
|
||||||
|
// The "column-span-all" bool property makes it possible for a view to span across all columns when its value is set to true.
|
||||||
|
ColumnSpanAll = "column-span-all"
|
||||||
)
|
)
|
||||||
|
|
||||||
// ColumnLayout - grid-container of View
|
// ColumnLayout - grid-container of View
|
||||||
|
@ -226,3 +230,9 @@ func GetColumnSeparatorColor(view View, subviewID ...string) Color {
|
||||||
func GetColumnFill(view View, subviewID ...string) int {
|
func GetColumnFill(view View, subviewID ...string) int {
|
||||||
return enumStyledProperty(view, subviewID, ColumnFill, ColumnFillBalance, true)
|
return enumStyledProperty(view, subviewID, ColumnFill, ColumnFillBalance, true)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// IsColumnSpanAll returns a "column-span-all" property value of the subview.
|
||||||
|
// If the second argument (subviewID) is not specified or it is "" then a value from the first argument (view) is returned.
|
||||||
|
func IsColumnSpanAll(view View, subviewID ...string) bool {
|
||||||
|
return boolStyledProperty(view, subviewID, ColumnSpanAll, false)
|
||||||
|
}
|
||||||
|
|
|
@ -63,6 +63,7 @@ var boolProperties = []string{
|
||||||
TabCloseButton,
|
TabCloseButton,
|
||||||
Repeating,
|
Repeating,
|
||||||
UserSelect,
|
UserSelect,
|
||||||
|
ColumnSpanAll,
|
||||||
}
|
}
|
||||||
|
|
||||||
var intProperties = []string{
|
var intProperties = []string{
|
||||||
|
|
8
view.go
8
view.go
|
@ -626,6 +626,14 @@ func viewPropertyChanged(view *viewData, tag string) {
|
||||||
session.updateCSSProperty(htmlID, "user-select", "")
|
session.updateCSSProperty(htmlID, "user-select", "")
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
|
|
||||||
|
case ColumnSpanAll:
|
||||||
|
if spanAll, ok := boolProperty(view, ColumnSpanAll, session); ok && spanAll {
|
||||||
|
session.updateCSSProperty(htmlID, `column-span`, `all`)
|
||||||
|
} else {
|
||||||
|
session.updateCSSProperty(htmlID, `column-span`, `none`)
|
||||||
|
}
|
||||||
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if cssTag, ok := sizeProperties[tag]; ok {
|
if cssTag, ok := sizeProperties[tag]; ok {
|
||||||
|
|
|
@ -453,6 +453,14 @@ func (style *viewStyle) cssViewStyle(builder cssBuilder, session Session) {
|
||||||
builder.add(`animation-play-state`, `running`)
|
builder.add(`animation-play-state`, `running`)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if spanAll, ok := boolProperty(style, ColumnSpanAll, session); ok {
|
||||||
|
if spanAll {
|
||||||
|
builder.add(`column-span`, `all`)
|
||||||
|
} else {
|
||||||
|
builder.add(`column-span`, `none`)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func valueToOrientation(value any, session Session) (int, bool) {
|
func valueToOrientation(value any, session Session) (int, bool) {
|
||||||
|
|
Loading…
Reference in New Issue