mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 07:47:37 +00:00
Painter: Add text elision support (only right-hand side supported.)
Some window titles didn't fit on the taskbar buttons, so I needed a way to collapse the remaining part of the text into "..."
This commit is contained in:
parent
ce7341be87
commit
4533539e8a
5 changed files with 56 additions and 15 deletions
|
@ -5,6 +5,7 @@
|
|||
#include "Rect.h"
|
||||
#include "Size.h"
|
||||
#include <SharedGraphics/TextAlignment.h>
|
||||
#include <SharedGraphics/TextElision.h>
|
||||
#include <AK/AKString.h>
|
||||
|
||||
class CharacterBitmap;
|
||||
|
@ -28,10 +29,10 @@ public:
|
|||
void blit(const Point&, const GraphicsBitmap&, const Rect& src_rect);
|
||||
void blit_with_opacity(const Point&, const GraphicsBitmap&, const Rect& src_rect, float opacity);
|
||||
|
||||
void draw_text(const Rect&, const char* text, int length, const Font&, TextAlignment = TextAlignment::TopLeft, Color = Color::Black);
|
||||
void draw_text(const Rect&, const char* text, int length, TextAlignment = TextAlignment::TopLeft, Color = Color::Black);
|
||||
void draw_text(const Rect&, const String&, const Font&, TextAlignment = TextAlignment::TopLeft, Color = Color::Black);
|
||||
void draw_text(const Rect&, const String&, TextAlignment = TextAlignment::TopLeft, Color = Color::Black);
|
||||
void draw_text(const Rect&, const char* text, int length, const Font&, TextAlignment = TextAlignment::TopLeft, Color = Color::Black, TextElision = TextElision::None);
|
||||
void draw_text(const Rect&, const char* text, int length, TextAlignment = TextAlignment::TopLeft, Color = Color::Black, TextElision = TextElision::None);
|
||||
void draw_text(const Rect&, const String&, const Font&, TextAlignment = TextAlignment::TopLeft, Color = Color::Black, TextElision = TextElision::None);
|
||||
void draw_text(const Rect&, const String&, TextAlignment = TextAlignment::TopLeft, Color = Color::Black, TextElision = TextElision::None);
|
||||
void draw_glyph(const Point&, char, Color);
|
||||
void draw_glyph(const Point&, char, const Font&, Color);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue