Subversion Repositories Scribus

Compare Revisions

Ignore whitespace Rev 16061 → Rev 16062

/branches/ScribusOIF/scribus/ui/propertiespalette_line.cpp
45,20 → 45,17
#endif
#include <cmath>
#include "arrowchooser.h"
#include "autoform.h"
#include "commonstrings.h"
#include "colorlistbox.h"
#include "dasheditor.h"
#include "pageitem.h"
#include "pageitem_textframe.h"
#include "sccolorengine.h"
#include "sccombobox.h"
#include "scfonts.h"
#include "scribus.h"
#include "scribuscore.h"
#include "scraction.h"
#include "scribusview.h"
#include "selection.h"
#include "spalette.h"
#include "units.h"
#include "undomanager.h"
#include "util.h"
77,137 → 74,52
m_haveItem = false;
m_lineMode = false;
m_unitRatio = 1.0;
 
setupUi(this);
setSizePolicy( QSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum));
 
pageLayout_5 = new QVBoxLayout( this );
pageLayout_5->setSpacing( 5 );
pageLayout_5->setMargin( 0 );
lineType->addItem( tr("Custom"));
 
Layout12_2 = new QGridLayout;
Layout12_2->setSpacing( 3 );
Layout12_2->setMargin( 0 );
LStyle = new LineCombo(this);
LStyle->addItem( tr("Custom"));
LineMode = new ScComboBox( this );
LineModeT = new QLabel( "&Basepoint:", this );
LineModeT->setBuddy(LineMode);
Layout12_2->addWidget( LineModeT, 0, 0 );
Layout12_2->addWidget( LineMode, 0, 1 );
lineTypeLabel = new QLabel( "T&ype of Line:", this );
lineTypeLabel->setBuddy(LStyle);
Layout12_2->addWidget( lineTypeLabel, 1, 0 );
Layout12_2->addWidget( LStyle, 1, 1 );
lineModeLabel->setBuddy(lineMode);
lineTypeLabel->setBuddy(lineType);
 
dashEditor = new DashEditor(this);
Layout12_2->addWidget(dashEditor, 2, 0, 1, 2);
startArrowLabel->setBuddy(startArrow);
endArrowLabel->setBuddy(endArrow);
 
startArrow = new ArrowChooser(this, true);
Layout12_2->addWidget( startArrow, 4, 0 );
endArrow = new ArrowChooser(this, false);
Layout12_2->addWidget( endArrow, 4, 1 );
startArrowText = new QLabel( "Start Arrow:", this );
startArrowText->setBuddy(startArrow);
Layout12_2->addWidget( startArrowText, 3, 0 );
endArrowText = new QLabel( "End Arrow:", this );
endArrowText->setBuddy(endArrow);
Layout12_2->addWidget( endArrowText, 3, 1 );
startArrowScale->setMaximum( 300 );
startArrowScale->setMinimum( 1 );
 
Layout12_2a = new QHBoxLayout;
Layout12_2a->setSpacing( 3 );
Layout12_2a->setMargin( 0 );
startArrowSpinText = new QLabel( "Scaling:", this );
Layout12_2a->addWidget(startArrowSpinText);
startArrowScaleSpin = new QSpinBox(this );
startArrowScaleSpin->setMaximum( 300 );
startArrowScaleSpin->setMinimum( 1 );
Layout12_2a->addWidget(startArrowScaleSpin);
Layout12_2->addLayout(Layout12_2a, 5, 0);
endArrowScale->setMaximum( 300 );
endArrowScale->setMinimum( 1 );
 
Layout12_2b = new QHBoxLayout;
Layout12_2b->setSpacing( 3 );
Layout12_2b->setMargin( 0 );
endArrowSpinText = new QLabel( "Scaling:", this );
Layout12_2b->addWidget(endArrowSpinText);
endArrowScaleSpin = new QSpinBox(this );
endArrowScaleSpin->setMaximum( 300 );
endArrowScaleSpin->setMinimum( 1 );
Layout12_2b->addWidget(endArrowScaleSpin);
Layout12_2->addLayout( Layout12_2b, 5, 1 );
lineWidthLabel->setBuddy(lineWidth);
lineJoinLabel->setBuddy(lineJoinStyle);
lineEndLabel->setBuddy(lineEndStyle);
 
LSize = new ScrSpinBox( this, 0 );
lineWidthLabel = new QLabel( "Line &Width:", this );
lineWidthLabel->setBuddy(LSize);
Layout12_2->addWidget( lineWidthLabel, 6, 0 );
Layout12_2->addWidget( LSize, 6, 1 );
LJoinStyle = new ScComboBox( this );
edgesLabel = new QLabel( "Ed&ges:", this );
edgesLabel->setBuddy(LJoinStyle);
Layout12_2->addWidget( edgesLabel, 7, 0 );
Layout12_2->addWidget( LJoinStyle, 7, 1 );
LEndStyle = new ScComboBox( this );
endingsLabel = new QLabel( "&Endings:", this );
endingsLabel->setBuddy(LEndStyle);
Layout12_2->addWidget( endingsLabel, 8, 0 );
Layout12_2->addWidget( LEndStyle, 8, 1 );
pageLayout_5->addLayout( Layout12_2 );
lineStyles->setItemDelegate(new LineFormatItemDelegate);
lineStyles->addItem( "No Style" );
 
