diff --git a/CHANGELOG.md b/CHANGELOG.md index aa92d48..dbcd036 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ * Added "user-data" property * Added "focusable" property -* Added ReloadTableViewData function +* Added ReloadTableViewData, AllImageResources functions # v0.5.0 diff --git a/app_styles.css b/app_styles.css index 8d65893..2dc290d 100644 --- a/app_styles.css +++ b/app_styles.css @@ -15,11 +15,11 @@ div { -ms-user-select: none; user-select: none; } - +/* div:focus { outline: none; } - +*/ input { margin: 2px; padding: 1px; diff --git a/defaultTheme.rui b/defaultTheme.rui index 23f719f..28a6e4f 100644 --- a/defaultTheme.rui +++ b/defaultTheme.rui @@ -1,13 +1,13 @@ theme { colors = _{ ruiTextColor = #FF000000, - ruiDisabledTextColor = #FF202020, + ruiDisabledTextColor = #FF808080, ruiBackgroundColor = #FFFFFFFF, ruiButtonColor = #FFE0E0E0, ruiButtonActiveColor = #FFC0C0C0, ruiButtonTextColor = #FF000000, ruiButtonDisabledColor = #FFE0E0E0, - ruiButtonDisabledTextColor = #FF202020, + ruiButtonDisabledTextColor = #FF808080, ruiHighlightColor = #FF1A74E8, ruiHighlightTextColor = #FFFFFFFF, ruiSelectedColor = #FFE0E0E0, @@ -19,7 +19,7 @@ theme { ruiTabBarBackgroundColor = #FFEEEEEE, ruiTabColor = #FFD0D0D0, - ruiTabTextColor = #FF202020, + ruiTabTextColor = #FF808080, ruiCurrentTabColor = #FFFFFFFF, ruiCurrentTabTextColor = #FF000000, }, diff --git a/editView.go b/editView.go index 8c9bd19..63b15d9 100644 --- a/editView.go +++ b/editView.go @@ -489,21 +489,21 @@ func (edit *editViewData) htmlProperties(self View, buffer *strings.Builder) { if hint := GetHint(edit, ""); hint != "" { buffer.WriteString(` placeholder="`) - buffer.WriteString(hint) + buffer.WriteString(textToJS(hint)) buffer.WriteByte('"') } buffer.WriteString(` oninput="editViewInputEvent(this)"`) if pattern := GetEditViewPattern(edit, ""); pattern != "" { buffer.WriteString(` pattern="`) - buffer.WriteString(pattern) + buffer.WriteString(textToJS(pattern)) buffer.WriteByte('"') } if editType != MultiLineText { if text := GetText(edit, ""); text != "" { buffer.WriteString(` value="`) - buffer.WriteString(text) + buffer.WriteString(textToJS(text)) buffer.WriteByte('"') } } @@ -518,10 +518,7 @@ func (edit *editViewData) htmlDisabledProperties(self View, buffer *strings.Buil func (edit *editViewData) htmlSubviews(self View, buffer *strings.Builder) { if GetEditViewType(edit, "") == MultiLineText { - text := strings.ReplaceAll(GetText(edit, ""), `"`, `\"`) - text = strings.ReplaceAll(text, "\n", `\n`) - text = strings.ReplaceAll(text, "\r", `\r`) - buffer.WriteString(strings.ReplaceAll(text, `'`, `\'`)) + buffer.WriteString(textToJS(GetText(edit, ""))) } } diff --git a/propertySet.go b/propertySet.go index 127571c..e8ff8f0 100644 --- a/propertySet.go +++ b/propertySet.go @@ -70,6 +70,7 @@ var intProperties = []string{ } var floatProperties = map[string]struct{ min, max float64 }{ + Opacity: {min: 0, max: 1}, ScaleX: {min: -math.MaxFloat64, max: math.MaxFloat64}, ScaleY: {min: -math.MaxFloat64, max: math.MaxFloat64}, ScaleZ: {min: -math.MaxFloat64, max: math.MaxFloat64}, diff --git a/resources.go b/resources.go index e4f3ef2..6a68687 100644 --- a/resources.go +++ b/resources.go @@ -416,3 +416,11 @@ func AllRawResources() []string { return result } + +func AllImageResources() []string { + result := make([]string, 0, len(resources.images)) + for image := range resources.images { + result = append(result, image) + } + return result +} diff --git a/view.go b/view.go index e30eeed..a7d1414 100644 --- a/view.go +++ b/view.go @@ -561,6 +561,12 @@ func viewPropertyChanged(view *viewData, tag string) { updateCSSProperty(htmlID, `animation-play-state`, `running`, session) } return + + case ZIndex: + if i, ok := intProperty(view, ZIndex, session, 0); ok { + updateCSSProperty(htmlID, ZIndex, strconv.Itoa(i), session) + } + return } if cssTag, ok := sizeProperties[tag]; ok { @@ -589,7 +595,7 @@ func viewPropertyChanged(view *viewData, tag string) { return } - for _, floatTag := range []string{ScaleX, ScaleY, ScaleZ, RotateX, RotateY, RotateZ} { + for _, floatTag := range []string{Opacity, ScaleX, ScaleY, ScaleZ, RotateX, RotateY, RotateZ} { if tag == floatTag { if f, ok := floatProperty(view, floatTag, session, 0); ok { updateCSSProperty(htmlID, floatTag, strconv.FormatFloat(f, 'g', -1, 64), session)