summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibGUI/Label.cpp
AgeCommit message (Collapse)Author
2022-04-04LibGUI: Add optional autosize paddingMatthew Olsson
2022-04-01Everywhere: Run clang-formatIdan Horowitz
2022-03-12Libraries: Use default constructors/destructors in LibGUILenny Maiorani
https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#cother-other-default-operation-rules "The compiler is more likely to get the default semantics right and you cannot implement these functions better than the compiler."
2022-03-05Base+LibGUI+LibGfx: Improve disabled text readabilityJaime Valenzuela Durán
Currently, disabled text colors are hardcoded. They look good in Default and light themes, but no so good in dark ones. This PR adds new variables for all themes to correctly display disabled text.
2022-01-29LibGUI: Allow Label icons to be set from GMLDylan Katz
This is similar to dd17df76e9d02b2969b1c4771134a30a4a844e31, which did the same thing for the Button widget.
2021-08-01LibGUI: Remove unused header includesBrian Gianforcaro
2021-07-29LibGUI: Do not wrap text in statusbar segmentssin-ack
This commit adds a new property to Label which allows one to enable or disable text wrapping. Statusbar now uses this property to disable text wrapping in its segments, since text wrapping in statusbars doesn't make sense.
2021-07-28LibGUI: Make Label padding work with left/right aligned textAndreas Kling
The previous text_rect() algorithm only produced the right result for horizontally centered labels. This adds some missing padding to GUI::Statusbar which we've apparently needed for some time. :^)
2021-07-27Userland: Make TextWrapping::Wrap opt-insin-ack
This was breaking many places which didn't expect text to wrap. Now, the only place where text currently wraps is in GUI::Label.
2021-07-26Userland: Move text wrapping/elision into the new TextLayout :^)sin-ack
This class now contains all the fun bits about laying out text in a rect. It will handle line wrapping at a certain width, cutting off lines that don't fit the given rect, and handling text elision. Painter::draw_text now internally uses this. Future work here would be not laying out text twice (once actually preparing the lines to be rendered and once to get the bounding box), and possibly adding left elision if necessary. Additionally, this commit makes the Utf32View versions of Painter::draw_text convert to Utf8View internally. The intention is to completely remove those versions, but they're kept at the moment to keep the scope of this PR small.
2021-06-09Meta: Disable -Wmaybe-uninitializedAli Mohammad Pur
It's prone to finding "technically uninitialized but can never happen" cases, particularly in Optional<T> and Variant<Ts...>. The general case seems to be that it cannot infer the dependency between Variant's index (or Optional's boolean state) and a particular alternative (or Optional's buffer) being untouched. So it can flag cases like this: ```c++ if (index == StaticIndexForF) new (new_buffer) F(move(*bit_cast<F*>(old_buffer))); ``` The code in that branch can _technically_ make a partially initialized `F`, but that path can never be taken since the buffer holding an object of type `F` and the condition being true are correlated, and so will never be taken _unless_ the buffer holds an object of type `F`. This commit also removed the various 'diagnostic ignored' pragmas used to work around this warning, as they no longer do anything.
2021-05-02LibGfx: Unify Rect, Point, and SizeMatthew Olsson
This commit unifies methods and method/param names between the above classes, as well as adds [[nodiscard]] and ALWAYS_INLINE where appropriate. It also renamed the various move_by methods to translate_by, as that more closely matches the transformation terminology.
2021-04-29Userland: Fix new GCC warningsGunnar Beutner
2021-04-22Everything: Move to SPDX license identifiers in all files.Brian Gianforcaro
SPDX License Identifiers are a more compact / standardized way of representing file license information. See: https://spdx.dev/resources/use/#identifiers This was done with the `ambr` search and replace tool. ambr --no-parent-ignore --key-from-file --rep-from-file key.txt rep.txt *
2021-03-02LibGUI: Add word wrapping to Labelsthankyouverycool
Adds basic word wrap support to Label widgets. Doesn't yet negotiate autosize or Center/Bottom TextAlignments perfectly.
2021-01-12Libraries: Move to Userland/Libraries/Andreas Kling