TabStack3 = new QStackedWidget( this );
TabStack3->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding));
tableLineLayout->setAlignment( Qt::AlignTop );
 
page_5a = new QWidget( TabStack3 );
pageLayout_5a = new QVBoxLayout( page_5a );
pageLayout_5a->setSpacing( 5 );
pageLayout_5a->setMargin( 0 );
StyledLine = new QListWidget(page_5a);
StyledLine->setItemDelegate(new LineFormatItemDelegate);
StyledLine->addItem( "No Style" );
pageLayout_5a->addWidget(StyledLine);
TabStack3->addWidget( page_5a );
 
page_5b = new QWidget( TabStack3 );
pageLayout_5b = new QVBoxLayout( page_5b );
pageLayout_5b->setSpacing( 5 );
pageLayout_5b->setMargin( 0 );
TLines = new QGroupBox( "Cell Lines", page_5b );
TLineLayout = new QVBoxLayout( TLines );
TLineLayout->setSpacing( 2 );
TLineLayout->setMargin( 5 );
TLineLayout->setAlignment( Qt::AlignTop );
TopLine = new QCheckBox( TLines );
TopLine->setText( "Line at Top" );
TLineLayout->addWidget(TopLine);
LeftLine = new QCheckBox( TLines );
LeftLine->setText( "Line at the Left" );
TLineLayout->addWidget(LeftLine);
RightLine = new QCheckBox( TLines );
RightLine->setText( "Line at the Right " );
TLineLayout->addWidget(RightLine);
BottomLine = new QCheckBox( TLines );
BottomLine->setText( "Line at Bottom" );
TLineLayout->addWidget(BottomLine);
pageLayout_5b->addWidget(TLines);
TabStack3->addWidget( page_5b );
pageLayout_5->addWidget( TabStack3 );
 
languageChange();
 
connect(LSize , SIGNAL(valueChanged(double)), this, SLOT(handleLineWidth()));
connect(LStyle , SIGNAL(activated(int)) , this, SLOT(handleLineStyle()));
connect(LJoinStyle, SIGNAL(activated(int)) , this, SLOT(handleLineJoin()));
connect(LEndStyle , SIGNAL(activated(int)) , this, SLOT(handleLineEnd()));
connect(LineMode , SIGNAL(activated(int)) , this, SLOT(handleLineMode()));
connect(lineWidth , SIGNAL(valueChanged(double)), this, SLOT(handleLineWidth()));
connect(lineType , SIGNAL(activated(int)) , this, SLOT(handleLineStyle()));
connect(lineJoinStyle, SIGNAL(activated(int)) , this, SLOT(handleLineJoin()));
connect(lineEndStyle , SIGNAL(activated(int)) , this, SLOT(handleLineEnd()));
connect(lineMode , SIGNAL(activated(int)) , this, SLOT(handleLineMode()));
connect(dashEditor, SIGNAL(dashChanged()) , this, SLOT(handleDashChange()));
connect(TopLine , SIGNAL(clicked()) , this, SLOT(handleTLines()));
connect(LeftLine , SIGNAL(clicked()) , this, SLOT(handleTLines()));
connect(RightLine , SIGNAL(clicked()) , this, SLOT(handleTLines()));
connect(BottomLine, SIGNAL(clicked()) , this, SLOT(handleTLines()));
connect(topLine , SIGNAL(clicked()) , this, SLOT(handleTLines()));
connect(leftLine , SIGNAL(clicked()) , this, SLOT(handleTLines()));
connect(rightLine , SIGNAL(clicked()) , this, SLOT(handleTLines()));
connect(bottomLine, SIGNAL(clicked()) , this, SLOT(handleTLines()));
connect(startArrow, SIGNAL(activated(int)) , this, SLOT(handleStartArrow(int )));
connect(endArrow , SIGNAL(activated(int)) , this, SLOT(handleEndArrow(int )));
connect(startArrowScaleSpin, SIGNAL(valueChanged(int)), this, SLOT(handleStartArrowScale(int )));
connect(endArrowScaleSpin , SIGNAL(valueChanged(int)), this, SLOT(handleEndArrowScale(int )));
connect(StyledLine, SIGNAL(itemClicked(QListWidgetItem*)), this, SLOT(handleLineStyle(QListWidgetItem*)));
connect(startArrowScale, SIGNAL(valueChanged(int)), this, SLOT(handleStartArrowScale(int )));
connect(endArrowScale , SIGNAL(valueChanged(int)), this, SLOT(handleEndArrowScale(int )));
connect(lineStyles, SIGNAL(itemClicked(QListWidgetItem*)), this, SLOT(handleLineStyle(QListWidgetItem*)));
 
TabStack3->setCurrentIndex(0);
stackedWidget->setCurrentIndex(0);
}
 
