Subversion Repositories Scribus

Compare Revisions

Ignore whitespace Rev 6018 → Rev 6019

/branches/Version13x/Scribus/scribus/stylemanager.cpp
210,7 → 210,7
if (styles[i].second == QString::null)
new StyleViewItem(rootItem, styles[i].first, item_->typeName());
else // TODO Search the parent and insert accordingly
;
new StyleViewItem(rootItem, styles[i].first, item_->typeName());
}
 
if (widget_)
310,6 → 310,8
}
if (sitem)
{
if (item_ == sitem)
return; // no need to update anything already selected style
item_ = sitem;
if (widget_)
{ // remove the old style type's widget
/branches/Version13x/Scribus/scribus/smpstylewbase.ui
154,7 → 154,7
<cstring>distancesBox</cstring>
</property>
<property name="frameShape">
<enum>NoFrame</enum>
<enum>GroupBoxPanel</enum>
</property>
<property name="frameShadow">
<enum>Plain</enum>
168,7 → 168,7
<cstring>dropCapsBox</cstring>
</property>
<property name="frameShape">
<enum>NoFrame</enum>
<enum>GroupBoxPanel</enum>
</property>
<property name="title">
<string>Drop Caps</string>
196,7 → 196,7
<cstring>TabPage</cstring>
</property>
<attribute name="title">
<string>Character Style</string>
<string>Ch&amp;aracter Style</string>
</attribute>
<vbox>
<property name="name">
289,16 → 289,16
<property name="sizeHint">
<size>
<width>21</width>
<height>16</height>
<height>5</height>
</size>
</property>
</spacer>
<widget class="QGroupBox">
<property name="name">
<cstring>groupBox7</cstring>
<cstring>characterBox</cstring>
</property>
<property name="frameShape">
<enum>NoFrame</enum>
<enum>GroupBoxPanel</enum>
</property>
<property name="frameShadow">
<enum>Plain</enum>
/branches/Version13x/Scribus/scribus/stylemanagerbase.ui
1,6 → 1,6
<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
<class>SMBase</class>
<widget class="QDialog">
<widget class="ScrPaletteBase">
<property name="name">
<cstring>SMBase</cstring>
</property>
12,7 → 12,7
<x>0</x>
<y>0</y>
<width>550</width>
<height>432</height>
<height>401</height>
</rect>
</property>
<property name="minimumSize">
24,9 → 24,6
<property name="caption">
<string>Style Manager</string>
</property>
<property name="sizeGripEnabled">
<bool>false</bool>
</property>
<vbox>
<property name="name">
<cstring>unnamed</cstring>
249,10 → 246,10
<cursor>0</cursor>
</property>
<property name="text">
<string>&lt;&lt; &amp;Done</string>
<string>&lt;&lt; Do&amp;ne</string>
</property>
<property name="accel">
<string>Alt+D</string>
<string>Alt+N</string>
</property>
<property name="autoDefault">
<bool>true</bool>
318,6 → 315,30
</widget>
</vbox>
</widget>
<customwidgets>
<customwidget>
<class>ScrPaletteBase</class>
<header location="local">scrpalettebase.h</header>
<sizehint>
<width>-1</width>
<height>-1</height>
</sizehint>
<container>1</container>
<sizepolicy>
<hordata>5</hordata>
<verdata>5</verdata>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
<pixmap>image0</pixmap>
<property type="String">property</property>
</customwidget>
</customwidgets>
<images>
<image name="image0">
<data format="PNG" length="1002">89504e470d0a1a0a0000000d4948445200000016000000160806000000c4b46c3b000003b149444154388dad945f4c5b551cc73fe7dc4b7b4bcba0762d45c43114323599ee6192609c51d883892ce083f1718b3ebb185f8dc91e972cf39d2d2a2f1af664b6f1e0fe3863a0718969700eb0c52142da0242a1bd6d696f7bcff101585203ceb8fd9ece39f99dcff9fe7edf939f88c562ec465f5f9fe609442c161362173c3e3eae7b7a7ac8e7f36432196cdbfe4f907c3e4f2291201e8fe338cec3737357e9e8e828aded1e229d650e1f2d51754b082110124c13a4dc5ea341eb9dc284c0558a853f3ce8cb0677ef500fde7d39d2596679e326597b8e9abb85d7a770ab16ab6983ec5a05b487a70e36f0f4e10afe408d6a558310980108478dba4a1e8233990c5d474b64ed39aa3a8fe5f3317fbf81dbd70bccfeb205947632fd74f6589c1c6ea2f70d03a58ba0c1f2c9bdc1b66de3b8256a6e11cbe7e3ee1d181b590124fe2693aeee08d223c82c3a2c24b7b874bec8f26288774f7bd054504aef0dde6e99c0eb83f9fb266323cb80a27fb0958141836044605a2ee5523393371cc646fee2da37195aa35d0c0c5b4859ac03d7e91712dcaac5adab3650a3ff9d08ef7dd8404bb48869e5d958b5b87dadc4c9a1464e9f0d0326df7ebd86bd2e310cb1bf62d384d59441f2d70a070e1c60e09489929b988681bdd9cc97170bcc4c65595f71f8e0e3301337fc24a7732467831875a47f289652b0be5e4151e6d07316c1b0c0340d8ab92023e76d66a6b2840e36d2fb7a13fee632475e6edc367ea98a90fb98b7dd6310ca0328a44761582e1bab41befabcc0ec940d28bc5e93b68e064cab84e1d9beaeb48934eac1f53b01c1b000fca496aa54b61a99fcde61662a4b4b4b23d1680be9d426173e4df3602a48ea411989a4fd590f52a8fd156b05ed9d350e3defe3cfdf4b4c7ce770ea7d3fb9f520afbe1620daeee5c26735d20b9b9cfb6811a754a439e4e5c5639a4caa1e5caf586bfc0197b78702005cb9b4cae4cd3267ce8638fe964bd72b393e39d74928d242617303a756a37f284447770dcdbffc6384a05a85de1306e9a52057c7527c7131c3c42d3f475eb2303c82d4fc3276d6811db37efeb148723082d9b08f79f97c1e5729109a9a28307cc622d2d6cdf52b2b24efe548dedb00142009862cfa879ee1a71f6cec928353511472fbf4389148b0b0e0c108081412458dfe21c9f11351e67e7358595468246d1d1e5e38a6e9e851bc39d84ab502a669331dafec0d8ec7e3e8cb06e1a881d727d1ae40180a434a8c9db129a54126ad48a7358c2b4c5352c8c374bcccdab2bb37d8719cba79fab8211f9df218e0582c261e95f8bfc04f1a1e8bc5c4dfe0a190172af6a9690000000049454e44ae426082</data>
</image>
</images>
<connections>
<connection>
<sender>buttonOk</sender>
326,12 → 347,6
<slot>slotOk()</slot>
</connection>
<connection>
<sender>buttonCancel</sender>
<signal>clicked()</signal>
<receiver>SMBase</receiver>
<slot>reject()</slot>
</connection>
<connection>
<sender>applyButton</sender>
<signal>clicked()</signal>
<receiver>SMBase</receiver>
361,6 → 376,9
<tabstop>applyButton</tabstop>
<tabstop>buttonCancel</tabstop>
</tabstops>
<includes>
<include location="local" impldecl="in declaration">scrpalettebase.h</include>
</includes>
<slots>
<slot access="private">slotNew()</slot>
<slot access="private">slotClone()</slot>
373,4 → 391,7
<slot access="private">itemClicked(QListViewItem*)</slot>
</slots>
<layoutdefaults spacing="6" margin="11"/>
<includehints>
<includehint>scrpalettebase.h</includehint>
</includehints>
</UI>
/branches/Version13x/Scribus/scribus/smtextstyles.h
33,6 → 33,7
class CharStyle;
class ParagraphStyle;
class ScribusDoc;
class SMCStylePage;
 
class SMPStyleWidget : public PStyleWBase
{
41,12 → 42,14
SMPStyleWidget();
~SMPStyleWidget();
 
void show(ParagraphStyle &pstyle);
 
private:
QGridLayout *distancesBoxLayout;
QGridLayout *dropCapsBoxLayout;
QVBoxLayout *tabsBoxLayout;
 
QComboBox *linespacingCombo;
QComboBox *lineSpacingMode_;
 
QLabel *pixmapLabel0;
QLabel *pixmapLabel1;
56,20 → 59,22
QLabel *capLabel1;
QLabel *capLabel2;
 
MSpinBox *LineSpVal;
MSpinBox *lineSpacing_;
MSpinBox *fontBase;
MSpinBox *fontKern;
MSpinBox *spaceAbove;
MSpinBox *spaceBelow;
QSpinBox *DropLines;
MSpinBox *DropDist;
MSpinBox *spaceAbove_;
MSpinBox *spaceBelow_;
QSpinBox *dropCapLines_;
MSpinBox *dropCapOffset_;
 
AlignSelect *alignSelect;
Tabruler *tabList;
AlignSelect *alignement_;
Tabruler *tabList_;
SMCStylePage *cpage;
 
void setupDistances();
void setupDropCaps();
void setupTabs();
void setupCharStyle();
};
 
class SMParagraphStyle : public StyleItem
91,17 → 96,20
 
private:
SMPStyleWidget *pwidget_;
StyleSet<ParagraphStyle> tmpPStyles_;
ScribusDoc *doc_;
 
void updateStyleList();
};
 
class SMCStyleWidget : public CStyleWBase
class SMCStylePage : public CStylePBase
{
Q_OBJECT
public:
SMCStyleWidget();
~SMCStyleWidget();
SMCStylePage(QWidget *parent = 0);
~SMCStylePage();
 
void show(CharStyle &cstyle);
 
private:
QVBoxLayout *characterBoxLayout;
QHBoxLayout *layout7;
110,18 → 118,18
QHBoxLayout *layout5;
QHBoxLayout *layout6;
 
FontComboH *FontC;
StyleSelect *EffeS;
ScComboBox *TxFill;
ShadeButton *PM2;
ScComboBox *TxStroke;
ShadeButton *PM1;
FontComboH *fontFace_;
StyleSelect *effects_;
ScComboBox *fillColor_;
ShadeButton *fillShade_;
ScComboBox *strokeColor_;
ShadeButton *strokeShade_;
 
MSpinBox *SizeC;
MSpinBox *fontHScale;
MSpinBox *fontVScale;
MSpinBox *fontKern;
MSpinBox *fontBase;
MSpinBox *fontSize_;
MSpinBox *fontHScale_;
MSpinBox *fontVScale_;
MSpinBox *tracking_;
MSpinBox *baselineOffset_;
 
QLabel *TextF2;
QLabel *pixmapLabel3;
136,8 → 144,6
QSpacerItem *spacer1;
QSpacerItem *spacer2;
QSpacerItem *spacer4;
 
void setupCharacter();
};
 
class SMCharacterStyle : public StyleItem
158,7 → 164,9
void nameChanged(const QString &newName);
 
private:
SMCStyleWidget *cwidget_;
QTabWidget *widget_;
SMCStylePage *page_;
ScribusDoc *doc_;
};
 
