HaikuDepot: Text stuff: Added line spacing to ParagraphStyle
This commit is contained in:
@@ -66,6 +66,13 @@ ParagraphStyle::SetAlignment(::Alignment alignment)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
::Alignment
|
||||||
|
ParagraphStyle::Alignment() const
|
||||||
|
{
|
||||||
|
return fStyleData->Alignment();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
bool
|
bool
|
||||||
ParagraphStyle::SetJustify(bool justify)
|
ParagraphStyle::SetJustify(bool justify)
|
||||||
{
|
{
|
||||||
@@ -78,6 +85,13 @@ ParagraphStyle::SetJustify(bool justify)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool
|
||||||
|
ParagraphStyle::Justify() const
|
||||||
|
{
|
||||||
|
return fStyleData->Justify();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
bool
|
bool
|
||||||
ParagraphStyle::SetFirstLineInset(float inset)
|
ParagraphStyle::SetFirstLineInset(float inset)
|
||||||
{
|
{
|
||||||
@@ -90,6 +104,13 @@ ParagraphStyle::SetFirstLineInset(float inset)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
float
|
||||||
|
ParagraphStyle::FirstLineInset() const
|
||||||
|
{
|
||||||
|
return fStyleData->FirstLineInset();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
bool
|
bool
|
||||||
ParagraphStyle::SetLineInset(float inset)
|
ParagraphStyle::SetLineInset(float inset)
|
||||||
{
|
{
|
||||||
@@ -102,6 +123,32 @@ ParagraphStyle::SetLineInset(float inset)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
float
|
||||||
|
ParagraphStyle::LineInset() const
|
||||||
|
{
|
||||||
|
return fStyleData->LineInset();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool
|
||||||
|
ParagraphStyle::SetLineSpacing(float spacing)
|
||||||
|
{
|
||||||
|
ParagraphStyleDataRef data = fStyleData->SetLineSpacing(spacing);
|
||||||
|
if (data == fStyleData)
|
||||||
|
return data->LineSpacing() == spacing;
|
||||||
|
|
||||||
|
fStyleData = data;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
float
|
||||||
|
ParagraphStyle::LineSpacing() const
|
||||||
|
{
|
||||||
|
return fStyleData->LineSpacing();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
bool
|
bool
|
||||||
ParagraphStyle::SetSpacingTop(float spacing)
|
ParagraphStyle::SetSpacingTop(float spacing)
|
||||||
{
|
{
|
||||||
@@ -114,6 +161,13 @@ ParagraphStyle::SetSpacingTop(float spacing)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
float
|
||||||
|
ParagraphStyle::SpacingTop() const
|
||||||
|
{
|
||||||
|
return fStyleData->SpacingTop();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
bool
|
bool
|
||||||
ParagraphStyle::SetSpacingBottom(float spacing)
|
ParagraphStyle::SetSpacingBottom(float spacing)
|
||||||
{
|
{
|
||||||
@@ -126,3 +180,10 @@ ParagraphStyle::SetSpacingBottom(float spacing)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
float
|
||||||
|
ParagraphStyle::SpacingBottom() const
|
||||||
|
{
|
||||||
|
return fStyleData->SpacingBottom();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -29,6 +29,9 @@ public:
|
|||||||
bool SetLineInset(float inset);
|
bool SetLineInset(float inset);
|
||||||
float LineInset() const;
|
float LineInset() const;
|
||||||
|
|
||||||
|
bool SetLineSpacing(float spacing);
|
||||||
|
float LineSpacing() const;
|
||||||
|
|
||||||
bool SetSpacingTop(float spacing);
|
bool SetSpacingTop(float spacing);
|
||||||
float SpacingTop() const;
|
float SpacingTop() const;
|
||||||
|
|
||||||
|
|||||||
@@ -118,6 +118,21 @@ ParagraphStyleData::SetLineInset(float inset)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
ParagraphStyleDataRef
|
||||||
|
ParagraphStyleData::SetLineSpacing(float spacing)
|
||||||
|
{
|
||||||
|
if (fLineSpacing == spacing)
|
||||||
|
return ParagraphStyleDataRef(this);
|
||||||
|
|
||||||
|
ParagraphStyleData* ret = new(std::nothrow) ParagraphStyleData(*this);
|
||||||
|
if (ret == NULL)
|
||||||
|
return ParagraphStyleDataRef(this);
|
||||||
|
|
||||||
|
ret->fLineSpacing = spacing;
|
||||||
|
return ParagraphStyleDataRef(ret, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
ParagraphStyleDataRef
|
ParagraphStyleDataRef
|
||||||
ParagraphStyleData::SetSpacingTop(float spacing)
|
ParagraphStyleData::SetSpacingTop(float spacing)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -48,6 +48,10 @@ public:
|
|||||||
inline float LineInset() const
|
inline float LineInset() const
|
||||||
{ return fLineInset; }
|
{ return fLineInset; }
|
||||||
|
|
||||||
|
ParagraphStyleDataRef SetLineSpacing(float spacing);
|
||||||
|
inline float LineSpacing() const
|
||||||
|
{ return fLineSpacing; }
|
||||||
|
|
||||||
ParagraphStyleDataRef SetSpacingTop(float spacing);
|
ParagraphStyleDataRef SetSpacingTop(float spacing);
|
||||||
inline float SpacingTop() const
|
inline float SpacingTop() const
|
||||||
{ return fSpacingTop; }
|
{ return fSpacingTop; }
|
||||||
@@ -65,6 +69,7 @@ private:
|
|||||||
|
|
||||||
float fFirstLineInset;
|
float fFirstLineInset;
|
||||||
float fLineInset;
|
float fLineInset;
|
||||||
|
float fLineSpacing;
|
||||||
|
|
||||||
float fSpacingTop;
|
float fSpacingTop;
|
||||||
float fSpacingBottom;
|
float fSpacingBottom;
|
||||||
|
|||||||
Reference in New Issue
Block a user