HaikuDepot: Added TextView::ParagraphStyle() ...
... to get the initial/default paragraph style.
This commit is contained in:
@@ -16,7 +16,7 @@ TextView::TextView(const char* name)
|
|||||||
BFont font;
|
BFont font;
|
||||||
GetFont(&font);
|
GetFont(&font);
|
||||||
|
|
||||||
ParagraphStyle style;
|
::ParagraphStyle style;
|
||||||
style.SetLineSpacing(ceilf(font.Size() * 0.2));
|
style.SetLineSpacing(ceilf(font.Size() * 0.2));
|
||||||
|
|
||||||
SetParagraphStyle(style);
|
SetParagraphStyle(style);
|
||||||
@@ -115,7 +115,7 @@ TextView::SetText(const BString& text)
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
TextView::SetParagraphStyle(const ParagraphStyle& style)
|
TextView::SetParagraphStyle(const ::ParagraphStyle& style)
|
||||||
{
|
{
|
||||||
fText.SetStyle(style);
|
fText.SetStyle(style);
|
||||||
fTextLayout.SetParagraph(fText);
|
fTextLayout.SetParagraph(fText);
|
||||||
|
|||||||
@@ -31,7 +31,9 @@ public:
|
|||||||
float* max, float* preferred);
|
float* max, float* preferred);
|
||||||
|
|
||||||
void SetText(const BString& text);
|
void SetText(const BString& text);
|
||||||
void SetParagraphStyle(const ParagraphStyle& style);
|
void SetParagraphStyle(const ::ParagraphStyle& style);
|
||||||
|
const ::ParagraphStyle& ParagraphStyle() const
|
||||||
|
{ return fText.Style(); }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Paragraph fText;
|
Paragraph fText;
|
||||||
|
|||||||
Reference in New Issue
Block a user