#endif
/branches/Version13x/Scribus/scribus/smcstylewbase.ui
1,152 → 1,134
<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
<class>CStyleWBase</class>
<class>CStylePBase</class>
<widget class="QWidget">
<property name="name">
<cstring>CStyleWBase</cstring>
<cstring>CStylePBase</cstring>
</property>
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>434</width>
<height>299</height>
<width>445</width>
<height>342</height>
</rect>
</property>
<property name="caption">
<string>Form2</string>
<string>Form1</string>
</property>
<vbox>
<property name="name">
<cstring>unnamed</cstring>
</property>
<widget class="QTabWidget">
<spacer>
<property name="name">
<cstring>tabWidget</cstring>
<cstring>spacer10_2</cstring>
</property>
<widget class="QWidget">
<property name="orientation">
<enum>Vertical</enum>
</property>
<property name="sizeType">
<enum>Fixed</enum>
</property>
<property name="sizeHint">
<size>
<width>21</width>
<height>16</height>
</size>
</property>
</spacer>
<widget class="QLayoutWidget">
<property name="name">
<cstring>layout18</cstring>
</property>
<hbox>
<property name="name">
<cstring>tab</cstring>
<cstring>unnamed</cstring>
</property>
<attribute name="title">
<string>Properties</string>
</attribute>
<vbox>
<spacer>
<property name="name">
<cstring>unnamed</cstring>
<cstring>spacer4</cstring>
</property>
<spacer>
<property name="name">
<cstring>spacer10_2</cstring>
</property>
<property name="orientation">
<enum>Vertical</enum>
</property>
<property name="sizeType">
<enum>Fixed</enum>
</property>
<property name="sizeHint">
<size>
<width>21</width>
<height>16</height>
</size>
</property>
</spacer>
<widget class="QLayoutWidget">
<property name="name">
<cstring>layout18</cstring>
</property>
<hbox>
<property name="name">
<cstring>unnamed</cstring>
</property>
<spacer>
<property name="name">
<cstring>spacer4</cstring>
</property>
<property name="orientation">
<enum>Horizontal</enum>
</property>
<property name="sizeType">
<enum>Fixed</enum>
</property>
<property name="sizeHint">
<size>
<width>30</width>
<height>20</height>
</size>
</property>
</spacer>
<widget class="QLabel">
<property name="name">
<cstring>textLabel1</cstring>
</property>
<property name="text">
<string>Parent Style</string>
</property>
</widget>
<widget class="QComboBox">
<property name="name">
<cstring>parentCombo</cstring>
</property>
<property name="sizePolicy">
<sizepolicy>
<hsizetype>1</hsizetype>
<vsizetype>0</vsizetype>
<horstretch>5</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
<spacer>
<property name="name">
<cstring>spacer7</cstring>
</property>
<property name="orientation">
<enum>Horizontal</enum>
</property>
<property name="sizeType">
<enum>Expanding</enum>
</property>
<property name="sizeHint">
<size>
<width>70</width>
<height>21</height>
</size>
</property>
</spacer>
</hbox>
</widget>
<spacer>
<property name="name">
<cstring>spacer10</cstring>
</property>
<property name="orientation">
<enum>Vertical</enum>
</property>
<property name="sizeType">
<enum>Fixed</enum>
</property>
<property name="sizeHint">
<size>
<width>21</width>
<height>16</height>
</size>
</property>
</spacer>
<widget class="QFrame">
<property name="name">
<cstring>characterBox</cstring>
</property>
<property name="frameShape">
<enum>NoFrame</enum>
</property>
<property name="frameShadow">
<enum>Plain</enum>
</property>
</widget>
</vbox>
</widget>
<property name="orientation">
<enum>Horizontal</enum>
</property>
<property name="sizeType">
<enum>Fixed</enum>
</property>
<property name="sizeHint">
<size>
<width>30</width>
<height>20</height>
</size>
</property>
</spacer>
<widget class="QLabel">
<property name="name">
<cstring>textLabel1</cstring>
</property>
<property name="text">
<string>Parent Style</string>
</property>
</widget>
<widget class="QComboBox">
<property name="name">
<cstring>parentCombo</cstring>
</property>
<property name="sizePolicy">
<sizepolicy>
<hsizetype>1</hsizetype>
<vsizetype>0</vsizetype>
<horstretch>5</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
<spacer>
<property name="name">
<cstring>spacer7</cstring>
</property>
<property name="orientation">
<enum>Horizontal</enum>
</property>
<property name="sizeType">
<enum>Expanding</enum>
</property>
<property name="sizeHint">
<size>
<width>70</width>
<height>21</height>
</size>
</property>
</spacer>
</hbox>
</widget>
<spacer>
<property name="name">
<cstring>spacer10</cstring>
</property>
<property name="orientation">
<enum>Vertical</enum>
</property>
<property name="sizeType">
<enum>Fixed</enum>
</property>
<property name="sizeHint">
<size>
<width>21</width>
<height>16</height>
</size>
</property>
</spacer>
<widget class="QFrame">
<property name="name">
<cstring>characterBox</cstring>
</property>
<property name="frameShape">
<enum>NoFrame</enum>
</property>
<property name="frameShadow">
<enum>Plain</enum>
</property>
</widget>
</vbox>
</widget>
<layoutdefaults spacing="6" margin="11"/>
/branches/Version13x/Scribus/scribus/smtextstyles.cpp
29,6 → 29,7
#include <qspinbox.h>
#include <qframe.h>
#include <qpixmap.h>
#include <qtabwidget.h>
 
