Skip to content

setStyle component change width and height #32

@pankiwi

Description

@pankiwi

this time gooi is my preferred library for my projects that need gui for android, but something when I read the code of gooi and it is annoying when applying a style to a component like button the width and height are scaled to the text and not the one that one defines look in the function gooi.setStyleComp

  c.w = s.font:getWidth(c.text) + s.font:getHeight() * 2
  c.h = s.font:getHeight() * 2

is good for label but for button set custom width and height without text is annoying

change it

if c.type == "button" or c.type == "label" or c.type == "label" then
        c.w = s.font:getWidth(c.text) + s.font:getHeight() * 2
        c.h = s.font:getHeight() * 2
end

for this

if c.type == "label" or c.type == "label" then
        c.w = s.font:getWidth(c.text) + s.font:getHeight() * 2
        c.h = s.font:getHeight() * 2
end

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions