/branches/ScribusOIF/scribus/scribusdoc.cpp |
---|
2890,19 → 2890,20 |
} |
const QString& pat2 = pat->items.at(c)->strokePattern(); |
if (!pat2.isEmpty() && !results.contains(pat2)) |
results.append(pat->items.at(c)->strokePattern()); |
pats.append(pat->items.at(c)->strokePattern()); |
const QString& pat3 = pat->items.at(c)->patternMask(); |
if (!pat3.isEmpty() && !results.contains(pat3)) |
results.append(pat->items.at(c)->patternMask()); |
pats.append(pat->items.at(c)->patternMask()); |
} |
if (!pats.isEmpty()) |
{ |
results = pats; |
for (int c = 0; c < pats.count(); ++c) |
{ |
getUsedPatternsHelper(pats[c], results); |
} |
} |
return pats; |
return results; |
} |
QStringList ScribusDoc::getUsedSymbols() |
/branches/ScribusOIF/scribus/ui/symbolpalette.cpp |
---|
96,8 → 96,7 |
unsetDoc(); |
m_scMW = NULL; |
editItemName = ""; |
editItem = NULL; |
editItemNames.clear(); |
languageChange(); |
connect(SymbolViewWidget, SIGNAL(itemDoubleClicked(QListWidgetItem *)), this, SLOT(handleDoubleClick(QListWidgetItem *))); |
} |
108,41 → 107,21 |
emit startEdit(item->text()); |
} |
void SymbolPalette::editingStart(QString name) |
void SymbolPalette::editingStart(QStringList names) |
{ |
editItemName = name; |
QList<QListWidgetItem *> items = SymbolViewWidget->findItems(name, Qt::MatchExactly); |
if (items.count() > 0) |
editItemNames = names; |
for (int a = 0; a < editItemNames.count(); a++) |
{ |
editItem = items[0]; |
editItem->setFlags(0); |
QList<QListWidgetItem*> items = SymbolViewWidget->findItems(names[a], Qt::MatchExactly); |
if (items.count() > 0) |
items[0]->setFlags(0); |
} |
} |
void SymbolPalette::editingFinished() |
{ |
if (!editItemName.isEmpty()) |
{ |
QPixmap pm; |
ScPattern pa = currDoc->docPatterns[editItemName]; |
if (pa.getPattern()->width() >= pa.getPattern()->height()) |
pm = QPixmap::fromImage(pa.getPattern()->scaledToWidth(48, Qt::SmoothTransformation)); |
else |
pm = QPixmap::fromImage(pa.getPattern()->scaledToHeight(48, Qt::SmoothTransformation)); |
QPixmap pm2(48, 48); |
pm2.fill(palette().color(QPalette::Base)); |
QPainter p; |
p.begin(&pm2); |
p.drawPixmap(24 - pm.width() / 2, 24 - pm.height() / 2, pm); |
p.end(); |
if (editItem != NULL) |
{ |
editItem->setIcon(pm2); |
editItem->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled | Qt::ItemIsDragEnabled); |
} |
} |
editItemName = ""; |
editItem = NULL; |
editItemNames.clear(); |
updateSymbolList(); |
} |
void SymbolPalette::setMainWindow(ScribusMainWindow *mw) |
188,11 → 167,8 |
p.drawPixmap(24 - pm.width() / 2, 24 - pm.height() / 2, pm); |
p.end(); |
QListWidgetItem *item = new QListWidgetItem(pm2, it.key(), SymbolViewWidget); |
if (it.key() == editItemName) |
{ |
if (editItemNames.contains(it.key())) |
item->setFlags(0); |
editItem = item; |
} |
else |
item->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled | Qt::ItemIsDragEnabled); |
} |
/branches/ScribusOIF/scribus/ui/cpalette.cpp |
---|
688,6 → 688,19 |
connect(patternBox, SIGNAL(itemClicked(QListWidgetItem*)), this, SLOT(selectPattern(QListWidgetItem*))); |
} |
void Cpalette::hideEditedPatterns(QStringList names) |
{ |
for (int a = 0; a < names.count(); a++) |
{ |
QList<QListWidgetItem*> items = patternBox->findItems(names[a], Qt::MatchExactly); |
if (items.count() > 0) |
items[0]->setHidden(true); |
items = patternBoxStroke->findItems(names[a], Qt::MatchExactly); |
if (items.count() > 0) |
items[0]->setHidden(true); |
} |
} |
void Cpalette::setPatterns(QMap<QString, ScPattern> *docPatterns) |
{ |
patternList = docPatterns; |
/branches/ScribusOIF/scribus/ui/transparencypalette.h |
---|
84,6 → 84,7 |
void switchPatternMode(); |
void editGradientVector(); |
void setActiveGradDia(bool active); |
void hideEditedPatterns(QStringList names); |
void updatePatternList(); |
void selectPattern(QListWidgetItem *c); |
void setActPattern(QString pattern, double scaleX, double scaleY, double offsetX, double offsetY, double rotation, double skewX, double skewY, bool mirrorX, bool mirrorY); |
/branches/ScribusOIF/scribus/ui/cpalette.h |
---|
93,6 → 93,7 |
void setNamedGradientStroke(const QString &name); |
void selectPattern(QListWidgetItem *c); |
void selectPatternS(QListWidgetItem *c); |
void hideEditedPatterns(QStringList names); |
void updatePatternList(); |
void updateGradientList(); |
void setActPattern(QString pattern, double scaleX, double scaleY, double offsetX, double offsetY, double rotation, double skewX, double skewY, bool mirrorX, bool mirrorY); |
/branches/ScribusOIF/scribus/ui/transparencypalette.cpp |
---|
366,6 → 366,16 |
TGradDia->setValues(x1, y1, x2, y2, fx, fy, sg, sk, 0, 0); |
} |
void Tpalette::hideEditedPatterns(QStringList names) |
{ |
for (int a = 0; a < names.count(); a++) |
{ |
QList<QListWidgetItem*> items = patternBox->findItems(names[a], Qt::MatchExactly); |
if (items.count() > 0) |
items[0]->setHidden(true); |
} |
} |
void Tpalette::updatePatternList() |
{ |
disconnect(patternBox, SIGNAL(itemClicked(QListWidgetItem*)), this, SLOT(selectPattern(QListWidgetItem*))); |
/branches/ScribusOIF/scribus/ui/scmenu.cpp |
---|
197,8 → 197,9 |
// return false; |
#ifdef Q_WS_MAC |
if (newMenuAction->icon().isNull() && ! (afterMenuAction->icon().isNull())) |
newMenuAction->setIcon(loadIcon("noicon.xpm")); |
if (newMenuAction && afterMenuAction) |
if (newMenuAction->icon().isNull() && ! (afterMenuAction->icon().isNull())) |
newMenuAction->setIcon(loadIcon("noicon.xpm")); |
#endif |
int pos=menuItemList.indexOf(QPointer<QObject>(afterMenuAction)); |
/branches/ScribusOIF/scribus/ui/paintmanager.cpp |
---|
917,17 → 917,43 |
pats.clear(); |
for (int c = 0; c < pat->items.count(); ++c) |
{ |
if ((pat->items.at(c)->GrType == 8) || (pat->items.at(c)->itemType() == PageItem::Symbol)) |
{ |
const QString& patName = pat->items.at(c)->pattern(); |
if (!patName.isEmpty() && !results.contains(patName)) |
pats.append(patName); |
} |
const QString& pat2 = pat->items.at(c)->strokePattern(); |
if (!pat2.isEmpty() && !results.contains(pat2)) |
pats.append(pat->items.at(c)->strokePattern()); |
const QString& pat3 = pat->items.at(c)->patternMask(); |
if (!pat3.isEmpty() && !results.contains(pat3)) |
pats.append(pat->items.at(c)->patternMask()); |
} |
if (!pats.isEmpty()) |
{ |
results = pats; |
for (int c = 0; c < pats.count(); ++c) |
{ |
getUsedPatternsHelper(pats[c], results); |
} |
} |
/* QStringList pats; |
pats.clear(); |
for (int c = 0; c < pat->items.count(); ++c) |
{ |
if ((!results.contains(pat->items.at(c)->pattern())) && ((pat->items.at(c)->GrType == 8) || (pat->items.at(c)->itemType() == PageItem::Symbol))) |
pats.append(pat->items.at(c)->pattern()); |
} |
if (!pats.isEmpty()) |
{ |
results = pats; |
for (int c = 0; c < pats.count(); ++c) |
{ |
getUsedPatternsHelper(pats[c], results); |
} |
} |
return pats; |
} */ |
return results; |
} |
void PaintManagerDialog::removeUnusedColorItem() |
/branches/ScribusOIF/scribus/ui/symbolpalette.h |
---|
67,7 → 67,7 |
void setMainWindow(ScribusMainWindow *mw); |
void setDoc(ScribusDoc *); |
void unsetDoc(); |
void editingStart(QString name); |
void editingStart(QStringList names); |
void editingFinished(); |
void updateSymbolList(); |
86,8 → 86,7 |
QVBoxLayout* PaletteLayout; |
ScribusDoc *currDoc; |
ScribusMainWindow *m_scMW; |
QListWidgetItem *editItem; |
QString editItemName; |
QStringList editItemNames; |
}; |
#endif |
/branches/ScribusOIF/scribus/scribus.cpp |
---|
217,6 → 217,7 |
#include "tocgenerator.h" |
//#include "ui/tocindexprefs.h" |
#include "ui/transformdialog.h" |
#include "ui/transparencypalette.h" |
#include "ui/copypagetomasterpagedialog.h" |
#include "ui/edittoolbar.h" |
#include "ui/filetoolbar.h" |
8499,7 → 8500,22 |
scrActions["toolsPDFAnnot3D"]->setEnabled(false); |
#endif |
pagePalette->enablePalette(false); |
symbolPalette->editingStart(temp); |
QStringList patterns2Del; |
QStringList mainPatterns = doc->docPatterns.keys(); |
for (int a = 0; a < mainPatterns.count(); a++) |
{ |
if (mainPatterns[a] != temp) |
{ |
QStringList subPatterns; |
subPatterns = doc->getUsedPatternsHelper(mainPatterns[a], subPatterns); |
if (subPatterns.contains(temp)) |
patterns2Del.append(mainPatterns[a]); |
} |
} |
patterns2Del.append(temp); |
symbolPalette->editingStart(patterns2Del); |
propertiesPalette->Cpal->hideEditedPatterns(patterns2Del); |
propertiesPalette->Tpal->hideEditedPatterns(patterns2Del); |
updateActiveWindowCaption( tr("Editing Symbol: %1").arg(temp)); |
} |
} |