SMPStyleWidget::SMPStyleWidget()
{
35,6 → 36,7
setupDistances();
setupDropCaps();
setupTabs();
setupCharStyle();
}
 
void SMPStyleWidget::setupDistances()
47,11 → 49,11
distancesBoxLayout->setSpacing( 5 );
distancesBoxLayout->setMargin( 10 );
 
linespacingCombo = new QComboBox(distancesBox, "linespacingCombo");
linespacingCombo->insertItem(tr("Fixed Linespacing"));
linespacingCombo->insertItem(tr("Automatic Linespacing"));
linespacingCombo->insertItem(tr("Align to Baseline Grid"));
distancesBoxLayout->addMultiCellWidget(linespacingCombo, 0, 0, 1, 3);
lineSpacingMode_ = new QComboBox(distancesBox, "linespacingCombo");
lineSpacingMode_->insertItem(tr("Fixed Linespacing"));
lineSpacingMode_->insertItem(tr("Automatic Linespacing"));
lineSpacingMode_->insertItem(tr("Align to Baseline Grid"));
distancesBoxLayout->addMultiCellWidget(lineSpacingMode_, 0, 0, 1, 3);
 
pixmapLabel0 = new QLabel(distancesBox, "pixmapLabel0");
pixmapLabel0->setMinimumSize(QSize(22,22));
59,9 → 61,9
pixmapLabel0->setPixmap(loadIcon("linespacing2.png"));
distancesBoxLayout->addWidget(pixmapLabel0, 1, 0);
 
