Subversion Repositories Scribus

Compare Revisions

Ignore whitespace Rev 21249 → Rev 21250

/trunk/Scribus/scribus/iconmanager.cpp
199,7 → 199,7
return QIcon(loadPixmap(nam, forceUseColor));
}
 
QPixmap IconManager::loadPixmap(const QString nam, bool forceUseColor)
QPixmap IconManager::loadPixmap(const QString nam, bool forceUseColor, bool rtlFlip)
{
if (m_pxCache.contains(nam))
return *m_pxCache[nam];
213,6 → 213,12
// qDebug()<<"Successful icon load from"<<iconFilePath;
if (PrefsManager::instance()->appPrefs.uiPrefs.grayscaleIcons && !forceUseColor)
iconToGrayscale(pm);
if (rtlFlip)
{
QTransform t;
t.rotate(180);
*pm = pm->transformed(t);
}
m_pxCache.insert(nam, pm);
return *pm;
}
/trunk/Scribus/scribus/iconmanager.h
53,7 → 53,7
bool setup();
QCursor loadCursor(const QString nam, int hotX = -1, int hotY = -1, bool forceUseColor=false);
QIcon loadIcon(const QString nam, bool forceUseColor=false);
QPixmap loadPixmap(const QString nam, bool forceUseColor=false);
QPixmap loadPixmap(const QString nam, bool forceUseColor=false, bool rtlFlip=false);
QString pathForIcon(const QString nam);
QStringList pathList();
QStringList nameList(QString language);
/trunk/Scribus/scribus/ui/linkbutton.cpp
23,6 → 23,7
 
#include "linkbutton.h"
#include "iconmanager.h"
#include "scribuscore.h"
#include <QIcon>
#include <QPixmap>
 
30,10 → 31,16
LinkButton::LinkButton(QWidget *pa) : QToolButton(pa)
{
setBackgroundRole(QPalette::Window);
setNewIcon();
}
 
void LinkButton::setNewIcon()
{
QIcon a=QIcon();
QPixmap closedPixmap(IconManager::instance()->loadPixmap("chain-closed.png"));
bool rtlLoad = QLocale(ScCore->getGuiLanguage()).textDirection() == Qt::RightToLeft;
QPixmap closedPixmap(IconManager::instance()->loadPixmap("chain-closed.png", false, rtlLoad));
a.addPixmap(closedPixmap, QIcon::Normal, QIcon::On);
a.addPixmap(IconManager::instance()->loadPixmap("chain-open.png"), QIcon::Normal, QIcon::Off);
a.addPixmap(IconManager::instance()->loadPixmap("chain-open.png", false, rtlLoad), QIcon::Normal, QIcon::Off);
setIcon(a);
setIconSize(closedPixmap.size());
}
/trunk/Scribus/scribus/ui/linkbutton.h
41,6 → 41,7
*/
LinkButton(QWidget *pa);
~LinkButton() {};
void setNewIcon();
/*!
\author Franz Schmid
\brief Returns size of QPixmap, see the Qt-Documentation for further explaining of that.