void PropertiesPalette_Line::changeEvent(QEvent *e)
272,8 → 184,8
m_haveDoc = true;
m_haveItem = false;
 
LSize->setMaximum( 300 );
LSize->setMinimum( 0 );
lineWidth->setMaximum( 300 );
lineWidth->setMinimum( 0 );
 
updateLineStyles(m_doc);
startArrow->rebuildList(&m_doc->arrowStyles());
324,7 → 236,7
int itemType = currItem ? (int) currItem->itemType() : -1;
m_haveItem = (itemType != -1);
 
LineMode->setEnabled(false);
lineMode->setEnabled(false);
switch (itemType)
{
case -1:
336,7 → 248,7
setEnabled(currItem->asOSGFrame() == NULL);
case PageItem::Line:
setEnabled(true);
LineMode->setEnabled(true);
lineMode->setEnabled(true);
break;
case PageItem::ItemType1:
case PageItem::ItemType3:
376,12 → 288,12
m_haveItem = false;
m_item = item;
 
StyledLine->blockSignals(true);
lineStyles->blockSignals(true);
startArrow->blockSignals(true);
endArrow->blockSignals(true);
startArrowScaleSpin->blockSignals(true);
endArrowScaleSpin->blockSignals(true);
LineMode->blockSignals(true);
startArrowScale->blockSignals(true);
endArrowScale->blockSignals(true);
lineMode->blockSignals(true);
 
if ((m_item->asLine()) || (m_item->asPolyLine()))
{
389,21 → 301,21
endArrow->setEnabled(true);
startArrow->setCurrentIndex(m_item->startArrowIndex());
endArrow->setCurrentIndex(m_item->endArrowIndex());
startArrowScaleSpin->setEnabled(true);
endArrowScaleSpin->setEnabled(true);
endArrowScaleSpin->setValue(m_item->endArrowScale());
startArrowScaleSpin->setValue(m_item->startArrowScale());
startArrowScale->setEnabled(true);
endArrowScale->setEnabled(true);
endArrowScale->setValue(m_item->endArrowScale());
startArrowScale->setValue(m_item->startArrowScale());
}
else
{
startArrow->setEnabled(false);
endArrow->setEnabled(false);
startArrowScaleSpin->setEnabled(false);
endArrowScaleSpin->setEnabled(false);
startArrowScale->setEnabled(false);
endArrowScale->setEnabled(false);
}
 
if (StyledLine->currentItem())
StyledLine->currentItem()->setSelected(false);
if (lineStyles->currentItem())
lineStyles->currentItem()->setSelected(false);
 
bool setter = false;
if (m_item->NamedLStyle.isEmpty())
410,57 → 322,57
{
setter = true;
QListWidgetItem *itemStl = NULL;
itemStl = StyledLine->item(0);
itemStl = lineStyles->item(0);
if (itemStl != NULL)
itemStl->setSelected(true);
}
else
{
QList<QListWidgetItem*> results (StyledLine->findItems(m_item->NamedLStyle, Qt::MatchFixedString|Qt::MatchCaseSensitive));
QList<QListWidgetItem*> results (lineStyles->findItems(m_item->NamedLStyle, Qt::MatchFixedString|Qt::MatchCaseSensitive));
if (results.count() > 0)
results[0]->setSelected(true);
setter = false;
}
 
LStyle->setEnabled(setter);
LSize->setEnabled(setter);
LJoinStyle->setEnabled(setter);
LEndStyle->setEnabled(setter);
lineType->setEnabled(setter);
lineWidth->setEnabled(setter);
lineJoinStyle->setEnabled(setter);
lineEndStyle->setEnabled(setter);
 
if (m_item->dashes().count() == 0)
dashEditor->hide();
else
{
LStyle->setCurrentIndex(37);
lineType->setCurrentIndex(37);
dashEditor->setDashValues(m_item->dashes(), qMax(m_item->lineWidth(), 0.001), m_item->dashOffset());
dashEditor->show();
}
 
if (m_lineMode)
LineMode->setCurrentIndex(1);
lineMode->setCurrentIndex(1);
else
LineMode->setCurrentIndex(0);
lineMode->setCurrentIndex(0);
 
StyledLine->blockSignals(false);
lineStyles->blockSignals(false);
startArrow->blockSignals(false);
endArrow->blockSignals(false);
startArrowScaleSpin->blockSignals(false);
endArrowScaleSpin->blockSignals(false);
LineMode->blockSignals(false);
startArrowScale->blockSignals(false);
endArrowScale->blockSignals(false);
lineMode->blockSignals(false);
 
if ((m_item->isTableItem) && (m_item->isSingleSel))
{
setter = true;
TabStack3->setCurrentIndex(1);
TopLine->setChecked(m_item->TopLine);
LeftLine->setChecked(m_item->LeftLine);
RightLine->setChecked(m_item->RightLine);
BottomLine->setChecked(m_item->BottomLine);
stackedWidget->setCurrentIndex(1);
topLine->setChecked(m_item->TopLine);
leftLine->setChecked(m_item->LeftLine);
rightLine->setChecked(m_item->RightLine);
bottomLine->setChecked(m_item->BottomLine);
}
else
{
setter = false;
TabStack3->setCurrentIndex(0);
stackedWidget->setCurrentIndex(0);
}
 
if ((m_item->isGroupControl) || ((m_item->Groups.count() != 0) && (!m_item->isSingleSel)))
483,6 → 395,20
}
}
 