LineSpVal = new MSpinBox(1, 300, distancesBox, 1 );
LineSpVal->setSuffix(tr( " pt" ));
distancesBoxLayout->addWidget(LineSpVal, 1,1);
lineSpacing_ = new MSpinBox(1, 300, distancesBox, 1 );
lineSpacing_->setSuffix(tr( " pt" ));
distancesBoxLayout->addWidget(lineSpacing_, 1,1);
 
// pixmapLabel1 = new QLabel(distancesBox, "pixmapLabel2" );
// pixmapLabel1->setMinimumSize(QSize(22, 22));
77,20 → 79,20
pixmapLabel3->setPixmap( loadIcon("above.png") );
distancesBoxLayout->addWidget( pixmapLabel3, 1, 2 );
 
spaceAbove = new MSpinBox( 0, 300, distancesBox, 1 );
spaceAbove->setSuffix( tr( " pt" ) );
distancesBoxLayout->addWidget( spaceAbove, 1, 3 );
spaceAbove_ = new MSpinBox( 0, 300, distancesBox, 1 );
spaceAbove_->setSuffix( tr( " pt" ) );
distancesBoxLayout->addWidget( spaceAbove_, 1, 3 );
 
pixmapLabel4 = new QLabel( "", distancesBox, "TextLabel1_2_3" );
pixmapLabel4->setPixmap( loadIcon("below.png") );
distancesBoxLayout->addWidget( pixmapLabel4, 2, 2 );
 
