-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(obj): allow to omit the nil parent
Check if the first parameter is table, if so, the parent must be nil and default root is used. This allows us to create object on screen easier. Signed-off-by: Xu Xingliang <xuxingliang@xiaomi.com>
- Loading branch information
Showing
16 changed files
with
38 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,18 @@ | ||
local label1 = lvgl.Label(nil, { | ||
local label1 = lvgl.Label { | ||
x = 0, y = 0, | ||
text_font = lvgl.Font("montserrat", 32, "normal"), | ||
text = "Hello Font", | ||
align = lvgl.ALIGN.CENTER | ||
}) | ||
} | ||
|
||
print("label1: ", label1) | ||
|
||
lvgl.Label(nil, { | ||
lvgl.Label { | ||
-- x= 0, y = 0, | ||
-- text_font = lvgl.Font("MiSansW medium, montserrat", 24), | ||
text_font = lvgl.BUILTIN_FONT.MONTSERRAT_22, | ||
text = "Hello Font2", | ||
}):align_to({ | ||
}:align_to({ | ||
type = lvgl.ALIGN.OUT_BOTTOM_LEFT, | ||
base = label1, | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,13 @@ | ||
local roller = lvgl.Roller(nil, { | ||
local roller = lvgl.Roller { | ||
options = { | ||
options = "January\nFebruary\nMarch\nApril\nMay\nJune\nJuly\nAugust\nSeptember\nOctober\nNovember\nDecember", | ||
mode = lvgl.ROLLER_MODE.INFINITE, | ||
}, | ||
visible_cnt = 4, | ||
align = lvgl.ALIGN.CENTER | ||
}) | ||
} | ||
|
||
print("create roller:", roller) | ||
roller:onevent(lvgl.EVENT.VALUE_CHANGED, function (obj, code) | ||
print(obj:get_selected_str()) | ||
end) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters