758
758
layout23->addWidget( PM1 );
759
759
QSpacerItem* spacer7s = new QSpacerItem( 0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum );
760
760
layout23->addItem( spacer7s );
761
layout41c->addLayout( layout23, 0, 0, 1, 4 );
761
layout41c->addLayout( layout23, 1, 0, 1, 4 );
762
762
layout24 = new QHBoxLayout;
763
763
layout24->setSpacing( 3 );
764
764
layout24->setMargin( 0 );
775
775
layout24->addWidget( PM2 );
776
776
QSpacerItem* spacer7f = new QSpacerItem( 0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum );
777
777
layout24->addItem( spacer7f );
778
layout41c->addLayout( layout24, 1, 0, 1, 4 );
778
layout41c->addLayout( layout24, 0, 0, 1, 4 );
779
779
Layout1 = new QHBoxLayout;
780
780
Layout1->setSpacing( 0 );
781
781
Layout1->setMargin( 0 );
1558
1558
connect(DBottom, SIGNAL(valueChanged(double)), this, SLOT(NewTDist()));
1559
1559
connect(flopGroup, SIGNAL(buttonClicked( int )), this, SLOT(flop(int)));
1560
1560
connect(TabStack, SIGNAL(currentChanged(int)), this, SLOT(SelTab(int)));
1561
connect(StyledLine, SIGNAL(currentItemChanged(QListWidgetItem*, QListWidgetItem*)), this, SLOT(SetSTline(QListWidgetItem*)));
1561
connect(StyledLine, SIGNAL(itemClicked(QListWidgetItem*)), this, SLOT(SetSTline(QListWidgetItem*)));
1562
1562
connect(Fonts, SIGNAL(fontSelected(QString )), this, SLOT(NewTFont(QString)));
1563
1563
connect(TxFill, SIGNAL(activated(int)), this, SLOT(newTxtFill()));
1564
1564
connect(TxStroke, SIGNAL(activated(int)), this, SLOT(newTxtStroke()));
1605
1605
connect(optMarginRadioBoth, SIGNAL(clicked()), this, SLOT(setOpticalMargins()) );
1606
1606
connect(optMarginRadioLeft, SIGNAL(clicked()), this, SLOT(setOpticalMargins()) );
1607
1607
connect(optMarginRadioRight, SIGNAL(clicked()), this, SLOT(setOpticalMargins()) );
1608
// connect(optMarginResetButton, SIGNAL(activated(int)), this, SLOT(setOpticalMargins(int)) );
1608
connect(optMarginResetButton, SIGNAL(clicked()), this, SLOT(resetOpticalMargins()) );
1611
1611
connect(minWordTrackingSpinBox, SIGNAL(valueChanged(double)), this, SLOT(setMinWordTracking()) );
1677
1677
if (!m_ScMW || m_ScMW->ScriptRunning)
1679
if ((HaveDoc) && (HaveItem) && (t == idColorsItem))
1681
Cpal->setActGradient(CurItem->GrType);
1682
updateColorSpecialGradient();
1683
Cpal->gradEdit->Preview->fill_gradient = CurItem->fill_gradient;
1684
Cpal->gradEdit->Preview->updateDisplay();
1686
if ((HaveDoc) && (HaveItem))
1688
if (t == idShapeItem)
1689
DCol->setMaximum(qMax(qRound(CurItem->width() / qMax(CurItem->ColGap, 10.0)), 1));
1690
if (t == idImageItem)
1691
imagePageNumber->setMaximum(CurItem->pixm.imgInfo.numberOfPages);
1693
1679
// fix for #5991: Property Palette text input box focus stays even when on another tab
1694
1680
// Disable widgets in all pages except current one - PV
1705
1691
w->setEnabled(enable);
1694
// now restore the dis-/enabled settings of the current tab
1695
if ((HaveDoc) && (HaveItem))
1700
if ((CurItem->isTableItem) && (CurItem->isSingleSel))
1703
Xpos->setEnabled(false);
1704
Ypos->setEnabled(false);
1705
Rotation->setEnabled(false);
1709
LayerGroup->setEnabled(!setter);
1710
if ((CurItem->itemType() == PageItem::Line) && LMode)
1711
Rotation->setEnabled(false);
1713
Rotation->setEnabled(!((CurItem->isTableItem) && (CurItem->isSingleSel)));
1714
if (CurItem->asLine())
1716
keepFrameWHRatioButton->setEnabled(false);
1717
Height->setEnabled(LMode && !CurItem->locked());
1721
Height->setEnabled(true);
1722
keepFrameWHRatioButton->setEnabled(true);
1724
DoGroup->setEnabled(false);
1725
DoUnGroup->setEnabled(false);
1726
if (doc->m_Selection->count() > 1)
1728
bool isGroup = true;
1730
if (CurItem->Groups.count() != 0)
1731
firstElem = CurItem->Groups.top();
1732
for (int bx = 0; bx < doc->m_Selection->count(); ++bx)
1734
if (doc->m_Selection->itemAt(bx)->Groups.count() != 0)
1736
if (doc->m_Selection->itemAt(bx)->Groups.top() != firstElem)
1743
DoGroup->setEnabled(true);
1746
if (CurItem->isGroupControl)
1747
NameEdit->setEnabled(true);
1749
if ((CurItem->Groups.count() != 0) && (isGroup))
1750
DoUnGroup->setEnabled(true);
1753
else if (t == idShapeItem)
1755
DCol->setMaximum(qMax(qRound(CurItem->width() / qMax(CurItem->ColGap, 10.0)), 1));
1756
if (((CurItem->asTextFrame()) || (CurItem->asImageFrame())) && (!CurItem->ClipEdited) && ((CurItem->FrameType == 0) || (CurItem->FrameType == 2)))
1757
RoundRect->setEnabled(true);
1759
RoundRect->setEnabled ((CurItem->asPolygon()) && (!CurItem->ClipEdited) && ((CurItem->FrameType == 0) || (CurItem->FrameType == 2)));
1761
else if (t == idImageItem)
1763
imagePageNumber->setMaximum(CurItem->pixm.imgInfo.numberOfPages);
1764
setter = CurItem->ScaleType;
1765
if (CurItem->asLatexFrame())
1767
FreeScale->setEnabled(false);
1768
FrameScale->setEnabled(false);
1769
Aspect->setEnabled(false);
1770
imageXScaleSpinBox->setEnabled(false);
1771
imageYScaleSpinBox->setEnabled(false);
1772
imgDpiX->setEnabled(false);
1773
imgDpiY->setEnabled(false);
1777
imageXScaleSpinBox->setEnabled(setter);
1778
imageYScaleSpinBox->setEnabled(setter);
1779
imgDpiX->setEnabled(setter);
1780
imgDpiY->setEnabled(setter);
1781
Aspect->setEnabled(!setter);
1782
FreeScale->setEnabled(true);
1783
FrameScale->setEnabled(true);
1785
imageXOffsetSpinBox->setEnabled(setter);
1786
imageYOffsetSpinBox->setEnabled(setter);
1788
else if (t == idLineItem)
1790
if ((CurItem->asLine()) || (CurItem->asPolyLine()))
1792
startArrow->setEnabled(true);
1793
endArrow->setEnabled(true);
1797
startArrow->setEnabled(false);
1798
endArrow->setEnabled(false);
1800
if (CurItem->NamedLStyle.isEmpty())
1804
LStyle->setEnabled(setter);
1805
LSize->setEnabled(setter);
1806
LJoinStyle->setEnabled(setter);
1807
LEndStyle->setEnabled(setter);
1809
else if (t == idColorsItem)
1811
Cpal->setActGradient(CurItem->GrType);
1812
updateColorSpecialGradient();
1813
Cpal->gradEdit->Preview->fill_gradient = CurItem->fill_gradient;
1814
Cpal->gradEdit->Preview->updateDisplay();
1815
KnockOut->setChecked(!CurItem->doOverprint);
1816
Overprint->setChecked(CurItem->doOverprint);
1711
1821
void PropertiesPalette::setDoc(ScribusDoc *d)
1904
2014
setDoc(i->doc());
1906
disconnect(StyledLine, SIGNAL(currentItemChanged(QListWidgetItem*, QListWidgetItem*)), this, SLOT(SetSTline(QListWidgetItem*)));
2016
disconnect(StyledLine, SIGNAL(itemClicked(QListWidgetItem*)), this, SLOT(SetSTline(QListWidgetItem*)));
1907
2017
disconnect(NameEdit, SIGNAL(Leaved()), this, SLOT(NewName()));
1908
2018
disconnect(startArrow, SIGNAL(activated(int)), this, SLOT(setStartArrow(int )));
1909
2019
disconnect(endArrow, SIGNAL(activated(int)), this, SLOT(setEndArrow(int )));
1910
2020
disconnect(TabStack, SIGNAL(currentChanged(int)), this, SLOT(SelTab(int)));
2022
SelTab(TabStack->currentIndex());
1912
2024
HaveItem = false;
2016
2135
dashEditor->setDashValues(CurItem->dashes(), qMax(CurItem->lineWidth(), 0.001), CurItem->dashOffset());
2017
2136
dashEditor->show();
2019
connect(StyledLine, SIGNAL(currentItemChanged(QListWidgetItem*, QListWidgetItem*)), this, SLOT(SetSTline(QListWidgetItem*)));
2138
connect(StyledLine, SIGNAL(itemClicked(QListWidgetItem*)), this, SLOT(SetSTline(QListWidgetItem*)));
2020
2139
connect(NameEdit, SIGNAL(Leaved()), this, SLOT(NewName()));
2021
2140
connect(startArrow, SIGNAL(activated(int)), this, SLOT(setStartArrow(int )));
2022
2141
connect(endArrow, SIGNAL(activated(int)), this, SLOT(setEndArrow(int )));
3136
3263
int omt(ParagraphStyle::OM_None);
3137
3264
// if (optMarginCheckLeftProtruding->isChecked()) omt+=ParagraphStyle::OM_LeftProtruding;
3138
if (optMarginRadioBoth->isChecked()) omt =ParagraphStyle::OM_Default;
3139
else if (optMarginRadioLeft->isChecked()) omt = ParagraphStyle::OM_LeftHangingPunct;
3140
else if (optMarginRadioRight->isChecked()) omt = ParagraphStyle::OM_RightHangingPunct;
3265
if (optMarginRadioBoth->isChecked())
3266
omt =ParagraphStyle::OM_Default;
3267
else if (optMarginRadioLeft->isChecked())
3268
omt = ParagraphStyle::OM_LeftHangingPunct;
3269
else if (optMarginRadioRight->isChecked())
3270
omt = ParagraphStyle::OM_RightHangingPunct;
3142
3272
doc->itemSelection_SetOpticalMargins(omt);
3275
void PropertiesPalette::resetOpticalMargins()
3277
if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->ScriptRunning)
3279
doc->itemSelection_resetOpticalMargins();
3145
3282
void PropertiesPalette::updateOpticalMargins(const ParagraphStyle & pStyle)
3422
3563
if (keepFrameWHRatioButton->isChecked())
3424
3565
// m_ScMW->view->frameResizeHandle = 1;
3425
doc->scaleGroup(w / gw, w / gw);
3566
doc->scaleGroup(w / gw, w / gw, false);
3426
3567
setBH(w, (w / gw) * gh);
3430
3571
// m_ScMW->view->frameResizeHandle = 6;
3431
doc->scaleGroup(w / gw, 1.0);
3572
doc->scaleGroup(w / gw, 1.0, false);
3432
3573
doc->m_Selection->getGroupRect(&gx, &gy, &gw, &gh);
3530
3671
if (keepFrameWHRatioButton->isChecked())
3532
3673
// m_ScMW->view->frameResizeHandle = 1;
3533
doc->scaleGroup(h / gh, h / gh);
3674
doc->scaleGroup(h / gh, h / gh, false);
3534
3675
setBH((h / gh) * gw, h);
3538
3679
// m_ScMW->view->frameResizeHandle = 5;
3539
doc->scaleGroup(1.0, h / gh);
3680
doc->scaleGroup(1.0, h / gh, false);
3540
3681
doc->m_Selection->getGroupRect(&gx, &gy, &gw, &gh);
4328
4469
if ((CurItem->itemType() == PageItem::PolyLine) || (CurItem->itemType() == PageItem::PathText))
4472
if (UndoManager::undoEnabled())
4474
// Store shape info in this form:
4475
// CHANGE_SHAPE_TYPE - ID of the undo operation
4476
// OLD_FRAME_TYPE - original frame type
4477
// NEW_FRAME_TYPE - change of frame type
4478
// binary QPair<FPointArray, FPointArray> - .first original shape, .second new shape
4479
ItemState<QPair<FPointArray,FPointArray> > *is = new ItemState<QPair<FPointArray,FPointArray> >(Um::ChangeShapeType, "", Um::IBorder);
4480
is->set("CHANGE_SHAPE_TYPE", "change_shape_type");
4481
is->set("OLD_FRAME_TYPE", CurItem->FrameType);
4482
is->set("NEW_FRAME_TYPE", f);
4483
// HACK: this is propably Evil Code (TM). I have to find better way...
4484
FPointArray newShape;
4486
for (int i = 0; i < c/2; ++i)
4488
double x = CurItem->width() * vals[ix] / 100.0;
4489
double y = CurItem->height() * vals[ix+1] / 100.0;
4490
newShape.addPoint(x, y);
4493
// HACK: end of hack
4494
is->setItem(qMakePair(CurItem->shape(), newShape));
4495
UndoManager::instance()->action(CurItem, is);
4991
5155
rightLabel->setText( tr("&Right:"));
4992
5156
TabsButton->setText( tr("T&abulators..."));
4993
5157
// Distance2->setTitle( tr("Path Text Properties"));
5158
int oldPathType = pathTextType->currentIndex();
4994
5159
pathTextType->clear();
4995
5160
pathTextType->addItem( tr("Default"));
4996
5161
pathTextType->addItem( tr("Stair Step"));
4997
5162
pathTextType->addItem( tr("Skew"));
5163
pathTextType->setCurrentIndex(oldPathType);
4998
5164
flippedPathText->setText( tr("Flip Text"));
4999
5165
showcurveCheckBox->setText( tr("Show Curve"));
5000
5166
pathTextTypeLabel->setText( tr("Type:"));
5066
5232
// actList[0]->setText( tr("Fixed Linespacing"));
5067
5233
// actList[1]->setText( tr("Automatic Linespacing"));
5068
5234
// actList[2]->setText( tr("Align to Baseline Grid"));
5235
int oldLineSpacingMode = lineSpacingModeCombo->currentIndex();
5236
lineSpacingModeCombo->clear();
5069
5237
lineSpacingModeCombo->addItem( tr("Fixed Linespacing"));
5070
5238
lineSpacingModeCombo->addItem( tr("Automatic Linespacing"));
5071
5239
lineSpacingModeCombo->addItem( tr("Align to Baseline Grid"));
5240
lineSpacingModeCombo->setCurrentIndex(oldLineSpacingMode);
5072
5241
int oldMonitorI=MonitorI->currentIndex();
5073
5242
MonitorI->clear();
5074
5243
MonitorI->addItem( tr("Perceptual"));