spaceBelow = new MSpinBox( 0, 300, distancesBox, 1 );
spaceBelow->setSuffix( tr( " pt" ) );
distancesBoxLayout->addWidget( spaceBelow, 2, 3 );
spaceBelow_ = new MSpinBox( 0, 300, distancesBox, 1 );
spaceBelow_->setSuffix( tr( " pt" ) );
distancesBoxLayout->addWidget( spaceBelow_, 2, 3 );
 
alignSelect = new AlignSelect(distancesBox);
distancesBoxLayout->addMultiCellWidget(alignSelect, 3,3,1,3);
alignement_ = new AlignSelect(distancesBox);
distancesBoxLayout->addMultiCellWidget(alignement_, 3,3,1,3);
}
 
void SMPStyleWidget::setupDropCaps()
103,18 → 105,18
dropCapsBoxLayout = new QGridLayout(dropCapsBox->layout());
dropCapsBoxLayout->setAlignment(Qt::AlignTop);
 
DropLines = new QSpinBox(dropCapsBox, "DropLines");
DropLines->setMinValue(2);
DropLines->setMaxValue(20);
capLabel1 = new QLabel(DropLines, tr("&Lines:"), dropCapsBox, "CapLabel");
dropCapLines_ = new QSpinBox(dropCapsBox, "DropLines");
dropCapLines_->setMinValue(2);
dropCapLines_->setMaxValue(20);
capLabel1 = new QLabel(dropCapLines_, tr("&Lines:"), dropCapsBox, "CapLabel");
dropCapsBoxLayout->addWidget(capLabel1, 0, 0);
dropCapsBoxLayout->addWidget(DropLines, 0, 1);
dropCapsBoxLayout->addWidget(dropCapLines_, 0, 1);
 
DropDist = new MSpinBox(-3000, 3000, dropCapsBox, 1);
DropDist->setSuffix(tr(" pt"));
capLabel2 = new QLabel(DropLines, tr("Distance from Text:"), dropCapsBox, "CapLabel2");
dropCapOffset_ = new MSpinBox(-3000, 3000, dropCapsBox, 1);
dropCapOffset_->setSuffix(tr(" pt"));
capLabel2 = new QLabel(dropCapLines_, tr("Distance from Text:"), dropCapsBox, "CapLabel2");
dropCapsBoxLayout->addWidget(capLabel2, 1, 0);
dropCapsBoxLayout->addWidget(DropDist, 1, 1);
dropCapsBoxLayout->addWidget(dropCapOffset_, 1, 1);
}
 
void SMPStyleWidget::setupTabs()
128,10 → 130,38
tabsBoxLayout->setSpacing( 5 );
tabsBoxLayout->setMargin( 10 );
 
tabList = new Tabruler(tabsBox);
tabsBoxLayout->addWidget( tabList );
tabList_ = new Tabruler(tabsBox);
tabsBoxLayout->addWidget( tabList_ );
}
 
void SMPStyleWidget::setupCharStyle()
{
characterBox->setColumns(3);
characterBox->setInsideMargin(5);
characterBox->setInsideSpacing(5);
cpage = new SMCStylePage(characterBox);
}
 
