docs: fix links, add references, rename files (#5138)

This commit is contained in:
PGNetHun
2024-01-04 07:25:13 +01:00
committed by GitHub
parent 6136bd6cd0
commit 2a129562d8
94 changed files with 1441 additions and 837 deletions

View File

@@ -1,3 +1,6 @@
.. _lv_label:
================
Label (lv_label)
================
@@ -6,6 +9,8 @@ Overview
A label is the basic object type that is used to display text.
.. _lv_label_parts_and_styles:
Parts and Styles
****************
@@ -18,6 +23,8 @@ Parts and Styles
text <#text-selection>`__. Only ``text_color`` and ``bg_color`` style
properties can be used.
.. _lv_label_usage:
Usage
*****
@@ -42,6 +49,8 @@ safe to use with :cpp:func:`lv_label_set_text_static` (except when used with
:cpp:enumerator:`LV_LABEL_LONG_DOT`, as it modifies the buffer in-place), as they are
stored in ROM memory, which is always accessible.
.. _lv_label_newline:
Newline
-------
@@ -49,6 +58,8 @@ Newline characters are handled automatically by the label object. You
can use ``\n`` to make a line break. For example:
``"line1\nline2\n\nline4"``
.. _lv_label_long_modes:
Long modes
----------
@@ -79,12 +90,7 @@ this implementation detail is unnoticed. This is not the case with
:cpp:func:`lv_label_set_text_static` must be writable if you plan to use
:cpp:enumerator:`LV_LABEL_LONG_DOT`.
Text recolor
------------
In the text, you can use commands to recolor parts of the text. For
example: ``"Write a #ff0000 red# word"``. This feature can be enabled
individually for each label by :cpp:func:`lv_label_set_recolor` function.
.. _lv_label_text_selection:
Text selection
--------------
@@ -92,22 +98,25 @@ Text selection
If enabled by :c:macro:`LV_LABEL_TEXT_SELECTION` part of the text can be
selected. It's similar to when you use your mouse on a PC to select a
text. The whole mechanism (click and select the text as you drag your
finger/mouse) is implemented in `Text area </widgets/textarea>`__ and
finger/mouse) is implemented in :ref:`Text area <lv_textarea>` and
the Label widget only allows manual text selection with
:cpp:expr:`lv_label_get_text_selection_start(label, start_char_index)` and
:cpp:expr:`lv_label_get_text_selection_start(label, end_char_index)`.
.. _lv_label_text_alignment:
Text alignment
--------------
To horizontally align the lines of a label the `text_align` style property can be used with
:cpp:expr:`lv_obj_set_style_text_align()` or :cpp:expr:`lv_style_set_text_align()`
:cpp:func:`lv_obj_set_style_text_align` or :cpp:func:`lv_style_set_text_align`
Note that it has a visible effect only if
- the label widget's width is larger than the width of the longest line of the text
- the text has multiple lines with non equal line length
.. _lv_label_very_long_texts:
Very long texts
---------------
@@ -115,6 +124,8 @@ LVGL can efficiently handle very long (e.g. > 40k characters) labels by
saving some extra data (~12 bytes) to speed up drawing. To enable this
feature, set ``LV_LABEL_LONG_TXT_HINT 1`` in ``lv_conf.h``.
.. _lv_label_custom_scrolling_animations:
Custom scrolling animations
---------------------------
@@ -124,21 +135,27 @@ customized by setting the animation property of a style, using
:cpp:func:`lv_style_set_anim`.
It will be treated as a template which will be used to create the scroll animatins.
.. _lv_label_symbols:
Symbols
-------
The labels can display symbols alongside letters (or on their own). Read
the `Font </overview/font>`__ section to learn more about the symbols.
the :ref:`fonts` section to learn more about the symbols.
.. _lv_label_events:
Events
******
No special events are sent by the Label.
See the events of the `Base object </widgets/obj>`__ too.
See the events of the :ref:`Base object <lv_obj>` too.
Learn more about :ref:`events`.
.. _lv_label_keys:
Keys
****
@@ -146,10 +163,14 @@ No *Keys* are processed by the object type.
Learn more about :ref:`indev_keys`.
.. _lv_label_example:
Example
*******
.. include:: ../examples/widgets/label/index.rst
.. _lv_label_api:
API
***