void PropertiesPalette_Line::updateArrowStyles()
{
updateArrowStyles(m_doc);
}
 
void PropertiesPalette_Line::updateArrowStyles(ScribusDoc *doc)
{
if (doc)
{
startArrow->rebuildList(&doc->arrowStyles());
endArrow->rebuildList(&doc->arrowStyles());
}
}
 
void PropertiesPalette_Line::updateLineStyles()
{
updateLineStyles(m_doc);
493,19 → 419,19
if (!m_ScMW || m_ScMW->scriptIsRunning())
return;
StyledLine->blockSignals(true);
StyledLine->clear();
lineStyles->blockSignals(true);
lineStyles->clear();
if (dd != 0)
{
QMap<QString,multiLine>::Iterator it;
for (it = dd->MLineStyles.begin(); it != dd->MLineStyles.end(); ++it)
StyledLine->addItem( new LineFormatItem(dd, it.value(), it.key()) );
StyledLine->sortItems();
StyledLine->insertItem( 0, tr("No Style"));
if (StyledLine->currentItem())
StyledLine->currentItem()->setSelected(false);
lineStyles->addItem( new LineFormatItem(dd, it.value(), it.key()) );
lineStyles->sortItems();
lineStyles->insertItem( 0, tr("No Style"));
if (lineStyles->currentItem())
lineStyles->currentItem()->setSelected(false);
}
StyledLine->blockSignals(false);
lineStyles->blockSignals(false);
}
 
