mirror of https://github.com/anoshenko/rui.git
Renamed ColorPropery constant to ColorTag
This commit is contained in:
parent
be954df7c7
commit
f64f6d2bca
58
border.go
58
border.go
|
@ -79,7 +79,7 @@ func newBorderProperty(value interface{}) BorderProperty {
|
|||
case ViewBorder:
|
||||
border.properties[Style] = value.Style
|
||||
border.properties[Width] = value.Width
|
||||
border.properties[ColorProperty] = value.Color
|
||||
border.properties[ColorTag] = value.Color
|
||||
|
||||
case ViewBorders:
|
||||
if value.Left.Style == value.Right.Style &&
|
||||
|
@ -105,7 +105,7 @@ func newBorderProperty(value interface{}) BorderProperty {
|
|||
if value.Left.Color == value.Right.Color &&
|
||||
value.Left.Color == value.Top.Color &&
|
||||
value.Left.Color == value.Bottom.Color {
|
||||
border.properties[ColorProperty] = value.Left.Color
|
||||
border.properties[ColorTag] = value.Left.Color
|
||||
} else {
|
||||
border.properties[LeftColor] = value.Left.Color
|
||||
border.properties[RightColor] = value.Right.Color
|
||||
|
@ -126,7 +126,7 @@ func NewBorder(params Params) BorderProperty {
|
|||
border := new(borderProperty)
|
||||
border.properties = map[string]interface{}{}
|
||||
if params != nil {
|
||||
for _, tag := range []string{Style, Width, ColorProperty, Left, Right, Top, Bottom,
|
||||
for _, tag := range []string{Style, Width, ColorTag, Left, Right, Top, Bottom,
|
||||
LeftStyle, RightStyle, TopStyle, BottomStyle,
|
||||
LeftWidth, RightWidth, TopWidth, BottomWidth,
|
||||
LeftColor, RightColor, TopColor, BottomColor} {
|
||||
|
@ -184,7 +184,7 @@ func (border *borderProperty) normalizeTag(tag string) string {
|
|||
return BottomWidth
|
||||
|
||||
case BorderColor, CellBorderColor:
|
||||
return ColorProperty
|
||||
return ColorTag
|
||||
|
||||
case BorderLeftColor, CellBorderLeftColor, "color-left":
|
||||
return LeftColor
|
||||
|
@ -205,7 +205,7 @@ func (border *borderProperty) normalizeTag(tag string) string {
|
|||
func (border *borderProperty) ruiString(writer ruiWriter) {
|
||||
writer.startObject("_")
|
||||
|
||||
for _, tag := range []string{Style, Width, ColorProperty} {
|
||||
for _, tag := range []string{Style, Width, ColorTag} {
|
||||
if value, ok := border.properties[tag]; ok {
|
||||
writer.writeProperty(Style, value)
|
||||
}
|
||||
|
@ -214,7 +214,7 @@ func (border *borderProperty) ruiString(writer ruiWriter) {
|
|||
for _, side := range []string{Top, Right, Bottom, Left} {
|
||||
style, okStyle := border.properties[side+"-"+Style]
|
||||
width, okWidth := border.properties[side+"-"+Width]
|
||||
color, okColor := border.properties[side+"-"+ColorProperty]
|
||||
color, okColor := border.properties[side+"-"+ColorTag]
|
||||
if okStyle || okWidth || okColor {
|
||||
writer.startObjectProperty(side, "_")
|
||||
if okStyle {
|
||||
|
@ -224,7 +224,7 @@ func (border *borderProperty) ruiString(writer ruiWriter) {
|
|||
writer.writeProperty(Width, width)
|
||||
}
|
||||
if okColor {
|
||||
writer.writeProperty(ColorProperty, color)
|
||||
writer.writeProperty(ColorTag, color)
|
||||
}
|
||||
writer.endObject()
|
||||
}
|
||||
|
@ -246,7 +246,7 @@ func (border *borderProperty) setSingleBorderObject(prefix string, obj DataObjec
|
|||
result = false
|
||||
}
|
||||
}
|
||||
if text, ok := obj.PropertyValue(ColorProperty); ok {
|
||||
if text, ok := obj.PropertyValue(ColorTag); ok {
|
||||
if !border.setColorProperty(prefix+"-color", text) {
|
||||
result = false
|
||||
}
|
||||
|
@ -297,11 +297,11 @@ func (border *borderProperty) setBorderObject(obj DataObject) bool {
|
|||
}
|
||||
}
|
||||
|
||||
if text, ok := obj.PropertyValue(ColorProperty); ok {
|
||||
if text, ok := obj.PropertyValue(ColorTag); ok {
|
||||
values := split4Values(text)
|
||||
switch len(values) {
|
||||
case 1:
|
||||
if !border.setColorProperty(ColorProperty, values[0]) {
|
||||
if !border.setColorProperty(ColorTag, values[0]) {
|
||||
return false
|
||||
}
|
||||
|
||||
|
@ -313,7 +313,7 @@ func (border *borderProperty) setBorderObject(obj DataObject) bool {
|
|||
}
|
||||
|
||||
default:
|
||||
notCompatibleType(ColorProperty, text)
|
||||
notCompatibleType(ColorTag, text)
|
||||
result = false
|
||||
}
|
||||
}
|
||||
|
@ -356,7 +356,7 @@ func (border *borderProperty) Remove(tag string) {
|
|||
delete(border.properties, t)
|
||||
}
|
||||
|
||||
case ColorProperty:
|
||||
case ColorTag:
|
||||
for _, t := range []string{tag, TopColor, RightColor, BottomColor, LeftColor} {
|
||||
delete(border.properties, t)
|
||||
}
|
||||
|
@ -392,7 +392,7 @@ func (border *borderProperty) Remove(tag string) {
|
|||
|
||||
case LeftColor, RightColor, TopColor, BottomColor:
|
||||
delete(border.properties, tag)
|
||||
if color, ok := border.properties[ColorProperty]; ok && color != nil {
|
||||
if color, ok := border.properties[ColorTag]; ok && color != nil {
|
||||
for _, t := range []string{TopColor, RightColor, BottomColor, LeftColor} {
|
||||
if t != tag {
|
||||
if _, ok := border.properties[t]; !ok {
|
||||
|
@ -432,8 +432,8 @@ func (border *borderProperty) Set(tag string, value interface{}) bool {
|
|||
return true
|
||||
}
|
||||
|
||||
case ColorProperty:
|
||||
if border.setColorProperty(ColorProperty, value) {
|
||||
case ColorTag:
|
||||
if border.setColorProperty(ColorTag, value) {
|
||||
for _, side := range []string{TopColor, RightColor, BottomColor, LeftColor} {
|
||||
delete(border.properties, side)
|
||||
}
|
||||
|
@ -464,7 +464,7 @@ func (border *borderProperty) Set(tag string, value interface{}) bool {
|
|||
if style := value.Get(styleTag); value != nil {
|
||||
border.properties[styleTag] = style
|
||||
}
|
||||
colorTag := tag + "-" + ColorProperty
|
||||
colorTag := tag + "-" + ColorTag
|
||||
if color := value.Get(colorTag); value != nil {
|
||||
border.properties[colorTag] = color
|
||||
}
|
||||
|
@ -477,7 +477,7 @@ func (border *borderProperty) Set(tag string, value interface{}) bool {
|
|||
case ViewBorder:
|
||||
border.properties[tag+"-"+Style] = value.Style
|
||||
border.properties[tag+"-"+Width] = value.Width
|
||||
border.properties[tag+"-"+ColorProperty] = value.Color
|
||||
border.properties[tag+"-"+ColorTag] = value.Color
|
||||
return true
|
||||
}
|
||||
fallthrough
|
||||
|
@ -509,10 +509,10 @@ func (border *borderProperty) Get(tag string) interface{} {
|
|||
} else if width, ok := border.properties[Width]; ok {
|
||||
result.Set(Width, width)
|
||||
}
|
||||
if color, ok := border.properties[tag+"-"+ColorProperty]; ok {
|
||||
result.Set(ColorProperty, color)
|
||||
} else if color, ok := border.properties[ColorProperty]; ok {
|
||||
result.Set(ColorProperty, color)
|
||||
if color, ok := border.properties[tag+"-"+ColorTag]; ok {
|
||||
result.Set(ColorTag, color)
|
||||
} else if color, ok := border.properties[ColorTag]; ok {
|
||||
result.Set(ColorTag, color)
|
||||
}
|
||||
return result
|
||||
|
||||
|
@ -532,7 +532,7 @@ func (border *borderProperty) Get(tag string) interface{} {
|
|||
if color, ok := border.properties[tag]; ok {
|
||||
return color
|
||||
}
|
||||
return border.properties[ColorProperty]
|
||||
return border.properties[ColorTag]
|
||||
}
|
||||
|
||||
return nil
|
||||
|
@ -549,15 +549,15 @@ func (border *borderProperty) delete(tag string) {
|
|||
case Width:
|
||||
remove = []string{Width, LeftWidth, RightWidth, TopWidth, BottomWidth}
|
||||
|
||||
case ColorProperty:
|
||||
remove = []string{ColorProperty, LeftColor, RightColor, TopColor, BottomColor}
|
||||
case ColorTag:
|
||||
remove = []string{ColorTag, LeftColor, RightColor, TopColor, BottomColor}
|
||||
|
||||
case Left, Right, Top, Bottom:
|
||||
if border.Get(Style) != nil {
|
||||
border.properties[tag+"-"+Style] = 0
|
||||
remove = []string{tag + "-" + ColorProperty, tag + "-" + Width}
|
||||
remove = []string{tag + "-" + ColorTag, tag + "-" + Width}
|
||||
} else {
|
||||
remove = []string{tag + "-" + Style, tag + "-" + ColorProperty, tag + "-" + Width}
|
||||
remove = []string{tag + "-" + Style, tag + "-" + ColorTag, tag + "-" + Width}
|
||||
}
|
||||
|
||||
case LeftStyle, RightStyle, TopStyle, BottomStyle:
|
||||
|
@ -575,7 +575,7 @@ func (border *borderProperty) delete(tag string) {
|
|||
}
|
||||
|
||||
case LeftColor, RightColor, TopColor, BottomColor:
|
||||
if border.Get(ColorProperty) != nil {
|
||||
if border.Get(ColorTag) != nil {
|
||||
border.properties[tag] = 0
|
||||
} else {
|
||||
remove = []string{tag}
|
||||
|
@ -591,7 +591,7 @@ func (border *borderProperty) ViewBorders(session Session) ViewBorders {
|
|||
|
||||
defStyle, _ := valueToEnum(border.getRaw(Style), BorderStyle, session, NoneLine)
|
||||
defWidth, _ := sizeProperty(border, Width, session)
|
||||
defColor, _ := colorProperty(border, ColorProperty, session)
|
||||
defColor, _ := colorProperty(border, ColorTag, session)
|
||||
|
||||
getBorder := func(prefix string) ViewBorder {
|
||||
var result ViewBorder
|
||||
|
@ -602,7 +602,7 @@ func (border *borderProperty) ViewBorders(session Session) ViewBorders {
|
|||
if result.Width, ok = sizeProperty(border, prefix+Width, session); !ok {
|
||||
result.Width = defWidth
|
||||
}
|
||||
if result.Color, ok = colorProperty(border, prefix+ColorProperty, session); !ok {
|
||||
if result.Color, ok = colorProperty(border, prefix+ColorTag, session); !ok {
|
||||
result.Color = defColor
|
||||
}
|
||||
return result
|
||||
|
|
|
@ -42,7 +42,7 @@ func (picker *colorPickerData) Init(session Session) {
|
|||
func (picker *colorPickerData) normalizeTag(tag string) string {
|
||||
tag = strings.ToLower(tag)
|
||||
switch tag {
|
||||
case Value, ColorProperty:
|
||||
case Value, ColorTag:
|
||||
return ColorPickerValue
|
||||
}
|
||||
|
||||
|
@ -224,7 +224,7 @@ func GetColorPickerValue(view View, subviewID string) Color {
|
|||
if result, ok := colorStyledProperty(view, ColorPickerValue); ok {
|
||||
return result
|
||||
}
|
||||
for _, tag := range []string{Value, ColorProperty} {
|
||||
for _, tag := range []string{Value, ColorTag} {
|
||||
if value, ok := valueFromStyle(view, tag); ok {
|
||||
if result, ok := valueToColor(value, view.Session()); ok {
|
||||
return result
|
||||
|
|
|
@ -33,7 +33,7 @@ func newColumnSeparatorProperty(value interface{}) ColumnSeparatorProperty {
|
|||
case DataObject:
|
||||
separator := new(columnSeparatorProperty)
|
||||
separator.properties = map[string]interface{}{}
|
||||
for _, tag := range []string{Style, Width, ColorProperty} {
|
||||
for _, tag := range []string{Style, Width, ColorTag} {
|
||||
if val, ok := value.PropertyValue(tag); ok && val != "" {
|
||||
separator.set(tag, value)
|
||||
}
|
||||
|
@ -43,9 +43,9 @@ func newColumnSeparatorProperty(value interface{}) ColumnSeparatorProperty {
|
|||
case ViewBorder:
|
||||
separator := new(columnSeparatorProperty)
|
||||
separator.properties = map[string]interface{}{
|
||||
Style: value.Style,
|
||||
Width: value.Width,
|
||||
ColorProperty: value.Color,
|
||||
Style: value.Style,
|
||||
Width: value.Width,
|
||||
ColorTag: value.Color,
|
||||
}
|
||||
return separator
|
||||
}
|
||||
|
@ -59,7 +59,7 @@ func NewColumnSeparator(params Params) ColumnSeparatorProperty {
|
|||
separator := new(columnSeparatorProperty)
|
||||
separator.properties = map[string]interface{}{}
|
||||
if params != nil {
|
||||
for _, tag := range []string{Style, Width, ColorProperty} {
|
||||
for _, tag := range []string{Style, Width, ColorTag} {
|
||||
if value, ok := params[tag]; ok && value != nil {
|
||||
separator.Set(tag, value)
|
||||
}
|
||||
|
@ -78,7 +78,7 @@ func (separator *columnSeparatorProperty) normalizeTag(tag string) string {
|
|||
return Width
|
||||
|
||||
case ColumnSeparatorColor, "separator-color":
|
||||
return ColorProperty
|
||||
return ColorTag
|
||||
}
|
||||
|
||||
return tag
|
||||
|
@ -86,7 +86,7 @@ func (separator *columnSeparatorProperty) normalizeTag(tag string) string {
|
|||
|
||||
func (separator *columnSeparatorProperty) ruiString(writer ruiWriter) {
|
||||
writer.startObject("_")
|
||||
for _, tag := range []string{Style, Width, ColorProperty} {
|
||||
for _, tag := range []string{Style, Width, ColorTag} {
|
||||
if value, ok := separator.properties[tag]; ok {
|
||||
writer.writeProperty(Style, value)
|
||||
}
|
||||
|
@ -103,7 +103,7 @@ func (separator *columnSeparatorProperty) String() string {
|
|||
func (separator *columnSeparatorProperty) Remove(tag string) {
|
||||
|
||||
switch tag = separator.normalizeTag(tag); tag {
|
||||
case Style, Width, ColorProperty:
|
||||
case Style, Width, ColorTag:
|
||||
delete(separator.properties, tag)
|
||||
|
||||
default:
|
||||
|
@ -126,8 +126,8 @@ func (separator *columnSeparatorProperty) Set(tag string, value interface{}) boo
|
|||
case Width:
|
||||
return separator.setSizeProperty(Width, value)
|
||||
|
||||
case ColorProperty:
|
||||
return separator.setColorProperty(ColorProperty, value)
|
||||
case ColorTag:
|
||||
return separator.setColorProperty(ColorTag, value)
|
||||
}
|
||||
|
||||
ErrorLogF(`"%s" property is not compatible with the ColumnSeparatorProperty`, tag)
|
||||
|
@ -147,7 +147,7 @@ func (separator *columnSeparatorProperty) Get(tag string) interface{} {
|
|||
func (separator *columnSeparatorProperty) ViewBorder(session Session) ViewBorder {
|
||||
style, _ := valueToEnum(separator.getRaw(Style), BorderStyle, session, NoneLine)
|
||||
width, _ := sizeProperty(separator, Width, session)
|
||||
color, _ := colorProperty(separator, ColorProperty, session)
|
||||
color, _ := colorProperty(separator, ColorTag, session)
|
||||
|
||||
return ViewBorder{
|
||||
Style: style,
|
||||
|
|
|
@ -100,17 +100,17 @@ func createColumnLayoutDemo(session rui.Session) rui.View {
|
|||
case 2:
|
||||
rui.Set(view, "columnLayout", rui.ColumnSeparator,
|
||||
rui.NewColumnSeparator(rui.Params{
|
||||
rui.Width: rui.Px(2),
|
||||
rui.Style: rui.DottedLine,
|
||||
rui.ColorProperty: rui.Red,
|
||||
rui.Width: rui.Px(2),
|
||||
rui.Style: rui.DottedLine,
|
||||
rui.ColorTag: rui.Red,
|
||||
}))
|
||||
|
||||
case 3:
|
||||
rui.Set(view, "columnLayout", rui.ColumnSeparator,
|
||||
rui.NewColumnSeparator(rui.Params{
|
||||
rui.Width: rui.Px(3),
|
||||
rui.Style: rui.DashedLine,
|
||||
rui.ColorProperty: rui.Blue,
|
||||
rui.Width: rui.Px(3),
|
||||
rui.Style: rui.DashedLine,
|
||||
rui.ColorTag: rui.Blue,
|
||||
}))
|
||||
|
||||
case 4:
|
||||
|
|
|
@ -73,9 +73,9 @@ func createTableViewDemo(session rui.Session) rui.View {
|
|||
switch number {
|
||||
case 1:
|
||||
rui.Set(view, "demoTableView1", borderTag, rui.NewBorder(rui.Params{
|
||||
rui.Style: rui.SolidLine,
|
||||
rui.ColorProperty: rui.Black,
|
||||
rui.Width: rui.Px(1),
|
||||
rui.Style: rui.SolidLine,
|
||||
rui.ColorTag: rui.Black,
|
||||
rui.Width: rui.Px(1),
|
||||
}))
|
||||
|
||||
case 2:
|
||||
|
@ -117,9 +117,9 @@ func createTableViewDemo(session rui.Session) rui.View {
|
|||
case 2:
|
||||
rui.Set(view, "demoTableView1", rui.HeadStyle, rui.Params{
|
||||
rui.CellBorder: rui.NewBorder(rui.Params{
|
||||
rui.Style: rui.SolidLine,
|
||||
rui.ColorProperty: rui.Green,
|
||||
rui.Width: "2px",
|
||||
rui.Style: rui.SolidLine,
|
||||
rui.ColorTag: rui.Green,
|
||||
rui.Width: "2px",
|
||||
}),
|
||||
rui.CellPadding: "8px",
|
||||
rui.BackgroundColor: rui.LightGrey,
|
||||
|
@ -138,9 +138,9 @@ func createTableViewDemo(session rui.Session) rui.View {
|
|||
case 2:
|
||||
rui.Set(view, "demoTableView1", rui.FootStyle, rui.Params{
|
||||
rui.Border: rui.NewBorder(rui.Params{
|
||||
rui.Style: rui.SolidLine,
|
||||
rui.ColorProperty: rui.Black,
|
||||
rui.Width: "2px",
|
||||
rui.Style: rui.SolidLine,
|
||||
rui.ColorTag: rui.Black,
|
||||
rui.Width: "2px",
|
||||
}),
|
||||
rui.CellPadding: "4px",
|
||||
rui.BackgroundColor: rui.LightYellow,
|
||||
|
|
14
outline.go
14
outline.go
|
@ -28,7 +28,7 @@ func NewOutlineProperty(params Params) OutlineProperty {
|
|||
func (outline *outlinePropertyData) ruiString(writer ruiWriter) {
|
||||
writer.startObject("_")
|
||||
|
||||
for _, tag := range []string{Style, Width, ColorProperty} {
|
||||
for _, tag := range []string{Style, Width, ColorTag} {
|
||||
if value, ok := outline.properties[tag]; ok {
|
||||
writer.writeProperty(Style, value)
|
||||
}
|
||||
|
@ -72,8 +72,8 @@ func (outline *outlinePropertyData) Set(tag string, value interface{}) bool {
|
|||
}
|
||||
return outline.setSizeProperty(Width, value)
|
||||
|
||||
case ColorProperty:
|
||||
return outline.setColorProperty(ColorProperty, value)
|
||||
case ColorTag:
|
||||
return outline.setColorProperty(ColorTag, value)
|
||||
|
||||
default:
|
||||
ErrorLogF(`"%s" property is not compatible with the OutlineProperty`, tag)
|
||||
|
@ -88,7 +88,7 @@ func (outline *outlinePropertyData) Get(tag string) interface{} {
|
|||
func (outline *outlinePropertyData) ViewOutline(session Session) ViewOutline {
|
||||
style, _ := valueToEnum(outline.getRaw(Style), BorderStyle, session, NoneLine)
|
||||
width, _ := sizeProperty(outline, Width, session)
|
||||
color, _ := colorProperty(outline, ColorProperty, session)
|
||||
color, _ := colorProperty(outline, ColorTag, session)
|
||||
return ViewOutline{Style: style, Width: width, Color: color}
|
||||
}
|
||||
|
||||
|
@ -130,14 +130,14 @@ func (style *viewStyle) setOutline(value interface{}) bool {
|
|||
style.properties[Outline] = value
|
||||
|
||||
case ViewOutline:
|
||||
style.properties[Outline] = NewOutlineProperty(Params{Style: value.Style, Width: value.Width, ColorProperty: value.Color})
|
||||
style.properties[Outline] = NewOutlineProperty(Params{Style: value.Style, Width: value.Width, ColorTag: value.Color})
|
||||
|
||||
case ViewBorder:
|
||||
style.properties[Outline] = NewOutlineProperty(Params{Style: value.Style, Width: value.Width, ColorProperty: value.Color})
|
||||
style.properties[Outline] = NewOutlineProperty(Params{Style: value.Style, Width: value.Width, ColorTag: value.Color})
|
||||
|
||||
case DataObject:
|
||||
outline := NewOutlineProperty(nil)
|
||||
for _, tag := range []string{Style, Width, ColorProperty} {
|
||||
for _, tag := range []string{Style, Width, ColorTag} {
|
||||
if text, ok := value.PropertyValue(tag); ok && text != "" {
|
||||
outline.Set(tag, text)
|
||||
}
|
||||
|
|
|
@ -7,7 +7,7 @@ import (
|
|||
)
|
||||
|
||||
var colorProperties = []string{
|
||||
ColorProperty,
|
||||
ColorTag,
|
||||
BackgroundColor,
|
||||
TextColor,
|
||||
BorderColor,
|
||||
|
|
44
shadow.go
44
shadow.go
|
@ -6,8 +6,8 @@ import (
|
|||
)
|
||||
|
||||
const (
|
||||
// ColorProperty is the name of the color property of the shadow.
|
||||
ColorProperty = "color"
|
||||
// ColorTag is the name of the color property of the shadow.
|
||||
ColorTag = "color"
|
||||
// Inset is the name of bool property of the shadow. If it is set to "false" (default) then the shadow
|
||||
// is assumed to be a drop shadow (as if the box were raised above the content).
|
||||
// If it is set to "true" then the shadow to one inside the frame (as if the content was depressed inside the box).
|
||||
|
@ -48,11 +48,11 @@ type viewShadowData struct {
|
|||
// color - the color of the shadow
|
||||
func NewViewShadow(offsetX, offsetY, blurRadius, spreadRadius SizeUnit, color Color) ViewShadow {
|
||||
return NewShadowWithParams(Params{
|
||||
XOffset: offsetX,
|
||||
YOffset: offsetY,
|
||||
BlurRadius: blurRadius,
|
||||
SpreadRadius: spreadRadius,
|
||||
ColorProperty: color,
|
||||
XOffset: offsetX,
|
||||
YOffset: offsetY,
|
||||
BlurRadius: blurRadius,
|
||||
SpreadRadius: spreadRadius,
|
||||
ColorTag: color,
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -63,12 +63,12 @@ func NewViewShadow(offsetX, offsetY, blurRadius, spreadRadius SizeUnit, color Co
|
|||
// color - the color of the shadow
|
||||
func NewInsetViewShadow(offsetX, offsetY, blurRadius, spreadRadius SizeUnit, color Color) ViewShadow {
|
||||
return NewShadowWithParams(Params{
|
||||
XOffset: offsetX,
|
||||
YOffset: offsetY,
|
||||
BlurRadius: blurRadius,
|
||||
SpreadRadius: spreadRadius,
|
||||
ColorProperty: color,
|
||||
Inset: true,
|
||||
XOffset: offsetX,
|
||||
YOffset: offsetY,
|
||||
BlurRadius: blurRadius,
|
||||
SpreadRadius: spreadRadius,
|
||||
ColorTag: color,
|
||||
Inset: true,
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -78,10 +78,10 @@ func NewInsetViewShadow(offsetX, offsetY, blurRadius, spreadRadius SizeUnit, col
|
|||
// color - the color of the shadow
|
||||
func NewTextShadow(offsetX, offsetY, blurRadius SizeUnit, color Color) ViewShadow {
|
||||
return NewShadowWithParams(Params{
|
||||
XOffset: offsetX,
|
||||
YOffset: offsetY,
|
||||
BlurRadius: blurRadius,
|
||||
ColorProperty: color,
|
||||
XOffset: offsetX,
|
||||
YOffset: offsetY,
|
||||
BlurRadius: blurRadius,
|
||||
ColorTag: color,
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -90,7 +90,7 @@ func NewShadowWithParams(params Params) ViewShadow {
|
|||
shadow := new(viewShadowData)
|
||||
shadow.propertyList.init()
|
||||
if params != nil {
|
||||
for _, tag := range []string{ColorProperty, Inset, XOffset, YOffset, BlurRadius, SpreadRadius} {
|
||||
for _, tag := range []string{ColorTag, Inset, XOffset, YOffset, BlurRadius, SpreadRadius} {
|
||||
if value, ok := params[tag]; ok && value != nil {
|
||||
shadow.Set(tag, value)
|
||||
}
|
||||
|
@ -119,7 +119,7 @@ func (shadow *viewShadowData) Set(tag string, value interface{}) bool {
|
|||
|
||||
tag = strings.ToLower(tag)
|
||||
switch tag {
|
||||
case ColorProperty, Inset, XOffset, YOffset, BlurRadius, SpreadRadius:
|
||||
case ColorTag, Inset, XOffset, YOffset, BlurRadius, SpreadRadius:
|
||||
return shadow.propertyList.Set(tag, value)
|
||||
}
|
||||
|
||||
|
@ -132,7 +132,7 @@ func (shadow *viewShadowData) Get(tag string) interface{} {
|
|||
}
|
||||
|
||||
func (shadow *viewShadowData) cssStyle(buffer *strings.Builder, session Session, lead string) bool {
|
||||
color, _ := colorProperty(shadow, ColorProperty, session)
|
||||
color, _ := colorProperty(shadow, ColorTag, session)
|
||||
offsetX, _ := sizeProperty(shadow, XOffset, session)
|
||||
offsetY, _ := sizeProperty(shadow, YOffset, session)
|
||||
blurRadius, _ := sizeProperty(shadow, BlurRadius, session)
|
||||
|
@ -164,7 +164,7 @@ func (shadow *viewShadowData) cssStyle(buffer *strings.Builder, session Session,
|
|||
}
|
||||
|
||||
func (shadow *viewShadowData) cssTextStyle(buffer *strings.Builder, session Session, lead string) bool {
|
||||
color, _ := colorProperty(shadow, ColorProperty, session)
|
||||
color, _ := colorProperty(shadow, ColorTag, session)
|
||||
offsetX, _ := sizeProperty(shadow, XOffset, session)
|
||||
offsetY, _ := sizeProperty(shadow, YOffset, session)
|
||||
blurRadius, _ := sizeProperty(shadow, BlurRadius, session)
|
||||
|
@ -188,7 +188,7 @@ func (shadow *viewShadowData) cssTextStyle(buffer *strings.Builder, session Sess
|
|||
}
|
||||
|
||||
func (shadow *viewShadowData) visible(session Session) bool {
|
||||
color, _ := colorProperty(shadow, ColorProperty, session)
|
||||
color, _ := colorProperty(shadow, ColorTag, session)
|
||||
offsetX, _ := sizeProperty(shadow, XOffset, session)
|
||||
offsetY, _ := sizeProperty(shadow, YOffset, session)
|
||||
blurRadius, _ := sizeProperty(shadow, BlurRadius, session)
|
||||
|
|
Loading…
Reference in New Issue