diff --git a/package-lock.json b/package-lock.json index 0d8f2182..c665c665 100644 --- a/package-lock.json +++ b/package-lock.json @@ -30,6 +30,7 @@ "mailparser": "^3.6.9", "roku-deploy": "^3.12.0", "rooibos-roku": "5.10.0", + "rounded-rect-9patch": "^1.0.1", "semver": "^7.6.0", "shelljs": "^0.8.5", "ts-node": "^10.9.2", @@ -369,6 +370,12 @@ "@types/node": "*" } }, + "node_modules/@types/mime-types": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/@types/mime-types/-/mime-types-2.1.4.tgz", + "integrity": "sha512-lfU4b34HOri+kAY5UheuFMWPDOI+OPceBSHZKp69gEyTL/mmJ4cnU6Y/rlme3UL3GyOn6Y42hyIEw0/q8sWx5w==", + "dev": true + }, "node_modules/@types/node": { "version": "20.11.25", "resolved": "https://registry.npmjs.org/@types/node/-/node-20.11.25.tgz", @@ -579,12 +586,27 @@ "node": ">=0.8" } }, + "node_modules/async-limiter": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/async-limiter/-/async-limiter-1.0.1.tgz", + "integrity": "sha512-csOlWGAcRFJaI6m+F2WKdnMKr4HhdhFVBk0H/QbJFMCr+uO2kwohwXQPxw/9OCxp05r5ghVBFSyioixx3gfkNQ==", + "dev": true + }, "node_modules/asynckit": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", "dev": true }, + "node_modules/at-least-node": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/at-least-node/-/at-least-node-1.0.0.tgz", + "integrity": "sha512-+q/t7Ekv1EDY2l6Gda6LLiX14rU9TV20Wa3ofeQmwPFZbOMo9DXrLbOjFaaclkXKWidIaopwAObQDqwWtGUjqg==", + "dev": true, + "engines": { + "node": ">= 4.0.0" + } + }, "node_modules/aws-sign2": { "version": "0.7.0", "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", @@ -1076,6 +1098,12 @@ "node": "*" } }, + "node_modules/buffer-from": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", + "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", + "dev": true + }, "node_modules/bytes": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", @@ -1275,6 +1303,21 @@ "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", "dev": true }, + "node_modules/concat-stream": { + "version": "1.6.2", + "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz", + "integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==", + "dev": true, + "engines": [ + "node >= 0.8" + ], + "dependencies": { + "buffer-from": "^1.0.0", + "inherits": "^2.0.3", + "readable-stream": "^2.2.2", + "typedarray": "^0.0.6" + } + }, "node_modules/content-disposition": { "version": "0.5.4", "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.4.tgz", @@ -2376,6 +2419,36 @@ "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", "dev": true }, + "node_modules/handlebars": { + "version": "4.7.8", + "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.7.8.tgz", + "integrity": "sha512-vafaFqs8MZkRrSX7sFVUdo3ap/eNiLnb4IakshzvP56X5Nr1iGKAIqdX6tMlm6HcNRIkr6AxO5jFEoJzzpT8aQ==", + "dev": true, + "dependencies": { + "minimist": "^1.2.5", + "neo-async": "^2.6.2", + "source-map": "^0.6.1", + "wordwrap": "^1.0.0" + }, + "bin": { + "handlebars": "bin/handlebars" + }, + "engines": { + "node": ">=0.4.7" + }, + "optionalDependencies": { + "uglify-js": "^3.1.4" + } + }, + "node_modules/handlebars/node_modules/source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/har-schema": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", @@ -3176,6 +3249,27 @@ "node": "*" } }, + "node_modules/minimist": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", + "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/mkdirp": { + "version": "0.5.6", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz", + "integrity": "sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==", + "dev": true, + "dependencies": { + "minimist": "^1.2.6" + }, + "bin": { + "mkdirp": "bin/cmd.js" + } + }, "node_modules/mkdirp-classic": { "version": "0.5.3", "resolved": "https://registry.npmjs.org/mkdirp-classic/-/mkdirp-classic-0.5.3.tgz", @@ -3206,6 +3300,12 @@ "node": ">= 0.6" } }, + "node_modules/neo-async": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz", + "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==", + "dev": true + }, "node_modules/node-fetch": { "version": "2.6.12", "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.12.tgz", @@ -3226,6 +3326,167 @@ } } }, + "node_modules/node-html-to-image": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/node-html-to-image/-/node-html-to-image-1.2.0.tgz", + "integrity": "sha512-Z+YvvY2PSc9xULWd2NtqfO4x9rNzEiNOjA1QjOdB/BShVA7ULMJ3YKaFbn0wVuFqYJ6WSaY7ruw9frcJpXQNVQ==", + "dev": true, + "dependencies": { + "handlebars": "^4.5.3", + "puppeteer": "^2.0.0" + } + }, + "node_modules/node-html-to-image/node_modules/agent-base": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-5.1.1.tgz", + "integrity": "sha512-TMeqbNl2fMW0nMjTEPOwe3J/PRFP4vqeoNuQMG0HlMrtm5QxKqdvAkZ1pRBQ/ulIyDD5Yq0nJ7YbdD8ey0TO3g==", + "dev": true, + "engines": { + "node": ">= 6.0.0" + } + }, + "node_modules/node-html-to-image/node_modules/debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "dev": true, + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/node-html-to-image/node_modules/extract-zip": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/extract-zip/-/extract-zip-1.7.0.tgz", + "integrity": "sha512-xoh5G1W/PB0/27lXgMQyIhP5DSY/LhoCsOyZgb+6iMmRtCwVBo55uKaMoEYrDCKQhWvqEip5ZPKAc6eFNyf/MA==", + "dev": true, + "dependencies": { + "concat-stream": "^1.6.2", + "debug": "^2.6.9", + "mkdirp": "^0.5.4", + "yauzl": "^2.10.0" + }, + "bin": { + "extract-zip": "cli.js" + } + }, + "node_modules/node-html-to-image/node_modules/extract-zip/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/node-html-to-image/node_modules/extract-zip/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", + "dev": true + }, + "node_modules/node-html-to-image/node_modules/glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "dev": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/node-html-to-image/node_modules/https-proxy-agent": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-4.0.0.tgz", + "integrity": "sha512-zoDhWrkR3of1l9QAL8/scJZyLu8j/gBkcwcaQOZh7Gyh/+uJQzGVETdgT30akuwkpL8HTRfssqI3BZuV18teDg==", + "dev": true, + "dependencies": { + "agent-base": "5", + "debug": "4" + }, + "engines": { + "node": ">= 6.0.0" + } + }, + "node_modules/node-html-to-image/node_modules/mime": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/mime/-/mime-2.6.0.tgz", + "integrity": "sha512-USPkMeET31rOMiarsBNIHZKLGgvKc/LrjofAnBlOttf5ajRvqiRA8QsenbcooctK6d6Ts6aqZXBA+XbkKthiQg==", + "dev": true, + "bin": { + "mime": "cli.js" + }, + "engines": { + "node": ">=4.0.0" + } + }, + "node_modules/node-html-to-image/node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + }, + "node_modules/node-html-to-image/node_modules/puppeteer": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/puppeteer/-/puppeteer-2.1.1.tgz", + "integrity": "sha512-LWzaDVQkk1EPiuYeTOj+CZRIjda4k2s5w4MK4xoH2+kgWV/SDlkYHmxatDdtYrciHUKSXTsGgPgPP8ILVdBsxg==", + "deprecated": "< 21.5.0 is no longer supported", + "dev": true, + "hasInstallScript": true, + "dependencies": { + "@types/mime-types": "^2.1.0", + "debug": "^4.1.0", + "extract-zip": "^1.6.6", + "https-proxy-agent": "^4.0.0", + "mime": "^2.0.3", + "mime-types": "^2.1.25", + "progress": "^2.0.1", + "proxy-from-env": "^1.0.0", + "rimraf": "^2.6.1", + "ws": "^6.1.0" + }, + "engines": { + "node": ">=8.16.0" + } + }, + "node_modules/node-html-to-image/node_modules/rimraf": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", + "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", + "dev": true, + "dependencies": { + "glob": "^7.1.3" + }, + "bin": { + "rimraf": "bin.js" + } + }, + "node_modules/node-html-to-image/node_modules/ws": { + "version": "6.2.2", + "resolved": "https://registry.npmjs.org/ws/-/ws-6.2.2.tgz", + "integrity": "sha512-zmhltoSR8u1cnDsD43TX59mzoMZsLKqUweyYBAIvTngR3shc0W6aOZylZmq/7hqyVxPdi+5Ud2QInblgyE72fw==", + "dev": true, + "dependencies": { + "async-limiter": "~1.0.0" + } + }, "node_modules/nodemailer": { "version": "6.9.11", "resolved": "https://registry.npmjs.org/nodemailer/-/nodemailer-6.9.11.tgz", @@ -4069,6 +4330,35 @@ "integrity": "sha512-+a9MPUQrNGRrGU630OGbYVQ+11iOIovjCkqxajPa9w57Sd5ruK8WQNsslzpa0x/QJqC8kRc2DUxWjIFwoNm4ZQ==", "dev": true }, + "node_modules/rounded-rect-9patch": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/rounded-rect-9patch/-/rounded-rect-9patch-1.0.1.tgz", + "integrity": "sha512-5sNv0pg8+QRd9DgnzD7alGJt/9UnJs+5xv4dLAT6CKfT6h4WMcGcyTIWoRuJminJ3T/4yo7tFwnJ8cOPGiBWMw==", + "dev": true, + "dependencies": { + "fs-extra": "^9.0.0", + "minimist": "^1.2.5", + "node-html-to-image": "^1.2.0" + }, + "bin": { + "rounded-rect-9patch": "cli.js" + } + }, + "node_modules/rounded-rect-9patch/node_modules/fs-extra": { + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.1.0.tgz", + "integrity": "sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ==", + "dev": true, + "dependencies": { + "at-least-node": "^1.0.0", + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^2.0.0" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/run-parallel": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", @@ -4646,6 +4936,12 @@ "node": ">= 0.6" } }, + "node_modules/typedarray": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", + "integrity": "sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA==", + "dev": true + }, "node_modules/typescript": { "version": "5.4.2", "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.4.2.tgz", @@ -4665,6 +4961,19 @@ "integrity": "sha512-DffL94LsNOccVn4hyfRe5rdKa273swqeA5DJpMOeFmEn1wCDc7nAbbB0gXlgBCL7TNzeTv6G7XVWzan7iJtfig==", "dev": true }, + "node_modules/uglify-js": { + "version": "3.17.4", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.17.4.tgz", + "integrity": "sha512-T9q82TJI9e/C1TAxYvfb16xO120tMVFZrGA3f9/P4424DNu6ypK103y0GPFVa17yotwSyZW5iYXgjYHkGrJW/g==", + "dev": true, + "optional": true, + "bin": { + "uglifyjs": "bin/uglifyjs" + }, + "engines": { + "node": ">=0.8.0" + } + }, "node_modules/unbzip2-stream": { "version": "1.4.3", "resolved": "https://registry.npmjs.org/unbzip2-stream/-/unbzip2-stream-1.4.3.tgz", @@ -4887,6 +5196,12 @@ "integrity": "sha512-iBdZ57RDvnOR9AGBhML2vFZf7h8vmBjhoaZqODJBFWHVtKkDmKuHai3cx5PgVMrX5YDNp27AofYbAwctSS+vhQ==", "dev": true }, + "node_modules/wordwrap": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", + "integrity": "sha512-gvVzJFlPycKc5dZN4yPkP8w7Dc37BtP1yczEneOb4uq34pXZcvrtRTmWV8W+Ume+XCxKgbjM+nevkyFPMybd4Q==", + "dev": true + }, "node_modules/wrap-ansi": { "version": "6.2.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", diff --git a/package.json b/package.json index 50397957..b836ed29 100644 --- a/package.json +++ b/package.json @@ -24,6 +24,7 @@ "mailparser": "^3.6.9", "roku-deploy": "^3.12.0", "rooibos-roku": "5.10.0", + "rounded-rect-9patch": "^1.0.1", "semver": "^7.6.0", "shelljs": "^0.8.5", "ts-node": "^10.9.2", diff --git a/playlet-lib/src/components/ButtonEx/ButtonEx.bs b/playlet-lib/src/components/ButtonEx/ButtonEx.bs new file mode 100644 index 00000000..099084f6 --- /dev/null +++ b/playlet-lib/src/components/ButtonEx/ButtonEx.bs @@ -0,0 +1,147 @@ +import "pkg:/source/utils/MathUtils.bs" +import "pkg:/source/utils/Types.bs" + +function Init() + m.backgroundNode = m.top.findNode("background") + m.labelNode = m.top.findNode("label") + m.iconNode = m.top.findNode("icon") + m.anchorNode = m.top.findNode("anchor") + m.focusAnimation = m.top.findNode("focusAnimation") + m.normalFont = m.top.findNode("normalFont") + m.boldFont = m.top.findNode("boldFont") + + DoLayout() + OnDisabledChange() + m.top.observeField("focusedChild", FuncName(OnFocusedChild)) +end function + +function DoLayout() as void + minWidth = m.top.minWidth + height = m.top.height + padding = m.top.padding + textVisible = m.top.textVisible + iconVisible = m.top.iconVisible + + if not textVisible and not iconVisible + m.top.width = minWidth + return + end if + + contentWidth = 0 + iconWidth = 0 + iconHeight = 0 + textWidth = 0 + textHeight = 0 + iconTextSpacing = 0 + + if iconVisible + iconWidth = m.top.iconWidth + iconHeight = m.top.iconHeight + contentWidth += iconWidth + end if + + if textVisible + labelRect = m.labelNode.boundingRect() + textWidth = labelRect.width + textHeight = labelRect.height + contentWidth += textWidth + end if + + if iconVisible and textVisible + iconTextSpacing = m.top.iconTextSpacing + contentWidth += iconTextSpacing + end if + + contentWidth += padding[0] + padding[1] + + width = MathUtils.Max(contentWidth, minWidth) + m.top.width = width + + if iconVisible + x = (width - contentWidth) / 2 + padding[0] + y = (height - iconHeight) / 2 + m.iconNode.translation = [x, y] + end if + + if textVisible + x = (width - contentWidth) / 2 + padding[0] + iconWidth + iconTextSpacing + y = (height - textHeight) / 2 + m.labelNode.translation = [x, y] + end if + + OnAnchorChange() +end function + +function OnAnchorChange() + width = m.top.width + height = m.top.height + anchor = m.top.anchor + + m.anchorNode.translation = [-width * anchor[0], -height * anchor[1]] +end function + +function OnDisabledChange() + disabled = m.top.disabled + + if disabled + if m.top.textVisible + m.labelNode.color = m.top.disabledTextColor + m.labelNode.font = m.normalFont + end if + if m.top.iconVisible + m.iconNode.blendColor = m.top.disabledIconColor + end if + m.backgroundNode.blendColor = m.top.disabledBackgroundColor + else + OnButtonFocused() + end if + m.top.focusable = not disabled +end function + +function OnFocusedChild() + m.top.buttonFocused = m.top.hasFocus() +end function + +function OnButtonFocused() + buttonFocused = m.top.buttonFocused + textVisible = m.top.textVisible + iconVisible = m.top.iconVisible + + if buttonFocused + if textVisible + m.labelNode.color = m.top.focusedTextColor + m.labelNode.font = m.boldFont + end if + if iconVisible + m.iconNode.blendColor = m.top.focusedIconColor + end if + m.backgroundNode.blendColor = m.top.focusedBackgroundColor + + m.focusAnimation.control = "start" + else + if textVisible + m.labelNode.color = m.top.textColor + m.labelNode.font = m.normalFont + end if + if iconVisible + m.iconNode.blendColor = m.top.iconColor + end if + m.backgroundNode.blendColor = m.top.backgroundColor + end if +end function + +function OnkeyEvent(key as string, press as boolean) as boolean + if not press + return false + end if + + if key = "OK" + disabled = m.top.disabled + if not disabled + m.top.buttonSelected = true + end if + return true + end if + + return false +end function diff --git a/playlet-lib/src/components/ButtonEx/ButtonEx.xml b/playlet-lib/src/components/ButtonEx/ButtonEx.xml new file mode 100644 index 00000000..c56e5eb9 --- /dev/null +++ b/playlet-lib/src/components/ButtonEx/ButtonEx.xml @@ -0,0 +1,60 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/playlet-lib/src/components/ChannelView/ChannelView.bs b/playlet-lib/src/components/ChannelView/ChannelView.bs index 229a9a3b..c285f03b 100644 --- a/playlet-lib/src/components/ChannelView/ChannelView.bs +++ b/playlet-lib/src/components/ChannelView/ChannelView.bs @@ -288,10 +288,10 @@ function OnAuthorIdChange() end function function SetSubscribeButtonVisibility() - isLogged = IsLoggedIn() - m.subscribeButton.visible = isLogged and not StringUtils.IsNullOrEmpty(m.top.authorId) - m.subscribeButton.focusable = m.subscribeButton.visible - if not m.subscribeButton.visible and m.subscribeButton.hasFocus() + isEnabled = IsLoggedIn() and not StringUtils.IsNullOrEmpty(m.top.authorId) + m.subscribeButton.visible = isEnabled + m.subscribeButton.focusable = isEnabled + if not isEnabled and m.subscribeButton.hasFocus() NodeSetFocus(m.rowList, true) end if end function diff --git a/playlet-lib/src/components/ChannelView/ChannelView.xml b/playlet-lib/src/components/ChannelView/ChannelView.xml index 702373ba..c29803c4 100644 --- a/playlet-lib/src/components/ChannelView/ChannelView.xml +++ b/playlet-lib/src/components/ChannelView/ChannelView.xml @@ -43,13 +43,12 @@ font="font:SmallestSystemFont" /> - + anchor="[0,0.5]" + padding="[30,30]" + text="Filters" /> - - \ No newline at end of file diff --git a/playlet-lib/src/images/icons/filters-black.svg.meta.json5 b/playlet-lib/src/images/icons/filters-black.svg.meta.json5 deleted file mode 100644 index 6cfea6e9..00000000 --- a/playlet-lib/src/images/icons/filters-black.svg.meta.json5 +++ /dev/null @@ -1,11 +0,0 @@ -{ - inputHash: 'ed4c9f819d239f42552388b35703d49d', - outputs: [ - { - outputFilePath: 'images/icons/filters-black.png', - outputHash: 'b468f7bd2996a1c1f0acbfdc6512b1a5', - width: 64, - height: 64, - }, - ], -} \ No newline at end of file