void PropertiesPalette_Line::displayLineWidth(double s)
512,7 → 438,7
{
if (!m_ScMW || m_ScMW->scriptIsRunning())
return;
LSize->showValue(s * m_unitRatio);
lineWidth->showValue(s * m_unitRatio);
if (m_haveItem)
{
if (m_item->dashes().count() != 0)
535,58 → 461,58
if (!m_ScMW || m_ScMW->scriptIsRunning())
return;
 
LStyle->blockSignals(true);
lineType->blockSignals(true);
dashEditor->blockSignals(true);
if (m_haveItem)
{
if (m_item->dashes().count() != 0)
{
LStyle->setCurrentIndex(37);
lineType->setCurrentIndex(37);
dashEditor->setDashValues(m_item->dashes(), qMax(m_item->lineWidth(), 0.001), m_item->dashOffset());
}
else
LStyle->setCurrentIndex(static_cast<int>(p) - 1);
lineType->setCurrentIndex(static_cast<int>(p) - 1);
}
else
LStyle->setCurrentIndex(static_cast<int>(p) - 1);
lineType->setCurrentIndex(static_cast<int>(p) - 1);
dashEditor->blockSignals(false);
LStyle->blockSignals(false);
lineType->blockSignals(false);
 
LEndStyle->blockSignals(true);
lineEndStyle->blockSignals(true);
switch (pc)
{
case Qt::FlatCap:
LEndStyle->setCurrentIndex(0);
lineEndStyle->setCurrentIndex(0);
break;
case Qt::SquareCap:
LEndStyle->setCurrentIndex(1);
lineEndStyle->setCurrentIndex(1);
break;
case Qt::RoundCap:
LEndStyle->setCurrentIndex(2);
lineEndStyle->setCurrentIndex(2);
break;
default:
LEndStyle->setCurrentIndex(0);
lineEndStyle->setCurrentIndex(0);
break;
}
LEndStyle->blockSignals(false);
lineEndStyle->blockSignals(false);
 
LJoinStyle->blockSignals(true);
lineJoinStyle->blockSignals(true);
switch (pj)
{
case Qt::MiterJoin:
LJoinStyle->setCurrentIndex(0);
lineJoinStyle->setCurrentIndex(0);
break;
case Qt::BevelJoin:
LJoinStyle->setCurrentIndex(1);
lineJoinStyle->setCurrentIndex(1);
break;
case Qt::RoundJoin:
LJoinStyle->setCurrentIndex(2);
lineJoinStyle->setCurrentIndex(2);
break;
default:
LJoinStyle->setCurrentIndex(0);
lineJoinStyle->setCurrentIndex(0);
break;
}
LJoinStyle->blockSignals(false);
lineJoinStyle->blockSignals(false);
}
 
void PropertiesPalette_Line::handleLineWidth()
596,7 → 522,7
if ((m_haveDoc) && (m_haveItem))
{
double oldL = m_item->lineWidth();
m_doc->itemSelection_SetLineWidth(LSize->value() / m_unitRatio);
m_doc->itemSelection_SetLineWidth(lineWidth->value() / m_unitRatio);
if (m_item->dashes().count() != 0)
{
if ((oldL != 0.0) && (m_item->lineWidth() != 0.0))
624,7 → 550,7
return;
if ((m_haveDoc) && (m_haveItem))
{
if (LStyle->currentIndex() == 37)
if (lineType->currentIndex() == 37)
{
if (m_item->dashes().count() == 0)
{
650,7 → 576,7
{
m_item->DashValues.clear();
dashEditor->hide();
m_doc->itemSelection_SetLineArt(static_cast<Qt::PenStyle>(LStyle->currentIndex()+1));
m_doc->itemSelection_SetLineArt(static_cast<Qt::PenStyle>(lineType->currentIndex()+1));
}
}
}
662,7 → 588,7
if ((m_haveDoc) && (m_haveItem))
{
Qt::PenJoinStyle c = Qt::MiterJoin;
switch (LJoinStyle->currentIndex())
switch (lineJoinStyle->currentIndex())
{
case 0:
c = Qt::MiterJoin;
685,7 → 611,7
if ((m_haveDoc) && (m_haveItem))
{
Qt::PenCapStyle c = Qt::FlatCap;
switch (LEndStyle->currentIndex())
switch (lineEndStyle->currentIndex())
{
case 0:
c = Qt::FlatCap;
705,8 → 631,8
{
if (!m_ScMW || m_ScMW->scriptIsRunning())
return;
m_lineMode = (LineMode->currentIndex() == 1);
emit lineModeChanged(LineMode->currentIndex());
m_lineMode = (lineMode->currentIndex() == 1);
emit lineModeChanged(lineMode->currentIndex());
}
 
void PropertiesPalette_Line::handleTLines()
713,10 → 639,10
{
if ((m_haveDoc) && (m_haveItem))
{
m_item->TopLine = TopLine->isChecked();
m_item->LeftLine = LeftLine->isChecked();
m_item->RightLine = RightLine->isChecked();
m_item->BottomLine = BottomLine->isChecked();
m_item->TopLine = topLine->isChecked();
m_item->LeftLine = leftLine->isChecked();
m_item->RightLine = rightLine->isChecked();
m_item->BottomLine = bottomLine->isChecked();
m_item->update();
emit DocChanged();
}
772,30 → 698,30
return;
bool setter = (widgetItem->listWidget()->currentRow() == 0);
m_doc->itemSelection_SetNamedLineStyle(setter ? QString("") : widgetItem->text());
LStyle->setEnabled(setter);
LSize->setEnabled(setter);
LJoinStyle->setEnabled(setter);
LEndStyle->setEnabled(setter);
lineType->setEnabled(setter);
lineWidth->setEnabled(setter);
lineJoinStyle->setEnabled(setter);
lineEndStyle->setEnabled(setter);
}
 
void PropertiesPalette_Line::languageChange()
{
int oldLineStyle = LStyle->currentIndex();
LStyle->clear();
LStyle->updateList();
LStyle->addItem( tr("Custom"));
LStyle->setCurrentIndex(oldLineStyle);
int oldLineMode=LineMode->currentIndex();
LineMode->clear();
LineMode->addItem( tr("Left Point"));
LineMode->addItem( tr("End Points"));
LineMode->setCurrentIndex(oldLineMode);
LineModeT->setText( tr("&Basepoint:"));
int oldLineStyle = lineType->currentIndex();
lineType->clear();
lineType->updateList();
lineType->addItem( tr("Custom"));
lineType->setCurrentIndex(oldLineStyle);
int oldLineMode=lineMode->currentIndex();
lineMode->clear();
lineMode->addItem( tr("Left Point"));
lineMode->addItem( tr("End Points"));
lineMode->setCurrentIndex(oldLineMode);
lineModeLabel->setText( tr("&Basepoint:"));
lineTypeLabel->setText( tr("T&ype of Line:"));
startArrowText->setText( tr("Start Arrow:"));
endArrowText->setText( tr("End Arrow:"));
startArrowSpinText->setText( tr("Scaling:"));
endArrowSpinText->setText( tr("Scaling:"));
startArrowLabel->setText( tr("Start Arrow:"));
endArrowLabel->setText( tr("End Arrow:"));
startArrowScaleLabel->setText( tr("Scaling:"));
endArrowScaleLabel->setText( tr("Scaling:"));
if (m_haveDoc)
{
int arrowItem = startArrow->currentIndex();
806,52 → 732,52
endArrow->setCurrentIndex(arrowItem);
}
lineWidthLabel->setText( tr("Line &Width:"));
edgesLabel->setText( tr("Ed&ges:"));
lineJoinLabel->setText( tr("Ed&ges:"));
 
int oldLJoinStyle=LJoinStyle->currentIndex();
LJoinStyle->clear();
LJoinStyle->addItem(loadIcon("16/stroke-join-miter.png"), tr("Miter Join"));
LJoinStyle->addItem(loadIcon("16/stroke-join-bevel.png"), tr("Bevel Join"));
LJoinStyle->addItem(loadIcon("16/stroke-join-round.png"), tr("Round Join"));
LJoinStyle->setCurrentIndex(oldLJoinStyle);
int oldLJoinStyle=lineJoinStyle->currentIndex();
lineJoinStyle->clear();
lineJoinStyle->addItem(loadIcon("16/stroke-join-miter.png"), tr("Miter Join"));
lineJoinStyle->addItem(loadIcon("16/stroke-join-bevel.png"), tr("Bevel Join"));
lineJoinStyle->addItem(loadIcon("16/stroke-join-round.png"), tr("Round Join"));
lineJoinStyle->setCurrentIndex(oldLJoinStyle);
 
int oldLEndStyle=LEndStyle->currentIndex();
LEndStyle->clear();
LEndStyle->addItem(loadIcon("16/stroke-cap-butt.png"), tr("Flat Cap"));
LEndStyle->addItem(loadIcon("16/stroke-cap-square.png"), tr("Square Cap"));
LEndStyle->addItem(loadIcon("16/stroke-cap-round.png"), tr("Round Cap"));
LEndStyle->setCurrentIndex(oldLEndStyle);
endingsLabel->setText( tr("&Endings:"));
int oldLEndStyle=lineEndStyle->currentIndex();
lineEndStyle->clear();
lineEndStyle->addItem(loadIcon("16/stroke-cap-butt.png"), tr("Flat Cap"));
lineEndStyle->addItem(loadIcon("16/stroke-cap-square.png"), tr("Square Cap"));
lineEndStyle->addItem(loadIcon("16/stroke-cap-round.png"), tr("Round Cap"));
lineEndStyle->setCurrentIndex(oldLEndStyle);
lineEndLabel->setText( tr("&Endings:"));
 
TLines->setTitle( tr("Cell Lines"));
TopLine->setText( tr("Line at Top"));
LeftLine->setText( tr("Line at the Left"));
RightLine->setText( tr("Line at the Right "));
BottomLine->setText( tr("Line at Bottom"));
tableLineGroup->setTitle( tr("Cell Lines"));
topLine->setText( tr("Line at Top"));
leftLine->setText( tr("Line at the Left"));
rightLine->setText( tr("Line at the Right "));
bottomLine->setText( tr("Line at Bottom"));
 
QString pctSuffix = tr(" %");
startArrowScaleSpin->setSuffix(pctSuffix);
endArrowScaleSpin->setSuffix(pctSuffix);
startArrowScale->setSuffix(pctSuffix);
endArrowScale->setSuffix(pctSuffix);
 
QString ptSuffix = tr(" pt");
QString suffix = (m_doc) ? unitGetSuffixFromIndex(m_doc->unitIndex()) : ptSuffix;
 
LSize->setSuffix(suffix);
LSize->setSpecialValueText( tr("Hairline"));
lineWidth->setSuffix(suffix);
lineWidth->setSpecialValueText( tr("Hairline"));
 
if(StyledLine->count() > 0)
StyledLine->item(0)->setText( tr("No Style") );
if(lineStyles->count() > 0)
lineStyles->item(0)->setText( tr("No Style") );
 
LineMode->setToolTip( tr("Change settings for left or end points"));
LStyle->setToolTip( tr("Pattern of line"));
LSize->setToolTip( tr("Thickness of line"));
LJoinStyle->setToolTip( tr("Type of line joins"));
LEndStyle->setToolTip( tr("Type of line end"));
StyledLine->setToolTip( tr("Line style of current object"));
lineMode->setToolTip( tr("Change settings for left or end points"));
lineType->setToolTip( tr("Pattern of line"));
lineWidth->setToolTip( tr("Thickness of line"));
lineJoinStyle->setToolTip( tr("Type of line joins"));
lineEndStyle->setToolTip( tr("Type of line end"));
lineStyles->setToolTip( tr("Line style of current object"));
startArrow->setToolTip( tr("Arrow head style for start of line"));
endArrow->setToolTip( tr("Arrow head style for end of line"));
startArrowScaleSpin->setToolTip( tr("Arrow head scale for start of line"));
endArrowScaleSpin->setToolTip( tr("Arrow head scale for end of line"));
startArrowScale->setToolTip( tr("Arrow head scale for start of line"));
endArrowScale->setToolTip( tr("Arrow head scale for end of line"));
}
 
void PropertiesPalette_Line::unitChange()
863,7 → 789,7
m_unitRatio = m_doc->unitRatio();
m_unitIndex = m_doc->unitIndex();
 
LSize->blockSignals(true);
LSize->setNewUnit( m_unitIndex );
LSize->blockSignals(false);
lineWidth->blockSignals(true);
lineWidth->setNewUnit( m_unitIndex );
lineWidth->blockSignals(false);
}
/branches/ScribusOIF/scribus/ui/propertiespalette_line.h
7,62 → 7,20
#ifndef PROPERTIESPALETTE_LINE_H
#define PROPERTIESPALETTE_LINE_H
 
#include <QListWidgetItem>
#include <QLineEdit>
#include "ui_propertiespalette_linebase.h"
 
class QButtonGroup;
class QCheckBox;
class QCloseEvent;
class QComboBox;
class QEvent;
class QEvent;
class QFocusEvent;
class QFrame;
class QGridLayout;
class QGroupBox;
class QHBoxLayout;
class QLabel;
class QMenu;
class QPushButton;
class QRadioButton;
class QSpinBox;
class QStackedWidget;
class QStackedWidget;
class QToolBox;
class QVBoxLayout;
class QWidget;
 
 
#include "scribusapi.h"
#include "scrpalettebase.h"
#include "scrspinbox.h"
#include "pageitem.h"
#include "page.h"
#include "linkbutton.h"
#include "linecombo.h"
#include "spalette.h"
#include "alignselect.h"
#include "shadebutton.h"
#include "sclistboxpixmap.h"
#include "scguardedptr.h"
#include "sctreewidget.h"
 
class ArrowChooser;
class Autoforms;
class BasePointWidget;
class ColorCombo;
class DashEditor;
class FontComboH;
class NameWidget;
class PageItem;
class ScComboBox;
class ScribusDoc;
class ScribusMainWindow;
class Selection;
class StyleSelect;
class Tpalette;
class UserActionSniffer;
 
class SCRIBUS_API PropertiesPalette_Line : public QWidget
class SCRIBUS_API PropertiesPalette_Line : public QWidget, Ui::PropertiesPalette_LineBase
{
Q_OBJECT
 
73,10 → 31,7
virtual void changeEvent(QEvent *e);
 
void updateLineStyles();
ArrowChooser* startArrow;
ArrowChooser* endArrow;
DashEditor* dashEditor;
void updateArrowStyles();
 
protected:
 
93,6 → 48,7
private:
 
PageItem* currentItemFromSelection();
void updateArrowStyles(ScribusDoc *dd);
void updateLineStyles(ScribusDoc *dd);
 
public slots:
126,53 → 82,6
void handleEndArrowScale(int sc);
void handleLineStyle(QListWidgetItem *c);
 
protected:
 
QGridLayout* Layout12_2;
 
QHBoxLayout* Layout12_2a;
QHBoxLayout* Layout12_2b;
 
QVBoxLayout* pageLayout_5;
QVBoxLayout* pageLayout_5a;
QVBoxLayout* pageLayout_5b;
QVBoxLayout* TLineLayout;
 
QCheckBox* LeftLine;
QCheckBox* RightLine;
QCheckBox* BottomLine;
QCheckBox* TopLine;
 
QLabel* LineModeT;
QLabel* lineTypeLabel;
QLabel* lineWidthLabel;
QLabel* startArrowText;
QLabel* startArrowSpinText;
QLabel* endArrowText;
QLabel* endArrowSpinText;
QLabel* edgesLabel;
QLabel* endingsLabel;
 
QGroupBox* TLines;
QListWidget* StyledLine;
 
QSpinBox* startArrowScaleSpin;
QSpinBox* endArrowScaleSpin;
 
QStackedWidget* TabStack3;
 
QWidget* page_5a;
QWidget* page_5b;
 
LineCombo* LStyle;
 
ScComboBox* LineMode;
ScComboBox* LJoinStyle;
ScComboBox* LEndStyle;
 
ScrSpinBox* LSize;
 
signals:
void DocChanged();
void lineModeChanged(int);
/branches/ScribusOIF/scribus/ui/propertiespalette_linebase.ui
0,0 → 1,262
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>PropertiesPalette_LineBase</class>
<widget class="QWidget" name="PropertiesPalette_LineBase">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>300</width>
<height>400</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0" colspan="2">
<widget class="QLabel" name="lineModeLabel">
<property name="text">
<string>&amp;Basepoint:</string>
</property>
</widget>
</item>
<item row="1" column="0" colspan="2">
<widget class="QLabel" name="lineTypeLabel">
<property name="text">
<string>T&amp;ype of Line:</string>
</property>
</widget>
</item>
<item row="3" column="0" colspan="2">
<widget class="QLabel" name="startArrowLabel">
<property name="text">
<string>Start Arrow:</string>
</property>
</widget>
</item>
<item row="4" column="0" colspan="2">
<widget class="ArrowChooser" name="startArrow"/>
</item>
<item row="5" column="0">
<widget class="QLabel" name="startArrowScaleLabel">
<property name="text">
<string>Scaling:</string>
</property>
</widget>
</item>
<item row="5" column="1">
<widget class="QSpinBox" name="startArrowScale">
<property name="minimum">
<number>1</number>
</property>
<property name="maximum">
<number>300</number>
</property>
</widget>
</item>
<item row="5" column="3">
<widget class="QSpinBox" name="endArrowScale">
<property name="minimum">
<number>1</number>
</property>
<property name="maximum">
<number>300</number>
</property>
</widget>
</item>
<item row="5" column="2">
<widget class="QLabel" name="endArrowScaleLabel">
<property name="text">
<string>Scaling:</string>
</property>
</widget>
</item>
<item row="4" column="2" colspan="2">
<widget class="ArrowChooser" name="endArrow"/>
</item>
<item row="1" column="2" colspan="2">
<widget class="LineCombo" name="lineType"/>
</item>
<item row="0" column="2" colspan="2">
<widget class="ScComboBox" name="lineMode"/>
</item>
<item row="3" column="2" colspan="2">
<widget class="QLabel" name="endArrowLabel">
<property name="text">
<string>End Arrow:</string>
</property>
</widget>
</item>
<item row="6" column="0" colspan="2">
<widget class="QLabel" name="lineWidthLabel">
<property name="text">
<string>Line &amp;Width:</string>
</property>
</widget>
</item>
<item row="6" column="2" colspan="2">
<widget class="ScrSpinBox" name="lineWidth">
<property name="specialValueText">
<string>Hairline</string>
</property>
<property name="maximum">
<double>300.000000000000000</double>
</property>
</widget>
</item>
<item row="7" column="0" colspan="2">
<widget class="QLabel" name="lineJoinLabel">
<property name="text">
<string>Ed&amp;ges:</string>
</property>
</widget>
</item>
<item row="7" column="2" colspan="2">
<widget class="ScComboBox" name="lineJoinStyle"/>
</item>
<item row="8" column="0" colspan="2">
<widget class="QLabel" name="lineEndLabel">
<property name="text">
<string>&amp;Endings:</string>
</property>
</widget>
</item>
<item row="8" column="2" colspan="2">
<widget class="ScComboBox" name="lineEndStyle"/>
</item>
<item row="9" column="0" colspan="4">
<widget class="QStackedWidget" name="stackedWidget">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="currentIndex">
<number>0</number>
</property>
<widget class="QWidget" name="page">
<layout class="QVBoxLayout" name="lineStyleLayout">
<property name="spacing">
<number>2</number>
</property>
<property name="margin">
<number>0</number>
</property>
<item>
<widget class="QListWidget" name="lineStyles"/>
</item>
</layout>
</widget>
<widget class="QWidget" name="page_2">
<layout class="QVBoxLayout" name="verticalLayout_2">
<property name="spacing">
<number>2</number>
</property>
<property name="margin">
<number>0</number>
</property>
<item>
<widget class="QGroupBox" name="tableLineGroup">
<property name="title">
<string>Cell Lines</string>
</property>
<layout class="QVBoxLayout" name="tableLineLayout">
<item>
<widget class="QCheckBox" name="leftLine">
<property name="text">
<string>Line at the Left</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="rightLine">
<property name="text">
<string>Line at the Right</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="bottomLine">
<property name="text">
<string>Line at the Bottom</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="topLine">
<property name="text">
<string>Line at the Top</string>
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
</widget>
</item>
<item row="2" column="0" colspan="4">
<widget class="DashEditor" name="dashEditor">
<property name="minimumSize">
<size>
<width>0</width>
<height>10</height>
</size>
</property>
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
</widget>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>ScrSpinBox</class>
<extends>QDoubleSpinBox</extends>
<header>ui/scrspinbox.h</header>
</customwidget>
<customwidget>
<class>ScComboBox</class>
<extends>QComboBox</extends>
<header>ui/sccombobox.h</header>
</customwidget>
<customwidget>
<class>LineCombo</class>
<extends>QComboBox</extends>
<header>ui/linecombo.h</header>
</customwidget>
<customwidget>
<class>ArrowChooser</class>
<extends>QComboBox</extends>
<header>ui/arrowchooser.h</header>
</customwidget>
<customwidget>
<class>DashEditor</class>
<extends>QFrame</extends>
<header>ui/dasheditor.h</header>
<container>1</container>
</customwidget>
</customwidgets>
<resources/>
<connections/>
</ui>
/branches/ScribusOIF/scribus/scribus.cpp
3660,8 → 3660,7
propertiesPalette->textPal->paraStyleCombo->setDoc(doc);
propertiesPalette->textPal->charStyleCombo->setDoc(doc);
propertiesPalette->linePal->updateLineStyles();
propertiesPalette->linePal->startArrow->rebuildList(&doc->arrowStyles());
propertiesPalette->linePal->endArrow->rebuildList(&doc->arrowStyles());
propertiesPalette->linePal->updateArrowStyles();
symbolPalette->updateSymbolList();
if (!Mpa)
{
/branches/ScribusOIF/scribus/CMakeLists.txt
123,6 → 123,7
ui/prefs_documentitemattributesbase.ui
ui/printdialogbase.ui
ui/propertiespalette_imagebase.ui
ui/propertiespalette_linebase.ui
ui/propertiespalette_shapebase.ui
ui/propertiespalette_textbase.ui
ui/propertiespalette_xyzbase.ui
/branches/ScribusOIF/win32/vc8/Scribus.vcproj
11713,6 → 11713,10
>
</File>
<File
RelativePath="..\..\scribus\ui\ui_propertiespalette_linebase.h"
>
</File>
<File
RelativePath="..\..\scribus\ui\ui_propertiespalette_shapebase.h"
>
</File>
13039,6 → 13043,10
>
</File>
<File
RelativePath="..\..\scribus\ui\propertiespalette_linebase.ui"
>
</File>
<File
RelativePath="..\..\scribus\ui\propertiespalette_shapebase.ui"
>
</File>