Subversion Repositories Scribus

Compare Revisions

Ignore whitespace Rev 1370 → Rev 1371

/branches/Version13x/Scribus/scribus/undomanager.h
432,6 → 432,8
static const QString ApplyTemplate;
static const QString Paste;
static const QString Cut;
static const QString Transparency;
static const QString LineTransparency;
/*@}*/
 
/**
464,6 → 466,7
static QPixmap *ICreate;
static QPixmap *IPaste;
static QPixmap *ICut;
static QPixmap *ITransparency;
/*@}*/
 
protected:
/branches/Version13x/Scribus/scribus/pageitem.h
311,7 → 311,7
* of its Qt name.
* See also PageItem::setItemName()
*/
const QString itemName();
QString itemName() const;
/**
* @brief Set name of the item
* @param newName name for the item
332,6 → 332,11
*/
void setFillShade(int newShade);
/**
* @brief Set the transparency of the fill color.
* @param newTransparency transparency of the fill color
*/
void setFillTransparency(double newTransparency);
/**
* @brief Set the line color of the object.
* @param newFill line color for the object
*/
341,6 → 346,11
* @param newColor shade for the line color
*/
void setLineShade(int newShade);
/**
* @brief Set the transparency of the line color.
* @param newTransparency transparency of the line color
*/
void setLineTransparency(double newTransparency);
/** @brief Flip an image horizontally. */
void flipImageH();
/** @brief Flip an image vertically */
388,6 → 398,8
void restoreLineColor(SimpleState *state, bool isUndo);
void restoreLineShade(SimpleState *state, bool isUndo);
void restoreName(SimpleState *state, bool isUndo);
void restoreFillTP(SimpleState *state, bool isUndo);
void restoreLineTP(SimpleState *state, bool isUndo);
/*@}*/
 
/**
/branches/Version13x/Scribus/scribus/pageitem.cpp
2253,7 → 2253,7
}
}
 
const QString PageItem::itemName()
QString PageItem::itemName() const
{
return AnName;
}
2301,6 → 2301,21
Shade = newShade;
}
 
void PageItem::setFillTransparency(double newTransparency)
{
if (UndoManager::undoEnabled())
{
SimpleState *ss = new SimpleState(Um::Transparency,
QString(Um::FromTo).arg(Transparency).arg(newTransparency),
Um::ITransparency);
ss->set("TRANSPARENCY", "transparency");
ss->set("OLD_TP", Transparency);
ss->set("NEW_TP", newTransparency);
undoManager->action(this, ss);
}
Transparency = newTransparency;
}
 
void PageItem::setLineColor(const QString &newColor)
{
if (UndoManager::undoEnabled())
2331,6 → 2346,21
Shade2 = newShade;
}
 
void PageItem::setLineTransparency(double newTransparency)
{
if (UndoManager::undoEnabled())
{
SimpleState *ss = new SimpleState(Um::LineTransparency,
QString(Um::FromTo).arg(TranspStroke).arg(newTransparency),
Um::ITransparency);
ss->set("LINE_TRANSPARENCY", "transparency");
ss->set("OLD_TP", TranspStroke);
ss->set("NEW_TP", newTransparency);
undoManager->action(this, ss);
}
TranspStroke = newTransparency;
}
 
void PageItem::flipImageH()
{
if (UndoManager::undoEnabled())
2545,6 → 2575,10
}
else if (ss->contains("NEW_NAME"))
restoreName(ss, isUndo);
else if (ss->contains("TRANSPARENCY"))
restoreFillTP(ss, isUndo);
else if (ss->contains("LINE_TRANSPARENCY"))
restoreLineTP(ss, isUndo);
}
}
 
2675,6 → 2709,24
ScApp->view->ItemPenShade(shade);
}
 
void PageItem::restoreFillTP(SimpleState *state, bool isUndo)
{
double tp = state->getDouble("OLD_TP");
if (!isUndo)
tp = state->getDouble("NEW_TP");
select();
ScApp->SetTranspar(tp);
}
 
void PageItem::restoreLineTP(SimpleState *state, bool isUndo)
{
double tp = state->getDouble("OLD_TP");
if (!isUndo)
tp = state->getDouble("NEW_TP");
select();
ScApp->SetTransparS(tp);
}
 
void PageItem::restoreName(SimpleState *state, bool isUndo)
{
QString oldName = state->get("OLD_NAME");
/branches/Version13x/Scribus/scribus/scribus.cpp
10009,7 → 10009,7
if (view->SelItem.count() != 0)
{
PageItem *b = view->SelItem.at(0);
b->Transparency = t;
b->setFillTransparency(t);
view->DrawNew();
slotDocCh();
}
10023,7 → 10023,7
if (view->SelItem.count() != 0)
{
PageItem *b = view->SelItem.at(0);
b->TranspStroke = t;
b->setLineTransparency(t);
view->DrawNew();
slotDocCh();
}
/branches/Version13x/Scribus/scribus/undomanager.cpp
613,6 → 613,7
UndoManager::ICreate = new QPixmap(iconDir + "u_create.png");
UndoManager::IPaste = new QPixmap(iconDir + "editpaste.png");
UndoManager::ICut = new QPixmap(iconDir + "u_cut.png");
UndoManager::ITransparency = new QPixmap(iconDir + "u_transp.png");
}
 
const QString UndoManager::AddVGuide = tr("Add vertical guide");
656,6 → 657,8
const QString UndoManager::ApplyTemplate = tr("Apply template");
const QString UndoManager::Paste = tr("Paste");
const QString UndoManager::Cut = tr("Cut");
const QString UndoManager::Transparency = tr("Set fill color transparency");
const QString UndoManager::LineTransparency = tr("Set line color transparency");
 
/*** Icons for UndoObjects *******************************************/
QPixmap *UndoManager::IImageFrame = NULL;
682,3 → 685,4
QPixmap *UndoManager::ICreate = NULL;
QPixmap *UndoManager::IPaste = NULL;
QPixmap *UndoManager::ICut = NULL;
QPixmap *UndoManager::ITransparency = NULL;