Subversion Repositories Scribus

Compare Revisions

Regard whitespace Rev 3123 → Rev 3122

/branches/Version13x/Scribus/scribus/scribus.cpp
2505,7 → 2505,7
 
// connect(w, SIGNAL(SaveAndClose()), this, SLOT(DoSaveClose()));
if ((CMSavail) && (doc->CMSSettings.CMSinUse))
recalcColors();
RecalcColors();
doc->setPage(width, h, tpr, lr, rr, br, sp, ab, atf, fp);
doc->setLoading(false);
slotNewPage(0);
2580,10 → 2580,10
scrWindowsActions.clear();
addDefaultWindowMenuItems();
QWidgetList windows = wsp->windowList();
bool windowsListNotEmpty=!windows.isEmpty();
scrActions["windowsCascade"]->setEnabled(windowsListNotEmpty);
scrActions["windowsTile"]->setEnabled(windowsListNotEmpty);
if (windowsListNotEmpty)
bool windowsListEmpty=windows.isEmpty();
scrActions["windowsCascade"]->setEnabled(!windowsListEmpty);
scrActions["windowsTile"]->setEnabled(!windowsListEmpty);
if ( !windowsListEmpty )
{
scrMenuMgr->addMenuSeparator("Windows");
3736,7 → 3736,7
{
if (doc->CMSSettings.CMSinUse)
{
recalcColors();
RecalcColors();
view->RecalcPictures(&InputProfiles);
}
}
4023,7 → 4023,7
#endif
if (doc->CMSSettings.CMSinUse)
{
recalcColors();
RecalcColors();
view->RecalcPictures(&InputProfiles);
}
}
8650,12 → 8650,65
}
}
 
void ScribusApp::recalcColors(QProgressBar *dia)
void ScribusApp::RecalcColors(QProgressBar *dia)
{
if (HaveDoc)
{
doc->recalculateColors();
if (doc->masterPageMode)
doc->MasterPages = doc->Pages;
else
doc->DocPages = doc->Pages;
ColorList::Iterator it;
for (it = doc->PageColors.begin(); it != doc->PageColors.end(); ++it)
{
doc->PageColors[it.key()].RecalcRGB();
}
updateColorMenu(dia);
for (uint c=0; c<doc->Items.count(); ++c)
{
PageItem *ite = doc->Items.at(c);
if (ite->fillColor() != "None")
ite->fillQColor = doc->PageColors[ite->fillColor()].getShadeColorProof(ite->fillShade());
if (ite->lineColor() != "None")
ite->strokeQColor = doc->PageColors[ite->lineColor()].getShadeColorProof(ite->lineShade());
QPtrVector<VColorStop> cstops = ite->fill_gradient.colorStops();
for (uint cst = 0; cst < ite->fill_gradient.Stops(); ++cst)
{
QColor tmpc = doc->PageColors[cstops.at(cst)->name].getRGBColor();
ite->SetFarbe(&tmpc, cstops.at(cst)->name, cstops.at(cst)->shade);
cstops.at(cst)->color = tmpc;
}
}
for (uint c=0; c<doc->MasterItems.count(); ++c)
{
PageItem *ite = doc->MasterItems.at(c);
if (ite->fillColor() != "None")
ite->fillQColor = doc->PageColors[ite->fillColor()].getShadeColorProof(ite->fillShade());
if (ite->lineColor() != "None")
ite->strokeQColor = doc->PageColors[ite->lineColor()].getShadeColorProof(ite->lineShade());
QPtrVector<VColorStop> cstops = ite->fill_gradient.colorStops();
for (uint cst = 0; cst < ite->fill_gradient.Stops(); ++cst)
{
QColor tmpc = doc->PageColors[cstops.at(cst)->name].getRGBColor();
ite->SetFarbe(&tmpc, cstops.at(cst)->name, cstops.at(cst)->shade);
cstops.at(cst)->color = tmpc;
}
}
for (uint c=0; c<doc->FrameItems.count(); ++c)
{
PageItem *ite = doc->FrameItems.at(c);
if (ite->fillColor() != "None")
ite->fillQColor = doc->PageColors[ite->fillColor()].getShadeColorProof(ite->fillShade());
if (ite->lineColor() != "None")
ite->strokeQColor = doc->PageColors[ite->lineColor()].getShadeColorProof(ite->lineShade());
QPtrVector<VColorStop> cstops = ite->fill_gradient.colorStops();
for (uint cst = 0; cst < ite->fill_gradient.Stops(); ++cst)
{
QColor tmpc = doc->PageColors[cstops.at(cst)->name].getRGBColor();
ite->SetFarbe(&tmpc, cstops.at(cst)->name, cstops.at(cst)->shade);
cstops.at(cst)->color = tmpc;
}
}
propertiesPalette->Cpal->SetColors(doc->PageColors);
propertiesPalette->updateCList();
}
/branches/Version13x/Scribus/scribus/scribusdoc.cpp
2041,65 → 2041,3
}
return retVal;
}
 
