r21664 by jghali - fix issues with colorcombo/colorlist api
scribus-commit
scribus-commit at lists.scribus.net
Sun Dec 18 12:36:18 UTC 2016
Author: jghali
Date: Sun Dec 18 12:36:18 2016
New Revision: 21664
URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=21664
Log:
fix issues with colorcombo/colorlist api
The current api was making it look as if it was possible to mix the different kind of pixmaps (small/wide/fancy) into a single combo/list, which was not the case. Change the api to make it clear it is not.
Modified:
trunk/Scribus/scribus/plugins/colorwheel/cwdialog.cpp
trunk/Scribus/scribus/plugins/tools/pathfinder/pathfinderdialog.cpp
trunk/Scribus/scribus/ui/annot.cpp
trunk/Scribus/scribus/ui/cmykfw.cpp
trunk/Scribus/scribus/ui/colorcombo.cpp
trunk/Scribus/scribus/ui/colorcombo.h
trunk/Scribus/scribus/ui/colorlistbox.cpp
trunk/Scribus/scribus/ui/colorlistbox.h
trunk/Scribus/scribus/ui/cpalette.cpp
trunk/Scribus/scribus/ui/dcolor.cpp
trunk/Scribus/scribus/ui/effectsdialog.cpp
trunk/Scribus/scribus/ui/gradienteditor.cpp
trunk/Scribus/scribus/ui/propertywidget_textcolor.cpp
trunk/Scribus/scribus/ui/proptree.cpp
trunk/Scribus/scribus/ui/replaceonecolor.cpp
trunk/Scribus/scribus/ui/search.cpp
trunk/Scribus/scribus/ui/selectobjects.cpp
trunk/Scribus/scribus/ui/smcellstylewidget.cpp
trunk/Scribus/scribus/ui/smcstylewidget.cpp
trunk/Scribus/scribus/ui/smlinestylewidget.cpp
trunk/Scribus/scribus/ui/smpstylewidget.cpp
trunk/Scribus/scribus/ui/smtablestylewidget.cpp
trunk/Scribus/scribus/ui/storyeditor.cpp
Modified: trunk/Scribus/scribus/plugins/colorwheel/cwdialog.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21664&path=/trunk/Scribus/scribus/plugins/colorwheel/cwdialog.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/colorwheel/cwdialog.cpp (original)
+++ trunk/Scribus/scribus/plugins/colorwheel/cwdialog.cpp Sun Dec 18 12:36:18 2016
@@ -49,11 +49,13 @@
defectCombo->addItem(CommonStrings::trVisionTritanopia);
defectCombo->addItem(CommonStrings::trVisionFullColorBlind);
// document colors
- documentColorList->updateBox(m_Doc->PageColors, ColorListBox::fancyPixmap);
+ documentColorList->setPixmapType(ColorListBox::fancyPixmap);
+ documentColorList->updateBox(m_Doc->PageColors);
// preferences
prefs = PrefsManager::instance()->prefsFile->getPluginContext("colorwheel");
typeCombo->setCurrentIndex(prefs->getInt("cw_type", 0));
angleSpin->setValue(prefs->getInt("cw_angle", 15));
+ colorList->setPixmapType(ColorListBox::fancyPixmap);
colorWheel->currentDoc = m_Doc;
colorWheel->angle = angleSpin->value();
colorWheel->baseAngle = prefs->getInt("cw_baseangle", 0);
@@ -298,7 +300,7 @@
void CWDialog::fillColorList()
{
int ix = colorList->currentRow();
- colorList->updateBox(colorWheel->colorList, ColorListBox::fancyPixmap);
+ colorList->updateBox(colorWheel->colorList);
QList<QListWidgetItem*> results = colorList->findItems(colorWheel->trBaseColor, Qt::MatchFixedString|Qt::MatchCaseSensitive);
if (results.count() > 0)
{
Modified: trunk/Scribus/scribus/plugins/tools/pathfinder/pathfinderdialog.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21664&path=/trunk/Scribus/scribus/plugins/tools/pathfinder/pathfinderdialog.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/tools/pathfinder/pathfinderdialog.cpp (original)
+++ trunk/Scribus/scribus/plugins/tools/pathfinder/pathfinderdialog.cpp Sun Dec 18 12:36:18 2016
@@ -49,10 +49,12 @@
opParts->setIcon(QIcon(IconManager::instance()->loadIcon("pathparts.png")));
opSubtraction->setIcon(QIcon(IconManager::instance()->loadIcon("pathsubtraction.png")));
opCombine->setIcon(QIcon(IconManager::instance()->loadIcon("pathunite.png")));
+ otherColorComboLine->setPixmapType(ColorCombo::fancyPixmaps);
otherColorComboLine->addItem(CommonStrings::tr_NoneColor);
- otherColorComboLine->insertItems(m_doc->PageColors, ColorCombo::fancyPixmaps);
+ otherColorComboLine->insertItems(m_doc->PageColors);
+ otherColorComboFill->setPixmapType(ColorCombo::fancyPixmaps);
otherColorComboFill->addItem(CommonStrings::tr_NoneColor);
- otherColorComboFill->insertItems(m_doc->PageColors, ColorCombo::fancyPixmaps);
+ otherColorComboFill->insertItems(m_doc->PageColors);
setCurrentComboItem(otherColorComboLine, shape1->lineColor());
setCurrentComboItem(otherColorComboFill, shape1->fillColor());
opMode = 0;
Modified: trunk/Scribus/scribus/ui/annot.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21664&path=/trunk/Scribus/scribus/ui/annot.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/annot.cpp (original)
+++ trunk/Scribus/scribus/ui/annot.cpp Sun Dec 18 12:36:18 2016
@@ -102,12 +102,13 @@
BorderGroup->layout()->setAlignment(Qt::AlignTop);
ColorList::Iterator cit;
+ BorderC->setPixmapType(ColorCombo::fancyPixmaps);
BorderC->addItem(CommonStrings::tr_NoneColor);
if (annotation.borderColor() == CommonStrings::None)
BorderC->setCurrentIndex(BorderC->count()-1);
for (cit = Farben.begin(); cit != Farben.end(); ++cit)
{
- BorderC->insertFancyItem(cit.value(), doc, cit.key());
+ BorderC->insertItem(cit.value(), doc, cit.key());
if (cit.key() == annotation.borderColor())
BorderC->setCurrentIndex(BorderC->count()-1);
}
Modified: trunk/Scribus/scribus/ui/cmykfw.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21664&path=/trunk/Scribus/scribus/ui/cmykfw.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/cmykfw.cpp (original)
+++ trunk/Scribus/scribus/ui/cmykfw.cpp Sun Dec 18 12:36:18 2016
@@ -78,8 +78,9 @@
setupUi(this);
ColorMap->setDoc(doc);
-
- ColorName->setText( name );
+ ColorName->setText(name);
+ ColorSwatch->setPixmapType(ColorListBox::fancyPixmap);
+
ComboBox1->addItem( tr( "CMYK" ) );
ComboBox1->addItem( tr( "RGB" ) );
ComboBox1->addItem( tr( "Web Safe RGB" ) );
@@ -552,7 +553,7 @@
CurrSwatch.insert("Magenta", ScColor(0, 255, 0, 0));
}
ColorSwatch->clear();
- ColorSwatch->insertFancyPixmapItems(CurrSwatch);
+ ColorSwatch->insertItems(CurrSwatch);
ColorSwatch->setCurrentRow( 0 );
TabStack->setCurrentIndex(1);
}
Modified: trunk/Scribus/scribus/ui/colorcombo.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21664&path=/trunk/Scribus/scribus/ui/colorcombo.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/colorcombo.cpp (original)
+++ trunk/Scribus/scribus/ui/colorcombo.cpp Sun Dec 18 12:36:18 2016
@@ -29,6 +29,23 @@
setView( lb );
}
+ColorCombo::ColorCombo(ColorCombo::PixmapType type, QWidget* parent)
+{
+#ifdef Q_OS_MAC
+// setStyle( new ColorCombo::ScMacStyle() );
+#endif
+ setEditable(false);
+ ColorListBox::PixmapType clbType = ColorListBox::smallPixmap;
+ if (type == ColorCombo::widePixmaps)
+ clbType = ColorListBox::widePixmap;
+ else if (type == ColorCombo::fancyPixmaps)
+ clbType = ColorListBox::fancyPixmap;
+ ColorListBox* lb = new ColorListBox(clbType, this);
+ setModel( lb->model() );
+ setItemDelegate( lb->itemDelegate() );
+ setView( lb );
+}
+
ColorCombo::ColorCombo(bool rw, QWidget* parent) : QComboBox(parent)
{
#ifdef Q_OS_MAC
@@ -50,7 +67,21 @@
return colorName;
}
-void ColorCombo::updateBox(ColorList& list, ColorCombo::PixmapType pixType , bool insertNone)
+void ColorCombo::setPixmapType(ColorCombo::PixmapType type)
+{
+ ColorListBox* clb = dynamic_cast<ColorListBox*>(view());
+ if (!clb)
+ return;
+
+ if (type == ColorCombo::smallPixmaps)
+ clb->setPixmapType(ColorListBox::smallPixmap);
+ else if (type == ColorCombo::widePixmaps)
+ clb->setPixmapType(ColorListBox::widePixmap);
+ else if (type == ColorCombo::fancyPixmaps)
+ clb->setPixmapType(ColorListBox::fancyPixmap);
+}
+
+void ColorCombo::updateBox(ColorList& list, bool insertNone)
{
ColorListBox* clb = dynamic_cast<ColorListBox*>(view());
if (!clb)
@@ -62,59 +93,36 @@
clb->addItem(CommonStrings::tr_NoneColor);
clb->item(0)->setData(Qt::UserRole, CommonStrings::None);
}
- if (pixType == ColorCombo::fancyPixmaps)
- clb->insertItems(list, ColorListBox::fancyPixmap);
- else if (pixType == ColorCombo::widePixmaps)
- clb->insertItems(list, ColorListBox::widePixmap);
- else if (pixType == ColorCombo::smallPixmaps)
- clb->insertItems(list, ColorListBox::smallPixmap);
+ clb->insertItems(list);
}
-void ColorCombo::insertItems(ColorList& list, ColorCombo::PixmapType pixType)
+void ColorCombo::insertItems(ColorList& list)
{
ColorListBox* clb = dynamic_cast<ColorListBox*>(view());
if (!clb)
return;
- if (pixType == ColorCombo::fancyPixmaps)
- clb->insertItems(list, ColorListBox::fancyPixmap);
- else if (pixType == ColorCombo::widePixmaps)
- clb->insertItems(list, ColorListBox::widePixmap);
- else if (pixType == ColorCombo::smallPixmaps)
- clb->insertItems(list, ColorListBox::smallPixmap);
+ clb->insertItems(list);
}
-void ColorCombo::insertSmallItem(const ScColor& col, ScribusDoc* doc, const QString& colName)
+void ColorCombo::insertItem(const ScColor& col, ScribusDoc* doc, const QString& colName)
{
ColorListBox* clb = dynamic_cast<ColorListBox*>(view());
if (clb)
- clb->addItem( new ColorPixmapItem(ColorPixmapValue(col, doc, colName)), ColorListBox::smallPixmap );
-}
-
-void ColorCombo::insertWideItem (const ScColor& col, ScribusDoc* doc, const QString& colName)
-{
- ColorListBox* clb = dynamic_cast<ColorListBox*>(view());
- if (clb)
- clb->addItem( new ColorPixmapItem(ColorPixmapValue(col, doc, colName)), ColorListBox::widePixmap );
-}
-
-void ColorCombo::insertFancyItem(const ScColor& col, ScribusDoc* doc, const QString& colName)
-{
- ColorListBox* clb = dynamic_cast<ColorListBox*>(view());
- if (clb)
- clb->addItem( new ColorPixmapItem(ColorPixmapValue(col, doc, colName)), ColorListBox::fancyPixmap );
+ clb->addItem( new ColorPixmapItem(ColorPixmapValue(col, doc, colName)));
}
void ColorCombo::initColorList(ColorList *colorList, ScribusDoc *doc, QString colorValue)
{
clear();
+ setPixmapType(ColorCombo::fancyPixmaps);
addItem(CommonStrings::tr_NoneColor, CommonStrings::None);
if (colorValue == CommonStrings::None)
setCurrentIndex(count()-1);
ColorList::Iterator endOfColorList(colorList->end());
for (ColorList::Iterator itc = colorList->begin(); itc != endOfColorList; ++itc)
{
- insertFancyItem( itc.value(), doc, itc.key() );
+ insertItem( itc.value(), doc, itc.key() );
if (itc.key() == colorValue)
setCurrentIndex(count()-1);
}
Modified: trunk/Scribus/scribus/ui/colorcombo.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21664&path=/trunk/Scribus/scribus/ui/colorcombo.h
==============================================================================
--- trunk/Scribus/scribus/ui/colorcombo.h (original)
+++ trunk/Scribus/scribus/ui/colorcombo.h Sun Dec 18 12:36:18 2016
@@ -34,24 +34,6 @@
{
Q_OBJECT
-private:
-
- /*
-#ifdef Q_OS_MAC
- /// use listbox instead of popupmenu for combo boxes
- class ScMacStyle : public QMacStyle
- {
- virtual int styleHint(StyleHint sh,
- const QStyleOption * so,
- const QWidget * w,
- QStyleHintReturn * r) const
- {
- return sh != QStyle::SH_ComboBox_Popup && QMacStyle::styleHint(sh, so, w, r);
- }
- };
-#endif
-*/
-
public:
enum PixmapType
@@ -62,16 +44,16 @@
};
ColorCombo( QWidget* parent=0 );
+ ColorCombo( ColorCombo::PixmapType type, QWidget* parent=0 );
ColorCombo( bool rw, QWidget* parent=0 );
- QString currentColor() const;
-
- void updateBox(ColorList& list, ColorCombo::PixmapType pixType, bool insertNone = true);
+ QString currentColor() const;
- void insertItems(ColorList& list, ColorCombo::PixmapType type);
- void insertSmallItem(const ScColor& col, ScribusDoc* doc, const QString& colName);
- void insertWideItem (const ScColor& col, ScribusDoc* doc, const QString& colName);
- void insertFancyItem(const ScColor& col, ScribusDoc* doc, const QString& colName);
+ void setPixmapType(ColorCombo::PixmapType type);
+ void updateBox(ColorList& list, bool insertNone = true);
+
+ void insertItem(const ScColor& col, ScribusDoc* doc, const QString& colName);
+ void insertItems(ColorList& list);
void initColorList(ColorList* colorList, ScribusDoc* doc, QString colorValue);
};
Modified: trunk/Scribus/scribus/ui/colorlistbox.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21664&path=/trunk/Scribus/scribus/ui/colorlistbox.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/colorlistbox.cpp (original)
+++ trunk/Scribus/scribus/ui/colorlistbox.cpp Sun Dec 18 12:36:18 2016
@@ -203,7 +203,18 @@
if (initialized != 12345)
sortRule = 0;
initialized = 12345;
- setItemDelegate(new ColorWideItemDelegate());
+ setPixmapType(ColorListBox::widePixmap);
+ connect(this, SIGNAL(showContextMenue()), this, SLOT(slotRightClick()));
+}
+
+ColorListBox::ColorListBox(ColorListBox::PixmapType type, QWidget * parent)
+ : QListWidget(parent)
+{
+ cList = NULL;
+ if (initialized != 12345)
+ sortRule = 0;
+ initialized = 12345;
+ setPixmapType(type);
connect(this, SIGNAL(showContextMenue()), this, SLOT(slotRightClick()));
}
@@ -248,6 +259,43 @@
return item(currentRow())->data(Qt::DisplayRole).toString();
else
return CommonStrings::tr_NoneColor;
+}
+
+void ColorListBox::setPixmapType(ColorListBox::PixmapType type)
+{
+ if (type == ColorListBox::fancyPixmap)
+ {
+ ColorFancyItemDelegate* colorDelegate = dynamic_cast<ColorFancyItemDelegate*>(itemDelegate());
+ if (!colorDelegate)
+ {
+ if (itemDelegate())
+ delete itemDelegate();
+ setItemDelegate(new ColorFancyItemDelegate());
+ }
+ m_type = type;
+ }
+ else if (type == ColorListBox::widePixmap)
+ {
+ ColorWideItemDelegate* colorDelegate = dynamic_cast<ColorWideItemDelegate*>(itemDelegate());
+ if (!colorDelegate)
+ {
+ if (itemDelegate())
+ delete itemDelegate();
+ setItemDelegate(new ColorWideItemDelegate());
+ }
+ m_type = type;
+ }
+ else if (type == ColorListBox::smallPixmap)
+ {
+ ColorSmallItemDelegate* colorDelegate = dynamic_cast<ColorSmallItemDelegate*>(itemDelegate());
+ if (!colorDelegate)
+ {
+ if (itemDelegate())
+ delete itemDelegate();
+ setItemDelegate(new ColorSmallItemDelegate());
+ }
+ m_type = type;
+ }
}
void ColorListBox::slotRightClick()
@@ -273,12 +321,7 @@
reset();
if (!first.isEmpty())
addItem(first);
- if (m_type == ColorListBox::fancyPixmap)
- insertFancyPixmapItems( *cList );
- else if (m_type == ColorListBox::widePixmap)
- insertWidePixmapItems( *cList );
- else if (m_type == ColorListBox::smallPixmap)
- insertSmallPixmapItems( *cList );
+ insertItems( *cList );
if (!currentSel.isEmpty())
{
QList<QListWidgetItem *> items = findItems(currentSel, Qt::MatchExactly);
@@ -289,58 +332,20 @@
blockSignals(false);
}
-void ColorListBox::updateBox(ColorList& list, ColorListBox::PixmapType type)
+void ColorListBox::updateBox(ColorList& list)
{
clear();
reset();
- m_type = type;
- insertItems(list, type);
-}
-
-void ColorListBox::insertItems(ColorList& list, ColorListBox::PixmapType type)
-{
- cList = &list;
- m_type = type;
- if (type == ColorListBox::fancyPixmap)
- insertFancyPixmapItems( list );
- else if (type == ColorListBox::widePixmap)
- insertWidePixmapItems( list );
- else if (type == ColorListBox::smallPixmap)
- insertSmallPixmapItems( list );
-}
-
-void ColorListBox::addItem(ColorPixmapItem* item, ColorListBox::PixmapType type)
-{
- QListWidget::addItem(item);
- if (itemDelegate())
- delete itemDelegate();
- if (type == ColorListBox::fancyPixmap)
- setItemDelegate(new ColorFancyItemDelegate());
- else if (type == ColorListBox::widePixmap)
- setItemDelegate(new ColorWideItemDelegate());
- else if (type == ColorListBox::smallPixmap)
- setItemDelegate(new ColorSmallItemDelegate());
-}
-
-void ColorListBox::addItem(ColorPixmapItem* item)
-{
- QListWidget::addItem(item);
-}
-
-void ColorListBox::addItem(QString text)
-{
- QListWidget::addItem(text);
- if (text == CommonStrings::None || text == CommonStrings::tr_NoneColor)
- {
- QListWidgetItem* item = this->item(count() - 1);
- item->setData(Qt::UserRole, CommonStrings::None);
- }
-}
-
-void ColorListBox::insertSmallPixmapItems(ColorList& list)
+ insertItems(list);
+}
+
+void ColorListBox::insertItems(ColorList& list)
{
ColorList::Iterator it;
ScribusDoc* doc = list.document();
+
+ cList = &list;
+
if (sortRule > 0)
{
QMap<QString, QString> sortMap;
@@ -367,6 +372,7 @@
sortMap.insert(sortString.arg("D").arg(it.key()), it.key());
}
}
+
QMap<QString, QString>::Iterator itc;
for (itc = sortMap.begin(); itc != sortMap.end(); ++itc)
{
@@ -382,109 +388,21 @@
addItem( new ColorPixmapItem(it.value(), doc, it.key()) );
}
}
- if (itemDelegate())
- delete itemDelegate();
- setItemDelegate(new ColorSmallItemDelegate());
-}
-
-void ColorListBox::insertWidePixmapItems(ColorList& list)
-{
- ColorList::Iterator it;
- ScribusDoc* doc = list.document();
- if (sortRule > 0)
- {
- QMap<QString, QString> sortMap;
- for (it = list.begin(); it != list.end(); ++it)
- {
- if (it.key() == CommonStrings::None || it.key() == CommonStrings::tr_NoneColor)
- continue;
- if (sortRule == 1)
- {
- QColor c = it.value().getRawRGBColor();
- QString sortString = QString("%1-%2-%3-%4").arg(c.hue(), 3, 10, QChar('0')).arg(c.saturation(), 3, 10, QChar('0')).arg(c.value(), 3, 10, QChar('0')).arg(it.key());
- sortMap.insert(sortString, it.key());
- }
- else if (sortRule == 2)
- {
- QString sortString = QString("%1-%2");
- if (it.value().isRegistrationColor())
- sortMap.insert(sortString.arg("A").arg(it.key()), it.key());
- else if (it.value().isSpotColor())
- sortMap.insert(sortString.arg("B").arg(it.key()), it.key());
- else if (it.value().getColorModel() == colorModelCMYK)
- sortMap.insert(sortString.arg("C").arg(it.key()), it.key());
- else
- sortMap.insert(sortString.arg("D").arg(it.key()), it.key());
- }
- }
- QMap<QString, QString>::Iterator itc;
- for (itc = sortMap.begin(); itc != sortMap.end(); ++itc)
- {
- addItem( new ColorPixmapItem(list[itc.value()], doc, itc.value()) );
- }
- }
- else
- {
- for (it = list.begin(); it != list.end(); ++it)
- {
- if (it.key() == CommonStrings::None || it.key() == CommonStrings::tr_NoneColor)
- continue;
- addItem( new ColorPixmapItem(it.value(), doc, it.key()) );
- }
- }
- if (itemDelegate())
- delete itemDelegate();
- setItemDelegate(new ColorWideItemDelegate());
-}
-
-void ColorListBox::insertFancyPixmapItems(ColorList& list)
-{
- ColorList::Iterator it;
- ScribusDoc* doc = list.document();
- if (sortRule > 0)
- {
- QMap<QString, QString> sortMap;
- for (it = list.begin(); it != list.end(); ++it)
- {
- if (it.key() == CommonStrings::None || it.key() == CommonStrings::tr_NoneColor)
- continue;
- if (sortRule == 1)
- {
- QColor c = it.value().getRawRGBColor();
- QString sortString = QString("%1-%2-%3-%4").arg(c.hue(), 3, 10, QChar('0')).arg(c.saturation(), 3, 10, QChar('0')).arg(c.value(), 3, 10, QChar('0')).arg(it.key());
- sortMap.insert(sortString, it.key());
- }
- else if (sortRule == 2)
- {
- QString sortString = QString("%1-%2");
- if (it.value().isRegistrationColor())
- sortMap.insert(sortString.arg("A").arg(it.key()), it.key());
- else if (it.value().isSpotColor())
- sortMap.insert(sortString.arg("B").arg(it.key()), it.key());
- else if (it.value().getColorModel() == colorModelCMYK)
- sortMap.insert(sortString.arg("C").arg(it.key()), it.key());
- else
- sortMap.insert(sortString.arg("D").arg(it.key()), it.key());
- }
- }
- QMap<QString, QString>::Iterator itc;
- for (itc = sortMap.begin(); itc != sortMap.end(); ++itc)
- {
- addItem( new ColorPixmapItem(list[itc.value()], doc, itc.value()) );
- }
- }
- else
- {
- for (it = list.begin(); it != list.end(); ++it)
- {
- if (it.key() == CommonStrings::None || it.key() == CommonStrings::tr_NoneColor)
- continue;
- addItem( new ColorPixmapItem(it.value(), doc, it.key()) );
- }
- }
- if (itemDelegate())
- delete itemDelegate();
- setItemDelegate(new ColorFancyItemDelegate());
+}
+
+void ColorListBox::addItem(ColorPixmapItem* item)
+{
+ QListWidget::addItem(item);
+}
+
+void ColorListBox::addItem(QString text)
+{
+ QListWidget::addItem(text);
+ if (text == CommonStrings::None || text == CommonStrings::tr_NoneColor)
+ {
+ QListWidgetItem* item = this->item(count() - 1);
+ item->setData(Qt::UserRole, CommonStrings::None);
+ }
}
bool ColorListBox::viewportEvent(QEvent *event)
Modified: trunk/Scribus/scribus/ui/colorlistbox.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21664&path=/trunk/Scribus/scribus/ui/colorlistbox.h
==============================================================================
--- trunk/Scribus/scribus/ui/colorlistbox.h (original)
+++ trunk/Scribus/scribus/ui/colorlistbox.h Sun Dec 18 12:36:18 2016
@@ -80,7 +80,9 @@
/*! \brief Standard QListBox like constructor.
Just there are initialized pixmaps for icon drawing. */
ColorListBox(QWidget * parent = 0);
+ ColorListBox(ColorListBox::PixmapType type, QWidget * parent = 0);
~ColorListBox();
+
virtual void changeEvent(QEvent *e);
QString currentColor() const;
@@ -88,31 +90,22 @@
/*! \brief Fill the list box with values taken from list.
The list is cleared itself. Then is rendered an icon with
color attributes (RGB/CMYK/Spot etc.).
- \param list a ColorList to present.
- \param the pixmap type to use */
- void updateBox(ColorList& list, ColorListBox::PixmapType type);
+ \param list a ColorList to present. */
+ void updateBox(ColorList& list);
/*! \brief Fill the list box with values taken from list.
The list is not cleared before items insertion.
- \param list a ColorList to present.
- \param the pixmap type to use */
- void insertItems(ColorList& list, ColorListBox::PixmapType type);
+ \param list a ColorList to present. */
+ void insertItems(ColorList& list);
- void addItem(ColorPixmapItem* item, ColorListBox::PixmapType type);
void addItem(ColorPixmapItem* item);
void addItem(QString text);
- /*! \brief Insert ColorSmallPixmapItems into the list
- \param list a ColorList to present. */
- void insertSmallPixmapItems(ColorList& list);
+ /*! \brief Retrieve the pixmap type used by this listbox */
+ ColorListBox::PixmapType pixmapType() const { return m_type; }
- /*! \brief Insert ColorWidePixmapItems into the list
- \param list a ColorList to present. */
- void insertWidePixmapItems(ColorList& list);
-
- /*! \brief Insert ColorFancyPixmapItems into the list
- \param list a ColorList to present. */
- void insertFancyPixmapItems(ColorList& list);
+ /*! \brief Set the pixmap type used by this listbox */
+ void setPixmapType(ColorListBox::PixmapType type);
/*! \brief Pointer to the color list displayed by this box */
ColorList *cList;
Modified: trunk/Scribus/scribus/ui/cpalette.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21664&path=/trunk/Scribus/scribus/ui/cpalette.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/cpalette.cpp (original)
+++ trunk/Scribus/scribus/ui/cpalette.cpp Sun Dec 18 12:36:18 2016
@@ -93,6 +93,16 @@
shadeMeshPoint->setDecimals(0);
strokeModeCombo->addItem( tr("Solid") );
strokeModeCombo->addItem( tr("Gradient") );
+
+ colorPoint1->setPixmapType(ColorCombo::fancyPixmaps);
+ colorPoint2->setPixmapType(ColorCombo::fancyPixmaps);
+ colorPoint3->setPixmapType(ColorCombo::fancyPixmaps);
+ colorPoint4->setPixmapType(ColorCombo::fancyPixmaps);
+ colorMeshPoint->setPixmapType(ColorCombo::fancyPixmaps);
+ colorListFill->setPixmapType(ColorListBox::fancyPixmap);
+ colorListStroke->setPixmapType(ColorListBox::fancyPixmap);
+ hatchLineColor->setPixmapType(ColorCombo::fancyPixmaps);
+ hatchBackground->setPixmapType(ColorCombo::fancyPixmaps);
/* Setting a delegate to dispaly only icons for the patterns */
/* ScListWidgetDelegate* delegateF = new ScListWidgetDelegate(patternBox, patternBox);
@@ -476,19 +486,19 @@
}
gradEditStroke->setColors(colorList);
gradEdit->setColors(colorList);
- colorPoint1->updateBox(colorList, ColorCombo::fancyPixmaps, true);
- colorPoint2->updateBox(colorList, ColorCombo::fancyPixmaps, true);
- colorPoint3->updateBox(colorList, ColorCombo::fancyPixmaps, true);
- colorPoint4->updateBox(colorList, ColorCombo::fancyPixmaps, true);
- colorMeshPoint->updateBox(colorList, ColorCombo::fancyPixmaps, true);
- colorListFill->insertItems(colorList, ColorListBox::fancyPixmap);
- colorListStroke->insertItems(colorList, ColorListBox::fancyPixmap);
+ colorPoint1->updateBox(colorList, true);
+ colorPoint2->updateBox(colorList, true);
+ colorPoint3->updateBox(colorList, true);
+ colorPoint4->updateBox(colorList, true);
+ colorMeshPoint->updateBox(colorList, true);
+ colorListFill->insertItems(colorList);
+ colorListStroke->insertItems(colorList);
if (colorListFill->currentItem())
colorListFill->currentItem()->setSelected(false);
if (colorListStroke->currentItem())
colorListStroke->currentItem()->setSelected(false);
- hatchLineColor->updateBox(colorList, ColorCombo::fancyPixmaps, false);
- hatchBackground->updateBox(colorList, ColorCombo::fancyPixmaps, true);
+ hatchLineColor->updateBox(colorList, false);
+ hatchBackground->updateBox(colorList, true);
colorListStroke->blockSignals(sigBlocked1);
colorListFill->blockSignals(sigBlocked2);
Modified: trunk/Scribus/scribus/ui/dcolor.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21664&path=/trunk/Scribus/scribus/ui/dcolor.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/dcolor.cpp (original)
+++ trunk/Scribus/scribus/ui/dcolor.cpp Sun Dec 18 12:36:18 2016
@@ -49,8 +49,9 @@
replacementColData = new ColorCombo(false, this);
cList.remove(colorName);
// 10/26/2004 pv - user can replace deleted color with "None"
+ replacementColData->setPixmapType(ColorCombo::fancyPixmaps);
replacementColData->addItem(CommonStrings::tr_NoneColor);
- replacementColData->insertItems(cList, ColorCombo::fancyPixmaps);
+ replacementColData->insertItems(cList);
delColorLayout->addWidget( replacementColData, 1, 1 );
replacementColor = replacementColData->itemText(0);
}
Modified: trunk/Scribus/scribus/ui/effectsdialog.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21664&path=/trunk/Scribus/scribus/ui/effectsdialog.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/effectsdialog.cpp (original)
+++ trunk/Scribus/scribus/ui/effectsdialog.cpp Sun Dec 18 12:36:18 2016
@@ -106,7 +106,8 @@
layout17->addWidget( textLabel3 );
colData = new ColorCombo(false, WStackPage_2);
- colData->insertItems(m_doc->PageColors, ColorCombo::fancyPixmaps);
+ colData->setPixmapType(ColorCombo::fancyPixmaps);
+ colData->insertItems(m_doc->PageColors);
layout17->addWidget( colData );
WStackPageLayout->addLayout( layout17 );
@@ -242,7 +243,8 @@
textLabel1d = new QLabel( tr( "Color 1:" ), WStackPage_8 );
WStackPage8Layout->addWidget( textLabel1d, 0, 0 );
colData1 = new ColorCombo(false, WStackPage_8);
- colData1->insertItems(m_doc->PageColors, ColorCombo::fancyPixmaps);
+ colData1->setPixmapType(ColorCombo::fancyPixmaps);
+ colData1->insertItems(m_doc->PageColors);
WStackPage8Layout->addWidget( colData1, 0, 1, 1, 2);
shade1 = new ShadeButton(WStackPage_8);
shade1->setValue(100);
@@ -263,7 +265,8 @@
textLabel2d = new QLabel( tr( "Color 2:" ), WStackPage_8 );
WStackPage8Layout->addWidget( textLabel2d, 2, 0 );
colData2 = new ColorCombo(false, WStackPage_8);
- colData2->insertItems(m_doc->PageColors, ColorCombo::fancyPixmaps);
+ colData2->setPixmapType(ColorCombo::fancyPixmaps);
+ colData2->insertItems(m_doc->PageColors);
WStackPage8Layout->addWidget( colData2, 2, 1, 1, 2);
shade2 = new ShadeButton(WStackPage_8);
shade2->setValue(100);
@@ -292,7 +295,8 @@
textLabel1t = new QLabel( tr( "Color 1:" ), WStackPage_9 );
WStackPage9Layout->addWidget( textLabel1t, 0, 0 );
colDatat1 = new ColorCombo(false, WStackPage_9);
- colDatat1->insertItems(m_doc->PageColors, ColorCombo::fancyPixmaps);
+ colDatat1->setPixmapType(ColorCombo::fancyPixmaps);
+ colDatat1->insertItems(m_doc->PageColors);
WStackPage9Layout->addWidget( colDatat1, 0, 1, 1, 2 );
shadet1 = new ShadeButton(WStackPage_9);
shadet1->setValue(100);
@@ -312,7 +316,8 @@
textLabel2t = new QLabel( tr( "Color 2:" ), WStackPage_9 );
WStackPage9Layout->addWidget( textLabel2t, 2, 0 );
colDatat2 = new ColorCombo(false, WStackPage_9);
- colDatat2->insertItems(m_doc->PageColors, ColorCombo::fancyPixmaps);
+ colDatat2->setPixmapType(ColorCombo::fancyPixmaps);
+ colDatat2->insertItems(m_doc->PageColors);
WStackPage9Layout->addWidget( colDatat2, 2, 1, 1, 2 );
shadet2 = new ShadeButton(WStackPage_9);
shadet2->setValue(100);
@@ -332,7 +337,8 @@
textLabel3t = new QLabel( tr( "Color 3:" ), WStackPage_9 );
WStackPage9Layout->addWidget( textLabel3t, 4, 0 );
colDatat3 = new ColorCombo(false, WStackPage_9);
- colDatat3->insertItems(m_doc->PageColors, ColorCombo::fancyPixmaps);
+ colDatat3->setPixmapType(ColorCombo::fancyPixmaps);
+ colDatat3->insertItems(m_doc->PageColors);
WStackPage9Layout->addWidget( colDatat3, 4, 1, 1, 2 );
shadet3 = new ShadeButton(WStackPage_9);
shadet3->setValue(100);
@@ -358,7 +364,8 @@
textLabel1q = new QLabel( tr( "Color 1:" ), WStackPage_10 );
WStackPage10Layout->addWidget( textLabel1q, 0, 0 );
colDataq1 = new ColorCombo(false, WStackPage_10);
- colDataq1->insertItems(m_doc->PageColors, ColorCombo::fancyPixmaps);
+ colDataq1->setPixmapType(ColorCombo::fancyPixmaps);
+ colDataq1->insertItems(m_doc->PageColors);
WStackPage10Layout->addWidget( colDataq1, 0, 1, 1, 2 );
shadeq1 = new ShadeButton(WStackPage_10);
shadeq1->setValue(100);
@@ -378,7 +385,8 @@
textLabel2q = new QLabel( tr( "Color 2:" ), WStackPage_10 );
WStackPage10Layout->addWidget( textLabel2q, 2, 0 );
colDataq2 = new ColorCombo(false, WStackPage_10);
- colDataq2->insertItems(m_doc->PageColors, ColorCombo::fancyPixmaps);
+ colDataq2->setPixmapType(ColorCombo::fancyPixmaps);
+ colDataq2->insertItems(m_doc->PageColors);
WStackPage10Layout->addWidget( colDataq2, 2, 1, 1, 2 );
shadeq2 = new ShadeButton(WStackPage_10);
shadeq2->setValue(100);
@@ -398,7 +406,8 @@
textLabel3q = new QLabel( tr( "Color 3:" ), WStackPage_10 );
WStackPage10Layout->addWidget( textLabel3q, 4, 0 );
colDataqc3 = new ColorCombo(false, WStackPage_10);
- colDataqc3->insertItems(m_doc->PageColors, ColorCombo::fancyPixmaps);
+ colDataqc3->setPixmapType(ColorCombo::fancyPixmaps);
+ colDataqc3->insertItems(m_doc->PageColors);
WStackPage10Layout->addWidget( colDataqc3, 4, 1, 1, 2 );
shadeqc3 = new ShadeButton(WStackPage_10);
shadeqc3->setValue(100);
@@ -418,7 +427,8 @@
textLabel4q = new QLabel( tr( "Color 4:" ), WStackPage_10 );
WStackPage10Layout->addWidget( textLabel4q, 6, 0 );
colDataq4 = new ColorCombo(false, WStackPage_10);
- colDataq4->insertItems(m_doc->PageColors, ColorCombo::fancyPixmaps);
+ colDataq4->setPixmapType(ColorCombo::fancyPixmaps);
+ colDataq4->insertItems(m_doc->PageColors);
WStackPage10Layout->addWidget( colDataq4, 6, 1, 1, 2 );
shadeq4 = new ShadeButton(WStackPage_10);
shadeq4->setValue(100);
Modified: trunk/Scribus/scribus/ui/gradienteditor.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21664&path=/trunk/Scribus/scribus/ui/gradienteditor.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/gradienteditor.cpp (original)
+++ trunk/Scribus/scribus/ui/gradienteditor.cpp Sun Dec 18 12:36:18 2016
@@ -34,6 +34,7 @@
GradientEditor::GradientEditor(QWidget *pa) : QFrame(pa)
{
setupUi(this);
+ stopColor->setPixmapType(ColorCombo::fancyPixmaps);
stopPos->setDecimals(0);
stopOpacity->setDecimals(0);
stopShade->setDecimals(0);
@@ -61,7 +62,7 @@
void GradientEditor::setColors(ColorList &colorList)
{
m_colorList = colorList;
- stopColor->updateBox(colorList, ColorCombo::fancyPixmaps, true);
+ stopColor->updateBox(colorList, true);
}
void GradientEditor::setPos(double p)
Modified: trunk/Scribus/scribus/ui/propertywidget_textcolor.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21664&path=/trunk/Scribus/scribus/ui/propertywidget_textcolor.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/propertywidget_textcolor.cpp (original)
+++ trunk/Scribus/scribus/ui/propertywidget_textcolor.cpp Sun Dec 18 12:36:18 2016
@@ -26,16 +26,19 @@
layout()->setAlignment( Qt::AlignLeft );
fillLayout->setAlignment( Qt::AlignLeft );
+ fillColor->setPixmapType(ColorCombo::fancyPixmaps);
fillIcon->setPixmap(IconManager::instance()->loadPixmap("16/color-fill.png"));
fillIcon->setScaledContents( false );
fillShadeLabel->setPixmap(IconManager::instance()->loadPixmap("shade.png"));
strokeLayout->setAlignment( Qt::AlignLeft );
+ strokeColor->setPixmapType(ColorCombo::fancyPixmaps);
strokeIcon->setPixmap(IconManager::instance()->loadPixmap("16/color-stroke.png"));
strokeIcon->setScaledContents( false );
strokeShadeLabel->setPixmap(IconManager::instance()->loadPixmap("shade.png"));
backLayout->setAlignment( Qt::AlignLeft );
+ backColor->setPixmapType(ColorCombo::fancyPixmaps);
backIcon->setPixmap(IconManager::instance()->loadPixmap("16/color-fill.png"));
backIcon->setScaledContents( false );
backShadeLabel->setPixmap(IconManager::instance()->loadPixmap("shade.png"));
@@ -195,9 +198,9 @@
if (m_item)
disconnectSignals();
- fillColor->updateBox(m_doc->PageColors, ColorCombo::fancyPixmaps, true);
- strokeColor->updateBox(m_doc->PageColors, ColorCombo::fancyPixmaps, false);
- backColor->updateBox(m_doc->PageColors, ColorCombo::fancyPixmaps, true);
+ fillColor->updateBox(m_doc->PageColors, true);
+ strokeColor->updateBox(m_doc->PageColors, false);
+ backColor->updateBox(m_doc->PageColors, true);
fillColor->view()->setMinimumWidth(fillColor->view()->maximumViewportSize().width() + 24);
strokeColor->view()->setMinimumWidth(strokeColor->view()->maximumViewportSize().width() + 24);
backColor->view()->setMinimumWidth(backColor->view()->maximumViewportSize().width() + 24);
Modified: trunk/Scribus/scribus/ui/proptree.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21664&path=/trunk/Scribus/scribus/ui/proptree.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/proptree.cpp (original)
+++ trunk/Scribus/scribus/ui/proptree.cpp Sun Dec 18 12:36:18 2016
@@ -159,8 +159,8 @@
}
else if (item->m_type == PropTreeItem::ColorComboBox)
{
- ColorCombo *editor = new ColorCombo(parent);
- editor->updateBox(item->m_colors, ColorCombo::fancyPixmaps, false);
+ ColorCombo *editor = new ColorCombo(ColorCombo::fancyPixmaps, parent);
+ editor->updateBox(item->m_colors, false);
edito = editor;
edito->setAutoFillBackground(true);
connect(editor, SIGNAL(activated(int)), this, SLOT(valueHasChanged()));
Modified: trunk/Scribus/scribus/ui/replaceonecolor.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21664&path=/trunk/Scribus/scribus/ui/replaceonecolor.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/replaceonecolor.cpp (original)
+++ trunk/Scribus/scribus/ui/replaceonecolor.cpp Sun Dec 18 12:36:18 2016
@@ -33,10 +33,12 @@
setupUi(this);
setModal(true);
setWindowIcon(IconManager::instance()->loadIcon("AppIcon.png" ));
+ originalColor->setPixmapType(ColorCombo::fancyPixmaps);
originalColor->addItem(CommonStrings::tr_NoneColor);
- originalColor->insertItems(usedColors, ColorCombo::fancyPixmaps);
+ originalColor->insertItems(usedColors);
+ replacementColor->setPixmapType(ColorCombo::fancyPixmaps);
replacementColor->addItem(CommonStrings::tr_NoneColor);
- replacementColor->insertItems(availableColors, ColorCombo::fancyPixmaps);
+ replacementColor->insertItems(availableColors);
}
const QString replaceColorDialog::getOriginalColor()
Modified: trunk/Scribus/scribus/ui/search.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21664&path=/trunk/Scribus/scribus/ui/search.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/search.cpp (original)
+++ trunk/Scribus/scribus/ui/search.cpp Sun Dec 18 12:36:18 2016
@@ -134,7 +134,8 @@
SearchLayout->addWidget( SEffVal, 5, 1, Qt::AlignLeft );
SFillVal = new ColorCombo( Search );
SFillVal->setEditable(false);
- SFillVal->updateBox(doc->PageColors, ColorCombo::fancyPixmaps, true);
+ SFillVal->setPixmapType(ColorCombo::fancyPixmaps);
+ SFillVal->updateBox(doc->PageColors, true);
SFillVal->setMinimumWidth(SFillVal->view()->maximumViewportSize().width() + 24);
setCurrentComboItem(SFillVal, doc->currentStyle.charStyle().fillColor());
SFillVal->setEnabled(false);
@@ -144,7 +145,8 @@
SearchLayout->addWidget( SFillSVal, 7, 1, Qt::AlignLeft );
SStrokeVal = new ColorCombo( Search );
SStrokeVal->setEditable(false);
- SStrokeVal->updateBox(doc->PageColors, ColorCombo::fancyPixmaps, true);
+ SStrokeVal->setPixmapType(ColorCombo::fancyPixmaps);
+ SStrokeVal->updateBox(doc->PageColors, true);
SStrokeVal->view()->setMinimumWidth(SStrokeVal->view()->maximumViewportSize().width() + 24);
setCurrentComboItem(SStrokeVal, doc->currentStyle.charStyle().strokeColor());
SStrokeVal->setEnabled(false);
@@ -229,7 +231,8 @@
ReplaceLayout->addWidget( REffVal, 5, 1, Qt::AlignLeft );
RFillVal = new ColorCombo( true, Replace );
RFillVal->setEditable(false);
- RFillVal->updateBox(doc->PageColors, ColorCombo::fancyPixmaps, true);
+ RFillVal->setPixmapType(ColorCombo::fancyPixmaps);
+ RFillVal->updateBox(doc->PageColors, true);
RFillVal->view()->setMinimumWidth(RFillVal->view()->maximumViewportSize().width() + 24);
setCurrentComboItem(RFillVal, doc->currentStyle.charStyle().fillColor());
RFillVal->setEnabled(false);
@@ -239,7 +242,8 @@
ReplaceLayout->addWidget( RFillSVal, 7, 1, Qt::AlignLeft );
RStrokeVal = new ColorCombo( true, Replace );
RStrokeVal->setEditable(false);
- RStrokeVal->updateBox(doc->PageColors, ColorCombo::fancyPixmaps, true);
+ RStrokeVal->setPixmapType(ColorCombo::fancyPixmaps);
+ RStrokeVal->updateBox(doc->PageColors, true);
RStrokeVal->view()->setMinimumWidth(RStrokeVal->view()->maximumViewportSize().width() + 24);
setCurrentComboItem(RStrokeVal, doc->currentStyle.charStyle().strokeColor());
RStrokeVal->setEnabled(false);
Modified: trunk/Scribus/scribus/ui/selectobjects.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21664&path=/trunk/Scribus/scribus/ui/selectobjects.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/selectobjects.cpp (original)
+++ trunk/Scribus/scribus/ui/selectobjects.cpp Sun Dec 18 12:36:18 2016
@@ -33,10 +33,12 @@
setupUi(this);
setModal(true);
setWindowIcon(IconManager::instance()->loadIcon("AppIcon.png"));
+ backgroundCombo->setPixmapType(ColorCombo::fancyPixmaps);
backgroundCombo->addItem(CommonStrings::tr_NoneColor);
- backgroundCombo->insertItems(availableColors, ColorCombo::fancyPixmaps);
+ backgroundCombo->insertItems(availableColors);
+ lineCombo->setPixmapType(ColorCombo::fancyPixmaps);
lineCombo->addItem(CommonStrings::tr_NoneColor);
- lineCombo->insertItems(availableColors, ColorCombo::fancyPixmaps);
+ lineCombo->insertItems(availableColors);
lineWidthSpin->setNewUnit(unitIndex);
lineWidthSpin->setMinimum(0);
lineWidthSpin->setMaximum(1000);
Modified: trunk/Scribus/scribus/ui/smcellstylewidget.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21664&path=/trunk/Scribus/scribus/ui/smcellstylewidget.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/smcellstylewidget.cpp (original)
+++ trunk/Scribus/scribus/ui/smcellstylewidget.cpp Sun Dec 18 12:36:18 2016
@@ -17,6 +17,7 @@
setupUi(this);
fillColorIcon->setPixmap(IconManager::instance()->loadPixmap("16/color-fill.png"));
+ fillColor->setPixmapType(ColorCombo::fancyPixmaps);
fillColor->addItem(CommonStrings::tr_NoneColor);
fillShadeLabel->setPixmap(IconManager::instance()->loadPixmap("shade.png") );
}
@@ -173,7 +174,7 @@
ScribusDoc* doc = colors.document();
for (ColorList::Iterator it = colors.begin(); it != itEnd; ++it)
{
- fillColor->insertFancyItem(it.value(), doc, it.key());
+ fillColor->insertItem(it.value(), doc, it.key());
}
fillColor->view()->setMinimumWidth(fillColor->view()->maximumViewportSize().width()+24);
}
Modified: trunk/Scribus/scribus/ui/smcstylewidget.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21664&path=/trunk/Scribus/scribus/ui/smcstylewidget.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/smcstylewidget.cpp (original)
+++ trunk/Scribus/scribus/ui/smcstylewidget.cpp Sun Dec 18 12:36:18 2016
@@ -35,14 +35,18 @@
backIcon->setPixmap(im->loadPixmap("16/color-fill.png"));
backShadeLabel->setPixmap(im->loadPixmap("shade.png"));
+ fillColor_->setPixmapType(ColorCombo::fancyPixmaps);
fillColor_->clear();
+ fillColor_->addItem(CommonStrings::tr_NoneColor);
+
+ strokeColor_->setPixmapType(ColorCombo::fancyPixmaps);
strokeColor_->clear();
+ strokeColor_->addItem(CommonStrings::tr_NoneColor);
+
+ backColor_->setPixmapType(ColorCombo::fancyPixmaps);
backColor_->clear();
- ColorList::Iterator it;
- QPixmap pm = QPixmap(15, 15);
- fillColor_->addItem(CommonStrings::tr_NoneColor);
- strokeColor_->addItem(CommonStrings::tr_NoneColor);
backColor_->addItem(CommonStrings::tr_NoneColor);
+
StrokeIcon->setEnabled(false);
strokeShade_->setEnabled(false);
strokeColor_->setEnabled(false);
@@ -185,9 +189,9 @@
ScribusDoc* doc = colors.document();
for (ColorList::Iterator it = colors.begin(); it != itend; ++it)
{
- fillColor_->insertFancyItem(it.value(), doc, it.key());
- strokeColor_->insertFancyItem(it.value(), doc, it.key());
- backColor_->insertFancyItem(it.value(), doc, it.key());
+ fillColor_->insertItem(it.value(), doc, it.key());
+ strokeColor_->insertItem(it.value(), doc, it.key());
+ backColor_->insertItem(it.value(), doc, it.key());
}
fillColor_->view()->setMinimumWidth(fillColor_->view()->maximumViewportSize().width()+24);
strokeColor_->view()->setMinimumWidth(strokeColor_->view()->maximumViewportSize().width()+24);
Modified: trunk/Scribus/scribus/ui/smlinestylewidget.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21664&path=/trunk/Scribus/scribus/ui/smlinestylewidget.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/smlinestylewidget.cpp (original)
+++ trunk/Scribus/scribus/ui/smlinestylewidget.cpp Sun Dec 18 12:36:18 2016
@@ -21,6 +21,9 @@
SMLineStyleWidget::SMLineStyleWidget() : QWidget()
{
setupUi(this);
+
+ colorCombo->setPixmapType(ColorCombo::fancyPixmaps);
+
IconManager* im = IconManager::instance();
addButton->setIcon(im->loadIcon("penciladd.png"));
removeButton->setIcon(im->loadIcon("pencilsub.png"));
@@ -101,7 +104,7 @@
disconnect(lineStyles, SIGNAL(currentRowChanged(int)), this, SLOT(slotEditNewLine(int)));
m_currentStyle = lineStyle;
colorCombo->clear();
- colorCombo->updateBox(colorList, ColorCombo::fancyPixmaps, false);
+ colorCombo->updateBox(colorList, false);
m_colors = colorList;
updateLineList();
slotEditNewLine(subLine);
Modified: trunk/Scribus/scribus/ui/smpstylewidget.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21664&path=/trunk/Scribus/scribus/ui/smpstylewidget.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/smpstylewidget.cpp (original)
+++ trunk/Scribus/scribus/ui/smpstylewidget.cpp Sun Dec 18 12:36:18 2016
@@ -42,6 +42,8 @@
spaceBelowLabel->setPixmap(IconManager::instance()->loadPixmap("below.png") );
backIcon->setPixmap(IconManager::instance()->loadPixmap("16/color-fill.png"));
backShadeLabel->setPixmap(IconManager::instance()->loadPixmap("shade.png"));
+
+ backColor_->setPixmapType(ColorCombo::fancyPixmaps);
backColor_->clear();
backColor_->addItem(CommonStrings::tr_NoneColor);
@@ -177,7 +179,7 @@
ScribusDoc* doc = colors.document();
for (ColorList::Iterator it = colors.begin(); it != itend; ++it)
{
- backColor_->insertFancyItem(it.value(), doc, it.key());
+ backColor_->insertItem(it.value(), doc, it.key());
}
backColor_->view()->setMinimumWidth(backColor_->view()->maximumViewportSize().width()+24);
}
Modified: trunk/Scribus/scribus/ui/smtablestylewidget.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21664&path=/trunk/Scribus/scribus/ui/smtablestylewidget.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/smtablestylewidget.cpp (original)
+++ trunk/Scribus/scribus/ui/smtablestylewidget.cpp Sun Dec 18 12:36:18 2016
@@ -17,6 +17,7 @@
setupUi(this);
fillColorIcon->setPixmap(IconManager::instance()->loadPixmap("16/color-fill.png"));
+ fillColor->setPixmapType(ColorCombo::fancyPixmaps);
fillColor->addItem(CommonStrings::tr_NoneColor);
fillShadeLabel->setPixmap(IconManager::instance()->loadPixmap("shade.png") );
}
@@ -173,7 +174,7 @@
ScribusDoc* doc = colors.document();
for (ColorList::Iterator it = colors.begin(); it != itEnd; ++it)
{
- fillColor->insertFancyItem(it.value(), doc, it.key());
+ fillColor->insertItem(it.value(), doc, it.key());
}
fillColor->view()->setMinimumWidth(fillColor->view()->maximumViewportSize().width()+24);
}
Modified: trunk/Scribus/scribus/ui/storyeditor.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21664&path=/trunk/Scribus/scribus/ui/storyeditor.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/storyeditor.cpp (original)
+++ trunk/Scribus/scribus/ui/storyeditor.cpp Sun Dec 18 12:36:18 2016
@@ -1119,6 +1119,7 @@
fillIconAction=addWidget(FillIcon);
fillIconAction->setVisible(true);
TxFill = new ColorCombo(false, this);
+ TxFill->setPixmapType(ColorCombo::smallPixmaps);
txFillAction=addWidget(TxFill);
txFillAction->setVisible(true);
PM2 = new ShadeButton(this);
@@ -1155,7 +1156,7 @@
void SToolBColorF::setCurrentDocument(ScribusDoc *doc)
{
if (doc!=NULL)
- TxFill->updateBox(doc->PageColors, ColorCombo::smallPixmaps, true);
+ TxFill->updateBox(doc->PageColors, true);
else
{
TxFill->clear();
@@ -1192,6 +1193,7 @@
strokeIconAction=addWidget(StrokeIcon);
strokeIconAction->setVisible(true);
TxStroke = new ColorCombo(false, this);
+ TxStroke->setPixmapType(ColorCombo::smallPixmaps);
txStrokeAction=addWidget(TxStroke);
txStrokeAction->setVisible(true);
PM1 = new ShadeButton(this);
@@ -1228,7 +1230,7 @@
TxStroke->clear();
TxStroke->addItem(CommonStrings::tr_NoneColor);
if (doc!=NULL)
- TxStroke->insertItems(doc->PageColors, ColorCombo::smallPixmaps);
+ TxStroke->insertItems(doc->PageColors);
resize(minimumSizeHint());
}
More information about the scribus-commit
mailing list