feat: Widget.ScrollingLabel#46
Open
Bavalionprolate wants to merge 3 commits intoignis-sh:mainfrom
Open
Conversation
linkfrg
requested changes
Nov 24, 2024
Member
There was a problem hiding this comment.
- Use Google style of docstrings, dev docs
- CSS classes will be applied by
Label(BaseWidget) constructor, no need to repeat code - Do not describe
label,wrap,justifyproperties, just indicate that "Bases: :class:~ignis.widgets.Widget.Label", this class will inherit them fromLabelanyway - use mypy and ruff
In general, please read the developer guide
Author
|
Okey, I apologize, I'll be sure to read it and send a pull request with corrections |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ScrollingLabelClassThe
ScrollingLabelclass is a widget for displaying text that automatically scrolls if its length exceeds a specified maximum. It inherits from theLabelclass and adds scrolling functionality with customizable parameters.Key Features:
Parameters:
label: The text to be displayed.max_length: The maximum length of text before scrolling begins (default is 10 characters).scroll_speed: The speed of the scrolling (default is 500 milliseconds).css_classes: A list of CSS classes for styling.justify: The alignment of the text (default is 'left').wrap: Whether to wrap the text (default isTrue).wrap_mode: The text wrapping mode (default is 'word').Important Methods:
_get_display_text: Generates the current text for display, considering scrolling._scroll_text: Updates the scrolling index and updates the displayed text._start_scrolling: Starts a timer to scroll the text._scroll_text_and_continue: Updates the text and continues scrolling.This class is useful for displaying long strings of text, such as news feeds, announcements, etc., where dynamic scrolling of information is needed.