void ScribusDoc::recalculateColors()
{
if (masterPageMode)
MasterPages = Pages;
else
DocPages = Pages;
//Recalculate the RGB or CMYK calues to new CMS settings
ColorList::Iterator it;
ColorList::Iterator itend=PageColors.end();
for (it = PageColors.begin(); it != itend; ++it)
PageColors[it.key()].RecalcRGB();
//Adjust Items of the 3 types to the colors
uint itemsCount=Items.count();
for (uint c=0; c<itemsCount; ++c)
{
PageItem *ite = Items.at(c);
if (ite->fillColor() != "None")
ite->fillQColor = PageColors[ite->fillColor()].getShadeColorProof(ite->fillShade());
if (ite->lineColor() != "None")
ite->strokeQColor = PageColors[ite->lineColor()].getShadeColorProof(ite->lineShade());
QPtrVector<VColorStop> cstops = ite->fill_gradient.colorStops();
for (uint cst = 0; cst < ite->fill_gradient.Stops(); ++cst)
{
QColor tmpc = PageColors[cstops.at(cst)->name].getRGBColor();
ite->SetFarbe(&tmpc, cstops.at(cst)->name, cstops.at(cst)->shade);
cstops.at(cst)->color = tmpc;
}
}
uint masterItemsCount=MasterItems.count();
for (uint c=0; c<masterItemsCount; ++c)
{
PageItem *ite = MasterItems.at(c);
if (ite->fillColor() != "None")
ite->fillQColor = PageColors[ite->fillColor()].getShadeColorProof(ite->fillShade());
if (ite->lineColor() != "None")
ite->strokeQColor = PageColors[ite->lineColor()].getShadeColorProof(ite->lineShade());
QPtrVector<VColorStop> cstops = ite->fill_gradient.colorStops();
for (uint cst = 0; cst < ite->fill_gradient.Stops(); ++cst)
{
QColor tmpc = PageColors[cstops.at(cst)->name].getRGBColor();
ite->SetFarbe(&tmpc, cstops.at(cst)->name, cstops.at(cst)->shade);
cstops.at(cst)->color = tmpc;
}
}
uint frameItemsCount=FrameItems.count();
for (uint c=0; c<frameItemsCount; ++c)
{
PageItem *ite = FrameItems.at(c);
if (ite->fillColor() != "None")
ite->fillQColor = PageColors[ite->fillColor()].getShadeColorProof(ite->fillShade());
if (ite->lineColor() != "None")
ite->strokeQColor = PageColors[ite->lineColor()].getShadeColorProof(ite->lineShade());
QPtrVector<VColorStop> cstops = ite->fill_gradient.colorStops();
for (uint cst = 0; cst < ite->fill_gradient.Stops(); ++cst)
{
QColor tmpc = PageColors[cstops.at(cst)->name].getRGBColor();
ite->SetFarbe(&tmpc, cstops.at(cst)->name, cstops.at(cst)->shade);
cstops.at(cst)->color = tmpc;
}
}
}
/branches/Version13x/Scribus/scribus/scribusdoc.h
281,10 → 281,6
* @brief Set the page margins. Current code uses current page only, also provide a (currently, TODO) option for this.
*/
const bool changePageMargins(const double initialTop, const double initialBottom, const double initialLeft, const double initialRight, const double initialHeight, const double initialWidth, const double Height, const double width, const int orientation, const QString& pageSize, const int pageNumber=-1);
/**
* @brief Recalculate the colors after CMS settings change. Update the items in the doc accordingly.
*/
void recalculateColors();
protected:
void addSymbols();
/branches/Version13x/Scribus/scribus/scribus.h
144,8 → 144,7
bool onlyDirs = false, bool *docom = 0, bool *doFont = 0);
void GetCMSProfiles();
void GetCMSProfilesDir(QString pfad);
//Recalculate the colors after changing CMS settings. Call the appropriate document function and then update the GUI elements.
void recalcColors(QProgressBar *dia = 0);
void RecalcColors(QProgressBar *dia = 0);
void SwitchWin();
void RestoreBookMarks();
void AdjustBM();