Commit 210fd2c8 authored by Kuntal  Majumder's avatar Kuntal Majumder 😟

separator added

parent 624ca78c
......@@ -189,7 +189,8 @@ void SvgTextEditor::setShape(KoSvgTextShape *shape)
QMessageBox::warning(this, i18n("Conversion failed"), "Could not get svg text from the shape:\n" + converter.errors().join('\n') + "\n" + converter.warnings().join('\n'));
}
}
KisFontComboBoxes* fontComboBox = qobject_cast<KisFontComboBoxes*>(qobject_cast<QWidgetAction*>(actionCollection()->action("svg_font"))->defaultWidget());
fontComboBox->hasInitialized();
}
void SvgTextEditor::save()
......
......@@ -27,9 +27,10 @@
#include <QCompleter>
#include <klocalizedstring.h>
#include <QDebug>
#include <kis_debug.h>
KisFontFamilyComboBox::KisFontFamilyComboBox(QWidget *parent)
:QComboBox(parent)
:QComboBox(parent), m_initilized(false)
{
setEditable(true);
completer()->setCompletionMode(QCompleter::InlineCompletion);
......@@ -99,14 +100,15 @@ void KisFontFamilyComboBox::refillComboBox(QVector<QFontDatabase::WritingSystem>
view()->setMinimumWidth(maxWidth);
}
void KisFontFamilyComboBox::setTopFont(QString family){
if(family.isEmpty())
void KisFontFamilyComboBox::setTopFont(const QString &family){
if(family.isEmpty() || !m_initilized)
return;
if(m_pinnedFonts.contains(family))
return;
if(m_pinnedFonts.count() > 5){
if(m_pinnedFonts.count() > 4){
this->removeItem(4);
m_pinnedFonts.pop_back();
}
......@@ -231,10 +233,15 @@ void KisFontComboBoxes::fontFamilyChanged()
if (styles.contains(currentText)) {
m_styles->setCurrentText(currentText);
}
}
void KisFontComboBoxes::fontChange()
{
emit fontChanged(currentFont(10).toString());
}
void KisFontComboBoxes::hasInitialized()
{
KisFontFamilyComboBox *cmb = qobject_cast<KisFontFamilyComboBox*>(m_family);
cmb->hasInitialized();
}
......@@ -61,6 +61,7 @@ public:
QFont currentFont(int pointSize = 10) const;
void refillComboBox(QVector<QFontDatabase::WritingSystem> writingSystems = QVector<QFontDatabase::WritingSystem>());
void hasInitialized();
Q_SIGNALS:
void fontChanged(QString);
......@@ -87,12 +88,13 @@ public:
//List of writing systems to use. If empty will default to "all"
void refillComboBox(QVector<QFontDatabase::WritingSystem> writingSystems = QVector<QFontDatabase::WritingSystem>());
void setTopFont(QString family);
void setTopFont(const QString &family);
inline void hasInitialized() { m_initilized = true; };
private:
QStringList m_blacklistedFonts;
QStringList m_pinnedFonts;
private:
QStringList m_pinnedFonts, m_blacklistedFonts;
bool m_initilized;
};
#endif // KIS_FONT_FAMILY_COMBO_BOX_H
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment