Comments (7)
Pinging my colleague @clydebarrow
from lvgl.
Szia Robi! 🙂
It has no effect because the columns has fr(1)
width. Due to this they fill the whole width of the parent and they cannot be aligned at all as there is no space to move them.
You can either
- Not fill the whole width:
static const lv_coord_t page_1_column_dsc[] = {150, 150, LV_GRID_TEMPLATE_LAST};
- Align the cell in the column:
lv_obj_set_style_grid_cell_x_align(cell_1_1, LV_GRID_ALIGN_CENTER, 0);
from lvgl.
Szia!
As we understand from the doc, the whole width of the parent should be treated as fr(1)
+ fr(1)
, that means, if eg. the parent is 200px wide, the grid columns (thus cells) widths should each result to 100px. So fr(1)
+ fr(1)
is whole width of the parent, a single fr(1)
should be half width of parent.
Now if I place smaller children within these cells, I should still be able to commonly set an alignment for them.
So 1. - that's the whole point of fr(xx)
stuff, to not specify discrete widths, but calculate them on the run, 2. - individual alignments of course work for each cell, but that defeats the purpose of the single line grid_column_align
.
If it's possible to do it with grid_cell_x_align
for each cell one by one, common sense implies that grid_column_align
should do the same for all the cells. Like a better name for grid_column_x_align
would be.
from lvgl.
from lvgl.
Aligning the column and the content are two independent things. Imagine a single 100 px wide column. You can align this column to the left, center or right, and separately set where to place the cells in it.
I understand that having something like justify-items
in CSS might make sense in LVGL too. By default the cell's alignment could be auto
so the parent's justify-items
is applied however it can be overwritten individually in each cell.
from lvgl.
Well if you have two 100px columns near each other, filling a total of 200px, their alignment doesn't make sense. They will be in the same position regardless the alignment...
I understand that having something like justify-items in CSS might make sense in LVGL too. By default the cell's alignment could be auto so the parent's justify-items is applied however it can be overwritten individually in each cell.
That would be more intuitive, yes.
Please backport it to v8...
from lvgl.
Well if you have two 100px columns near each other, filling a total of 200px, their alignment doesn't make sense. They will be in the same position regardless the alignment...
Yep, that's why I mentioned a single column in my example above.
That would be more intuitive, yes.
Are you interested in contributing with this feature?
from lvgl.
Related Issues (20)
- More color depths HOT 3
- 9.1 Input Device Documentation HOT 6
- macOS buiold failure
- LVGL Integration strategy for Zephyr HOT 5
- Better sync between LVGL and Zephyr for runtime hw rotation HOT 2
- Animation and keyboard input conflict
- Setting system time under Linux affects ticks HOT 3
- screen refresh rate is very low HOT 5
- Problem with lv_demo_widgets demo(Instrument panel) after porting code to hardware HOT 1
- Button Matrix cannot be removed from lv_conf.h HOT 1
- Tiny TTF causes crash in certain situations HOT 1
- Tiny TTF should be caching stbtt_FindGlyphIndex HOT 26
- Line 11 of src/libs/tiny_ttf.c declared incorrectly HOT 4
- Docs build break HOT 1
- 8.4/9.1 Hardware based display rotation input devices HOT 6
- LV_COLOR_16_SWAP removal and performance HOT 2
- About the Release Date of New Versions HOT 2
- Slider Indicator Bigger Image Replacement on Press Event HOT 1
- "Does the lv_fs_dir_open function support opening directories with Chinese paths?" HOT 2
- ESP32 SPIFFS HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lvgl.