void SMPStyleWidget::show(ParagraphStyle &pstyle)
{
lineSpacingMode_->setCurrentItem(pstyle.lineSpacingMode());
lineSpacing_->setValue(pstyle.lineSpacing());
alignement_->setStyle(pstyle.alignment());
tabList_->setFirstLineData(pstyle.firstIndent());
tabList_->setLeftIndentData(pstyle.leftMargin());
tabList_->setRightIndentData(pstyle.rightMargin());
spaceAbove_->setValue(pstyle.gapBefore());
spaceBelow_->setValue(pstyle.gapAfter());
dropCapsBox->setChecked(pstyle.hasDropCap());
dropCapLines_->setValue(pstyle.dropCapLines());
dropCapOffset_->setValue(pstyle.dropCapOffset());
 
// ASK Avox!
// bool useBaselineGrid() const { return BaseAdj==NOVALUE && parent()? inh().useBaselineGrid() : BaseAdj > 0; }
 
cpage->show(pstyle.charStyle());
}
 
SMPStyleWidget::~SMPStyleWidget()
{
153,7 → 183,6
Q_CHECK_PTR(pwidget_);
}
 
Q_ASSERT(pwidget_);
return pwidget_->tabWidget;
}
 
166,7 → 195,6
{
Q_ASSERT(doc);
doc_ = doc;
// tmpPStyles_ = doc_->docParagraphStyles;
}
 
QValueList<StyleName> SMParagraphStyle::styles()
173,19 → 201,39
{
QValueList<StyleName> tmpList;
 
if (!doc_ || doc_->docParagraphStyles.count() < 6)
return tmpList;
if (!doc_)
return tmpList; // no doc available
 
for (uint x = 5; x < doc_->docParagraphStyles.count(); ++x)
tmpList << StyleName(doc_->docParagraphStyles[x].name(),
doc_->docParagraphStyles[x].parent() ? doc_->docParagraphStyles[x].parent()->name() : QString::null);
StyleSet<ParagraphStyle> &tmp = doc_->docParagraphStyles;
for (uint i = 0; i < tmp.count(); ++i)
{
if (tmp[i].hasName())
{
QString styleName = tmp[i].name();
QString parentName = QString::null;
 
if (tmp[i].hasParent() && tmp[i].parent()->hasName())
parentName = tmp[i].parent()->displayName();
 
tmpList << StyleName(styleName, parentName);
}
}
 
return tmpList;
}
 
void SMParagraphStyle::selected(const QStringList &styleNames)
{
 
if (styleNames.count() == 1)
{
int index = doc_->docParagraphStyles.find(styleNames[0]);
if (index > -1)
pwidget_->show(doc_->docParagraphStyles[index]);
}
else // more than one item selected do the magic tricks here
{
}
}
 
QString SMParagraphStyle::fromSelection() const
223,27 → 271,22
/******************************************************************************/
/******************************************************************************/
 
SMCStyleWidget::SMCStyleWidget()
SMCStylePage::SMCStylePage(QWidget *parent) : CStylePBase(parent)
{
setupCharacter();
}
 
