From c3d583d839d10c4a665fae03b6b14ae394f399a6 Mon Sep 17 00:00:00 2001 From: tourahi Date: Tue, 9 Jan 2024 00:18:10 +0100 Subject: [PATCH] RM --- Controls/TextInput.moon | 6 ++-- Controls/themes/blues.moon | 4 +-- README.md | 73 ++++++++++++++++++++++++++++++++++++-- changelog.txt | 13 +++++++ 4 files changed, 89 insertions(+), 7 deletions(-) diff --git a/Controls/TextInput.moon b/Controls/TextInput.moon index e253cfc..999e088 100644 --- a/Controls/TextInput.moon +++ b/Controls/TextInput.moon @@ -32,8 +32,8 @@ class TextInput extends Control @stroke = common.stroke @rx = style.rx @ry = style.ry - @brx = 0 - @bry = 0 + @brx = style.rx + @bry = style.ry @keyDown = "none" @limit = 0 @@ -419,6 +419,7 @@ class TextInput extends Control r, g, b, a = Graphics.getColor! color = colors.gray color[4] = color[4] or @alpha + Graphics.setLineStyle "smooth" Graphics.setColor color Graphics.rectangle "fill", bg.x - @stroke, bg.y - @stroke, @getWidth! + @stroke*2, @getHeight! + @stroke*2, @brx, @bry Graphics.setColor r, g, b, a @@ -426,6 +427,7 @@ class TextInput extends Control drawTextBox: => bg = @getBoundingBox! r, g, b, a = Graphics.getColor! + Graphics.setLineStyle "smooth" Graphics.setColor colors.white Graphics.rectangle "fill", bg.x, bg.y, @getWidth!, @getHeight!, @rx, @ry diff --git a/Controls/themes/blues.moon b/Controls/themes/blues.moon index 9d2178b..0564d7b 100644 --- a/Controls/themes/blues.moon +++ b/Controls/themes/blues.moon @@ -49,8 +49,8 @@ Default = textField: - rx: 5 - ry: 5 + rx: 15 + ry: 15 marginCorner: 18 textAreaColor: { 0.0392156862745, 0.0392156862745, 0.0392156862745 } textColor: { 1, 1, 1 } diff --git a/README.md b/README.md index 5b9e7ef..8a0c60f 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,73 @@ -# MeowUI +# **MeowUI** - ### README is currently being rewritten. +[LÖVE](https://love2d.org/) GUI library written in MoonScript. -* see : https://github.com/Tourahi/MeowUI-Demo +Inspired by [CatUI](https://github.com/wilhantian/catui), but the core modules were heavily modified. Some inspiration was also taken from [LoveFrames](https://github.com/linux-man/LoveFrames). + +Currently based on LÖVE 11.4 MoonScript 0.5 + +### Demo + +​ See : https://github.com/Tourahi/MeowUI-Demo + +​ How to make a control . + +**Third-party** + +​ utf8.lua : https://github.com/Stepets/utf8.lua + +# **Hello, World!** + +```lua +-- Always require MeowUI before any control +assert require "MeowUI" +-- Include a control. +-- (You can expand your own controls based on your needs. See controls for examples) +Button = assert require MeowUI.c_cwd .. "Button" + +with love + .load = -> + -- Get the manager (Takes care of all events). + export manager = MeowUI.manager + -- Get the root control. + root = manager\getRoot! + + -- And lets make a fansy polygon shaped button. + bPoly = with Button "Polygon" + \setPosition 200, 200 + \setRadius 25 + \setSides 6 + + -- Finally add the new button as a child to the root so it can be drawn updated etc... + root\addChild frame + + .update = (dt) -> + manager\update dt + + .draw = -> + manager\draw! + + .mousepressed = (x, y, button) -> + manager\mousepressed x, y, button + + .keypressed = (key, is_r) -> + manager\keypressed key, is_r + + .mousemoved = (x, y, dx, dy, istouch ) -> + manager\mousemoved x, y, dx, dy, istouch + + .mousereleased = (x, y, dx, dy, istouch ) -> + manager\mousereleased x, y, dx, dy, istouch + + .wheelmoved = (x, y) -> + manager\wheelmoved x, y + + .keyreleased = (key) -> + manager\keyreleased key + + .textinput = (text) -> + manager\textinput text + + +``` diff --git a/changelog.txt b/changelog.txt index 3de5887..78771ff 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,6 +1,19 @@ [Logs for changes done on CORE modules] +================================================ +Version 11.4 - Alpha (December 18 - 2023) +================================================ +[FIXED][Manager][Control] + * issue : When we notify the parent that teh child has dispatched an event we dispatch the parent event also + and that caused some problems. For example when the child is Focused the parent dispatch the same event + since it gets notifyed and it becomes the focused ctrl instead of the child. + * solution : + ALPHA -> commit: 77f0c70d1ea9396bc7b55596f5c4e729d99c8e3a + STILL NEEDS TESTS. + + + ================================================ Version 11.4 - Alpha (November 26 - 2023) ================================================