28 setMinimumSize(600, 450);
33 m_quickWidget->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
36 this->setWindowTitle(i18nc(
"@title:window",
"Edit Style Preset"));
39 Q_FOREACH (
const QString langCode, KLocalizedString::languages()) {
40 wellFormedBCPNames.append(langCode.split(
"_").join(
"-"));
43 connect(
m_model, SIGNAL(textPropertyChanged()),
46 m_quickWidget->setSource(QUrl(
"qrc:/CssStylePresetEdit.qml"));
49 qWarning() <<
"Errors in " << windowTitle() <<
":" <<
m_quickWidget->errors();
52 m_quickWidget->rootObject()->setProperty(
"locales", QVariant::fromValue(wellFormedBCPNames));
83 m_quickWidget->rootObject()->setProperty(
"sampleWidth", paragraphSampleSize.width());
84 m_quickWidget->rootObject()->setProperty(
"sampleHeight", paragraphSampleSize.height());
86 m_quickWidget->rootObject()->setProperty(
"makePixelRelative", storedPPI > 0);
114 const QString before =
m_quickWidget->rootObject()->property(
"beforeSample").toString();
115 const QString sample =
m_quickWidget->rootObject()->property(
"sampleText").toString();
116 const QString after =
m_quickWidget->rootObject()->property(
"afterSample").toString();
117 const QString styleType =
m_quickWidget->rootObject()->property(
"styleType").toString();
119 const int sampleHeight =
m_quickWidget->rootObject()->property(
"sampleHeight").toInt();
120 const int sampleWidth =
m_quickWidget->rootObject()->property(
"sampleWidth").toInt();
121 const QSizeF sampleSize = QSizeF(sampleWidth, sampleHeight);
137 if (styleType ==
"paragraph") {
173 const bool makePixelRelative =
m_quickWidget->rootObject()->property(
"makePixelRelative").toBool();
175 const int canvasPPI =
m_quickWidget->rootObject()->property(
"canvasDPI").toInt();
177 if (storedPPI > 0 && !makePixelRelative) {
178 const double scale = double(storedPPI)/double(canvasPPI);
181 }
else if(storedPPI == 0 && makePixelRelative) {
182 const double scale = double(canvasPPI)/double(72);
The KoSvgTextPropertiesModel class.
lager::cursor< KoSvgTextPropertyData > textData
void scaleAbsoluteValues(const double scaleInline=1.0, const double scaleBlock=1.0)
scaleAbsoluteValues This scales all absolute values stored in these text properties....
The KoSvgTextPropertyData struct.
KoSvgTextProperties commonProperties
The properties common between all the selected text.
KoSvgTextProperties inheritedProperties
The properties that are inherited, so that widgets may be set correctly.