void SMCStyleWidget::setupCharacter()
{
characterBoxLayout = new QVBoxLayout(characterBox);
characterBoxLayout->setAlignment( Qt::AlignLeft );
characterBoxLayout->setSpacing( 5 );
characterBoxLayout->setMargin( 10 );
 
FontC = new FontComboH(characterBox);
characterBoxLayout->addWidget( FontC );
fontFace_ = new FontComboH(characterBox);
characterBoxLayout->addWidget( fontFace_ );
 
characterBoxLayout->addSpacing( 10 );
 
layout7 = new QHBoxLayout( 0, 0, 5, "layout7");
SizeC = new MSpinBox( 1, 2048, characterBox, 1 );
SizeC->setMinimumSize( QSize( 70, 22 ) );
SizeC->setSuffix( tr( " pt" ) );
fontSize_ = new MSpinBox( 1, 2048, characterBox, 1 );
fontSize_->setMinimumSize( QSize( 70, 22 ) );
fontSize_->setSuffix( tr( " pt" ) );
 
TextF2 = new QLabel( "" ,characterBox, "TextF2" );
TextF2->setPixmap(loadIcon("Zeichen.xpm"));
250,7 → 293,7
TextF2->setMinimumSize( QSize( 22, 22 ) );
TextF2->setMaximumSize( QSize( 22, 22 ) );
layout7->addWidget( TextF2 );
layout7->addWidget( SizeC );
layout7->addWidget( fontSize_ );
 
pixmapLabel3_3 = new QLabel( characterBox, "pixmapLabel3_3" );
pixmapLabel3_3->setMinimumSize( QSize( 22, 22 ) );
258,9 → 301,9
pixmapLabel3_3->setPixmap( loadIcon("textkern.png") );
layout7->addWidget(pixmapLabel3_3);
 
fontKern = new MSpinBox( -300, 300, characterBox, 1 );
fontKern->setSuffix( tr( " %" ) );
layout7->addWidget(fontKern);
tracking_ = new MSpinBox( -300, 300, characterBox, 1 );
tracking_->setSuffix( tr( " %" ) );
layout7->addWidget(tracking_);
 
pixmapLabel2 = new QLabel( characterBox, "pixmapLabel2" );
268,9 → 311,9
pixmapLabel2->setMaximumSize( QSize( 22, 22 ) );
pixmapLabel2->setPixmap( loadIcon("textbase.png") );
layout7->addWidget( pixmapLabel2 );
fontBase = new MSpinBox( -100, 100, characterBox, 1 );
fontBase->setSuffix( tr( " %" ) );
layout7->addWidget( fontBase );
baselineOffset_ = new MSpinBox( -100, 100, characterBox, 1 );
baselineOffset_->setSuffix( tr( " %" ) );
layout7->addWidget( baselineOffset_ );
layout7->addStretch(10);
characterBoxLayout->addLayout( layout7 );
 
282,9 → 325,9
pixmapLabel3->setPixmap( loadIcon("textscaleh.png") );
layout8->addWidget( pixmapLabel3 );
 
fontHScale = new MSpinBox( 10, 400, characterBox, 1 );
fontHScale->setSuffix( tr( " %" ) );
layout8->addWidget( fontHScale );
fontHScale_ = new MSpinBox( 10, 400, characterBox, 1 );
fontHScale_->setSuffix( tr( " %" ) );
layout8->addWidget( fontHScale_ );
 
pixmapLabel3_2 = new QLabel( "", characterBox, "pixmapLabel3_2" );
pixmapLabel3_2->setMinimumSize( QSize( 22, 22 ) );
292,9 → 335,9
pixmapLabel3_2->setPixmap( loadIcon("textscalev.png") );
layout8->addWidget( pixmapLabel3_2 );
 
fontVScale = new MSpinBox( 10, 400, characterBox, 1 );
fontVScale->setSuffix( tr( " %" ) );
layout8->addWidget( fontVScale );
fontVScale_ = new MSpinBox( 10, 400, characterBox, 1 );
fontVScale_->setSuffix( tr( " %" ) );
layout8->addWidget( fontVScale_ );
layout8->addStretch(10);
characterBoxLayout->addLayout( layout8 );
 
301,8 → 344,8
characterBoxLayout->addSpacing( 10 );
 
layout9a = new QHBoxLayout( 0, 0, 0, "layout9");
EffeS = new StyleSelect(characterBox);
layout9a->addWidget( EffeS );
effects_ = new StyleSelect(characterBox);
layout9a->addWidget( effects_ );
 
spacer1 = new QSpacerItem( 0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum );
layout9a->addItem( spacer1 );
315,8 → 358,8
FillIcon->setPixmap(loadIcon("fill.png"));
layout5->addWidget( FillIcon );
 
TxFill = new ScComboBox( false, characterBox, "TxFill" );
layout5->addWidget( TxFill );
fillColor_ = new ScComboBox( false, characterBox, "TxFill" );
layout5->addWidget( fillColor_ );
 
pixmapLabel3_20 = new QLabel( characterBox, "pixmapLabel3_20" );
pixmapLabel3_20->setMinimumSize( QSize( 22, 22 ) );
324,8 → 367,8
pixmapLabel3_20->setPixmap( loadIcon("shade.png") );
layout5->addWidget( pixmapLabel3_20 );
 
PM2 = new ShadeButton(characterBox);
layout5->addWidget( PM2 );
fillShade_ = new ShadeButton(characterBox);
layout5->addWidget( fillShade_ );
QSpacerItem* spacer3 = new QSpacerItem( 0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum );
layout5->addItem( spacer3 );
characterBoxLayout->addLayout( layout5 );
335,8 → 378,8
StrokeIcon->setPixmap(loadIcon("Stiftalt.xpm"));
layout6->addWidget( StrokeIcon );
 
TxStroke = new ScComboBox( false, characterBox, "TxStroke" );
layout6->addWidget( TxStroke );
strokeColor_ = new ScComboBox( false, characterBox, "TxStroke" );
layout6->addWidget( strokeColor_ );
 
pixmapLabel3_19 = new QLabel( "", characterBox, "pixmapLabel3_19" );
pixmapLabel3_19->setMinimumSize( QSize( 22, 22 ) );
344,8 → 387,8
pixmapLabel3_19->setPixmap( loadIcon("shade.png") );
layout6->addWidget( pixmapLabel3_19 );
 
PM1 = new ShadeButton(characterBox);
layout6->addWidget( PM1 );
strokeShade_ = new ShadeButton(characterBox);
layout6->addWidget( strokeShade_ );
 
spacer4 = new QSpacerItem( 0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum );
layout6->addItem( spacer4 );
353,26 → 396,51
 
characterBoxLayout->addStretch(10);
 
TxFill->clear();
TxStroke->clear();
fillColor_->clear();
strokeColor_->clear();
ColorList::Iterator it;
QPixmap pm = QPixmap(15, 15);
TxFill->insertItem(CommonStrings::NoneColor);
TxStroke->insertItem(CommonStrings::NoneColor);
fillColor_->insertItem(CommonStrings::NoneColor);
strokeColor_->insertItem(CommonStrings::NoneColor);
StrokeIcon->setEnabled(false);
PM1->setEnabled(false);
TxStroke->setEnabled(false);
strokeShade_->setEnabled(false);
strokeColor_->setEnabled(false);
}
 
