/trunk/Scribus/scribus/pageitem.cpp |
---|
293,6 → 293,7 |
MaxChars(0), // since the layout is invalid now |
m_sampleItem(false), |
m_textDistanceMargins(other.m_textDistanceMargins), |
verticalAlign(other.verticalAlign), |
m_ItemType(other.m_ItemType), |
AnName(other.AnName), |
gradientVal(other.gradientVal), |
488,6 → 489,7 |
CurX = 0; |
CurY = 0; |
m_textDistanceMargins=m_Doc->itemToolPrefs().textDistances; |
verticalAlign = 0; |
firstChar = 0; |
MaxChars = 0; |
m_sampleItem = false; |
1596,6 → 1598,18 |
ColGap = gap; |
} |
int PageItem::verticalAlignment() |
{ |
return verticalAlign; |
} |
void PageItem::setVerticalAlignment(int val) |
{ |
if (val == verticalAlign) |
return; |
verticalAlign = val; |
} |
void PageItem::setCornerRadius(double newRadius) |
{ |
if(m_roundedCorderRadius==newRadius) |
/trunk/Scribus/scribus/pageitem.h |
---|
705,6 → 705,7 |
double columnGap() const { return ColGap; } |
double gridOffset() const; |
double gridDistance() const; |
int verticalAlignment(); |
void setTextToFrameDistLeft(double); |
void setTextToFrameDistRight(double); |
void setTextToFrameDistTop(double); |
713,6 → 714,7 |
void setColumnGap(double); |
void setGridOffset(double); |
void setGridDistance(double); |
void setVerticalAlignment(int); |
FirstLineOffsetPolicy firstLineOffset()const; |
void setFirstLineOffset(FirstLineOffsetPolicy); |
/** |
1604,6 → 1606,7 |
uint MaxChars; |
bool m_sampleItem; ///< Used to not draw the frame for sample items |
MarginStruct m_textDistanceMargins; ///< Left, Top, Bottom, Right distances of text from the frame |
int verticalAlign; |
/** |
* @brief Frame Type, eg line, text frame, etc. |
* |
/trunk/Scribus/scribus/pageitem_textframe.cpp |
---|
72,7 → 72,7 |
unicodeInputCount = 0; |
unicodeInputString = ""; |
m_origAnnotPos = QRectF(xPos(), yPos(), width(), height()); |
verticalAlign = 0; |
connect(&itemText,SIGNAL(changed()), this, SLOT(slotInvalidateLayout())); |
} |
85,7 → 85,7 |
unicodeInputString = ""; |
m_notesFramesMap.clear(); |
m_origAnnotPos = QRectF(xPos(), yPos(), width(), height()); |
verticalAlign = 0; |
connect(&itemText,SIGNAL(changed()), this, SLOT(slotInvalidateLayout())); |
} |
3043,6 → 3043,24 |
} |
} |
MaxChars = itemText.length(); |
if ((verticalAlign > 0) && (NextBox == NULL)) |
{ |
int vertAlign = verticalAlign; |
double topDist = m_textDistanceMargins.Top; |
double hAdjust = 0; |
if (verticalAlign == 1) |
hAdjust = (height() - (m_textDistanceMargins.Bottom + lineCorr) - maxY) / 2.0; |
else if (verticalAlign == 2) |
hAdjust = (height() - (m_textDistanceMargins.Bottom + lineCorr) - maxY); |
if (hAdjust > 0) |
{ |
m_textDistanceMargins.Top += hAdjust; |
verticalAlign = 0; |
layout(); |
m_textDistanceMargins.Top = topDist; |
verticalAlign = vertAlign; |
} |
} |
invalid = false; |
if (!isNoteFrame() && (!m_Doc->notesList().isEmpty() || m_Doc->notesChanged())) |
{ //if notes are used |
/trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.cpp |
---|
4952,6 → 4952,7 |
attrs.valueAsDouble("REXTRA", 0.0), |
attrs.valueAsDouble("TEXTRA", 0.0), |
attrs.valueAsDouble("BEXTRA", 0.0)); |
currItem->setVerticalAlignment(attrs.valueAsInt("VAlign", 0)); |
currItem->setFirstLineOffset(static_cast<FirstLineOffsetPolicy>(attrs.valueAsInt("FLOP"))); |
currItem->PLineArt = Qt::PenStyle(attrs.valueAsInt("PLINEART", 0)); |
5588,6 → 5589,7 |
tAtt.valueAsDouble("TextDistTop", 0.0), |
tAtt.valueAsDouble("TextDistBottom", 0.0), |
tAtt.valueAsDouble("TextDistRight", 0.0)); |
newItem->setVerticalAlignment(tAtt.valueAsInt("TextVertAlign", 0)); |
newItem->setFirstLineOffset(static_cast<FirstLineOffsetPolicy>(tAtt.valueAsInt("Flop"))); |
} |
/trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp |
---|
2255,6 → 2255,7 |
docu.writeAttribute("TextDistTop", textFrame->textToFrameDistTop()); |
docu.writeAttribute("TextDistBottom", textFrame->textToFrameDistBottom()); |
docu.writeAttribute("TextDistRight", textFrame->textToFrameDistRight()); |
docu.writeAttribute("TextVertAlign", textFrame->verticalAlignment()); |
docu.writeAttribute("Flop", textFrame->firstLineOffset()); |
QString cstyle = cell.style(); |
2634,6 → 2635,7 |
docu.writeAttribute("TEXTRA",item->textToFrameDistTop()); |
docu.writeAttribute("BEXTRA",item->textToFrameDistBottom()); |
docu.writeAttribute("REXTRA",item->textToFrameDistRight()); |
docu.writeAttribute("VAlign", item->verticalAlignment()); |
docu.writeAttribute("FLOP",item->firstLineOffset()); // here I think this FLOP "cher à mon cœur" is legitimate! |
docu.writeAttribute("PLTSHOW", item->PoShow ? 1 : 0); |
docu.writeAttribute("BASEOF", item->BaseOffs); |
/trunk/Scribus/scribus/ui/propertywidget_distance.cpp |
---|
149,6 → 149,7 |
} |
showTextDistances(textItem->textToFrameDistLeft(), textItem->textToFrameDistTop(), textItem->textToFrameDistBottom(), textItem->textToFrameDistRight()); |
verticalAlign->setCurrentIndex(textItem->verticalAlignment()); |
connectSignals(); |
} |
162,6 → 163,7 |
connect(rightDistance , SIGNAL(valueChanged(double)), this, SLOT(handleTextDistances()), Qt::UniqueConnection); |
connect(bottomDistance, SIGNAL(valueChanged(double)), this, SLOT(handleTextDistances()), Qt::UniqueConnection); |
connect(tabsButton , SIGNAL(clicked()) , this, SLOT(handleTabs()), Qt::UniqueConnection); |
connect(verticalAlign , SIGNAL(activated(int)) , this, SLOT(handleVAlign()), Qt::UniqueConnection); |
} |
void PropertyWidget_Distance::disconnectSignals() |
174,6 → 176,7 |
disconnect(rightDistance , SIGNAL(valueChanged(double)), this, SLOT(handleTextDistances())); |
disconnect(bottomDistance, SIGNAL(valueChanged(double)), this, SLOT(handleTextDistances())); |
disconnect(tabsButton , SIGNAL(clicked()) , this, SLOT(handleTabs())); |
disconnect(verticalAlign , SIGNAL(activated(int)) , this, SLOT(handleVAlign())); |
} |
void PropertyWidget_Distance::configureWidgets(void) |
345,6 → 348,23 |
columnGap->setToolTip((index == 0) ? tr( "Distance between columns" ) : tr( "Column width" )); |
} |
void PropertyWidget_Distance::handleVAlign() |
{ |
if (!m_doc || !m_item || !m_ScMW || m_ScMW->scriptIsRunning()) |
return; |
PageItem *textItem = m_item; |
if (m_doc->appMode == modeEditTable) |
textItem = m_item->asTable()->activeCell().textFrame(); |
if (textItem != NULL) |
{ |
textItem->setVerticalAlignment(verticalAlign->currentIndex()); |
textItem->update(); |
if (m_doc->appMode == modeEditTable) |
m_item->asTable()->update(); |
m_doc->regionsChanged()->update(QRect()); |
} |
} |
void PropertyWidget_Distance::handleTabs() |
{ |
if (m_doc && m_item) |
413,6 → 433,13 |
{ |
columnsLabel->setText( tr("Colu&mns:")); |
int oldAliLabel = verticalAlign->currentIndex(); |
verticalAlign->clear(); |
verticalAlign->addItem( tr("Top")); |
verticalAlign->addItem( tr("Middle")); |
verticalAlign->addItem( tr("Bottom")); |
verticalAlign->setCurrentIndex(oldAliLabel); |
int oldcolgapLabel = columnGapLabel->currentIndex(); |
columnGapLabel->clear(); |
columnGapLabel->addItem( tr("Gap:")); |
/trunk/Scribus/scribus/ui/propertywidget_distance.h |
---|
57,6 → 57,7 |
void handleColumnGap(); |
void handleGapSwitch(); |
void handleTabs(); |
void handleVAlign(); |
void handleTextDistances(); |
}; |
/trunk/Scribus/scribus/ui/propertywidget_distancebase.ui |
---|
6,8 → 6,8 |
<rect> |
<x>0</x> |
<y>0</y> |
<width>210</width> |
<height>165</height> |
<width>186</width> |
<height>223</height> |
</rect> |
</property> |
<property name="windowTitle"> |
20,13 → 20,48 |
<enum>QFrame::Raised</enum> |
</property> |
<layout class="QGridLayout" name="gridLayout"> |
<property name="margin"> |
<property name="leftMargin"> |
<number>5</number> |
</property> |
<property name="topMargin"> |
<number>5</number> |
</property> |
<property name="rightMargin"> |
<number>5</number> |
</property> |
<property name="bottomMargin"> |
<number>5</number> |
</property> |
<property name="spacing"> |
<number>2</number> |
</property> |
<item row="0" column="0"> |
<widget class="QLabel" name="label"> |
<property name="text"> |
<string>Vertical Alignment</string> |
</property> |
</widget> |
</item> |
<item row="0" column="1"> |
<widget class="QComboBox" name="verticalAlign"> |
<item> |
<property name="text"> |
<string>Top</string> |
</property> |
</item> |
<item> |
<property name="text"> |
<string>Middle</string> |
</property> |
</item> |
<item> |
<property name="text"> |
<string>Bottom</string> |
</property> |
</item> |
</widget> |
</item> |
<item row="1" column="0"> |
<widget class="QLabel" name="columnsLabel"> |
<property name="text"> |
<string>Colu&mns:</string> |
33,17 → 68,17 |
</property> |
</widget> |
</item> |
<item row="0" column="1"> |
<item row="1" column="1"> |
<widget class="ScrSpinBox" name="columns"> |
<property name="minimum"> |
<number>1</number> |
<double>1.000000000000000</double> |
</property> |
<property name="maximum"> |
<number>3000</number> |
<double>3000.000000000000000</double> |
</property> |
</widget> |
</item> |
<item row="1" column="0"> |
<item row="2" column="0"> |
<widget class="ScComboBox" name="columnGapLabel"> |
<item> |
<property name="text"> |
57,10 → 92,10 |
</item> |
</widget> |
</item> |
<item row="1" column="1"> |
<item row="2" column="1"> |
<widget class="ScrSpinBox" name="columnGap"/> |
</item> |
<item row="2" column="0"> |
<item row="3" column="0"> |
<widget class="QLabel" name="topLabel"> |
<property name="text"> |
<string>To&p:</string> |
67,10 → 102,10 |
</property> |
</widget> |
</item> |
<item row="2" column="1"> |
<item row="3" column="1"> |
<widget class="ScrSpinBox" name="topDistance"/> |
</item> |
<item row="3" column="0"> |
<item row="4" column="0"> |
<widget class="QLabel" name="bottomLabel"> |
<property name="text"> |
<string>&Bottom:</string> |
77,10 → 112,10 |
</property> |
</widget> |
</item> |
<item row="3" column="1"> |
<item row="4" column="1"> |
<widget class="ScrSpinBox" name="bottomDistance"/> |
</item> |
<item row="4" column="0"> |
<item row="5" column="0"> |
<widget class="QLabel" name="leftLabel"> |
<property name="text"> |
<string>&Left:</string> |
87,10 → 122,10 |
</property> |
</widget> |
</item> |
<item row="4" column="1"> |
<item row="5" column="1"> |
<widget class="ScrSpinBox" name="leftDistance"/> |
</item> |
<item row="5" column="0"> |
<item row="6" column="0"> |
<widget class="QLabel" name="rightLabel"> |
<property name="text"> |
<string>&Right:</string> |
97,10 → 132,10 |
</property> |
</widget> |
</item> |
<item row="5" column="1"> |
<item row="6" column="1"> |
<widget class="ScrSpinBox" name="rightDistance"/> |
</item> |
<item row="6" column="0" colspan="2"> |
<item row="7" column="0" colspan="2"> |
<widget class="QToolButton" name="tabsButton"> |
<property name="sizePolicy"> |
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed"> |