SMCStyleWidget::~SMCStyleWidget()
void SMCStylePage::show(CharStyle &cstyle)
{
// ASK Avox!
fontSize_->setValue(cstyle.fontSize() / 10.0);
fillShade_->setValue(cstyle.fillShade());
strokeShade_->setValue(cstyle.strokeShade());
effects_->setStyle(static_cast<int>(cstyle.effects()));
effects_->ShadowVal->Xoffset->setValue(cstyle.shadowXOffset());
effects_->ShadowVal->Yoffset->setValue(cstyle.shadowYOffset());
effects_->OutlineVal->LWidth->setValue(cstyle.outlineWidth());
effects_->StrikeVal->LPos->setValue(cstyle.strikethruOffset());
effects_->StrikeVal->LWidth->setValue(cstyle.strikethruWidth());
effects_->UnderlineVal->LPos->setValue(cstyle.underlineOffset());
effects_->UnderlineVal->LWidth->setValue(cstyle.underlineWidth());
fontHScale_->setValue(cstyle.scaleH());
fontVScale_->setValue(cstyle.scaleV());
baselineOffset_->setValue(cstyle.baselineOffset());
tracking_->setValue(cstyle.tracking());
fillColor_->setCurrentText(cstyle.fillColor());
strokeColor_->setCurrentText(cstyle.strokeColor());
fontFace_->setCurrentFont(cstyle.font().scName());
// QString language() const { return language_==NOLANG && parent()? inh().language() : language_; }
}
 
SMCStylePage::~SMCStylePage()
{
}
 
/******************************************************************************/
/******************************************************************************/
 
SMCharacterStyle::SMCharacterStyle() : StyleItem(), cwidget_(0)
SMCharacterStyle::SMCharacterStyle() : StyleItem(), widget_(0), page_(0), doc_(0)
{
 
}
379,13 → 447,16
 
QTabWidget* SMCharacterStyle::widget()
{
if (!cwidget_)
if (!widget_)
{
cwidget_ = new SMCStyleWidget();
Q_CHECK_PTR(cwidget_);
widget_ = new QTabWidget();
Q_CHECK_PTR(widget_);
page_ = new SMCStylePage();
Q_CHECK_PTR(page_);
widget_->addTab(page_, tr("Properties"));
}
 
return cwidget_->tabWidget;
return widget_;
}
 
QString SMCharacterStyle::typeName()
396,6 → 467,7
void SMCharacterStyle::currentDoc(ScribusDoc *doc)
{
Q_ASSERT(doc);
doc_ = doc;
}
 
QValueList<StyleName> SMCharacterStyle::styles()
402,12 → 474,39
{
QValueList<StyleName> tmpList;
 
if (!doc_)
return tmpList; // no doc available
 
StyleSet<CharStyle> &tmp = doc_->docCharStyles;
for (uint i = 0; i < tmp.count(); ++i)
{
if (tmp[i].hasName())
{
QString styleName = tmp[i].name();
QString parentName = QString::null;
 
if (tmp[i].hasParent() && tmp[i].parent()->hasName())
parentName = tmp[i].parent()->displayName();
 
tmpList << StyleName(styleName, parentName);
}
}
 
return tmpList;
}
 
void SMCharacterStyle::selected(const QStringList &styleNames)
{
 
if (styleNames.count() == 1)
{
int index = doc_->docCharStyles.find(styleNames[0]);
if (index > -1)
page_->show(doc_->docCharStyles[index]);
}
else // more than one item selected do the magic tricks here
{
}
}
 
QString SMCharacterStyle::fromSelection() const
432,6 → 531,9
 
SMCharacterStyle::~SMCharacterStyle()
{
 
delete page_;
delete widget_;
page_ = 0;
widget_ = 0;
}