mirror of
https://invent.kde.org/graphics/okular
synced 2024-09-12 20:51:17 +00:00
Get rid of our custom anti-aliasing options and use the Document settings.
Also react correctly when they change, and a PS document is open. svn path=/trunk/KDE/kdegraphics/okular/; revision=757659
This commit is contained in:
parent
f238c3d95d
commit
056de06cf0
|
@ -5,14 +5,6 @@
|
||||||
http://www.kde.org/standards/kcfg/1.0/kcfg.xsd" >
|
http://www.kde.org/standards/kcfg/1.0/kcfg.xsd" >
|
||||||
<kcfgfile name="okular-generator-ghostscriptrc"/>
|
<kcfgfile name="okular-generator-ghostscriptrc"/>
|
||||||
<group name="General">
|
<group name="General">
|
||||||
<entry name="GraphicsAntialiasing" type="Bool">
|
|
||||||
<label>Whether to use anti-aliasing for graphics.</label>
|
|
||||||
<whatsthis>Anti-aliasing makes the result look better, but it makes the display take longer</whatsthis>
|
|
||||||
</entry>
|
|
||||||
<entry name="TextAntialiasing" type="Bool">
|
|
||||||
<label>Whether to use anti-aliasing for graphics.</label>
|
|
||||||
<whatsthis>Anti-aliasing makes the result look better, but it makes the display take longer</whatsthis>
|
|
||||||
</entry>
|
|
||||||
<entry name="PlatformFonts" type="Bool">
|
<entry name="PlatformFonts" type="Bool">
|
||||||
<label>Use Platform Fonts</label>
|
<label>Use Platform Fonts</label>
|
||||||
<whatsthis>Determines whether Ghostscript should be allowed to use platform fonts, if false only usage of fonts embedded in the document will be allowed</whatsthis>
|
<whatsthis>Determines whether Ghostscript should be allowed to use platform fonts, if false only usage of fonts embedded in the document will be allowed</whatsthis>
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>328</width>
|
<width>328</width>
|
||||||
<height>131</height>
|
<height>73</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QVBoxLayout" >
|
<layout class="QVBoxLayout" >
|
||||||
|
@ -28,26 +28,6 @@
|
||||||
<string>General Settings</string>
|
<string>General Settings</string>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QVBoxLayout" >
|
<layout class="QVBoxLayout" >
|
||||||
<item>
|
|
||||||
<widget class="QCheckBox" name="kcfg_TextAntialiasing" >
|
|
||||||
<property name="whatsThis" >
|
|
||||||
<string>Anti-aliasing makes the result look better, but it makes the display take longer</string>
|
|
||||||
</property>
|
|
||||||
<property name="text" >
|
|
||||||
<string>&Enable anti-aliasing of fonts</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QCheckBox" name="kcfg_GraphicsAntialiasing" >
|
|
||||||
<property name="whatsThis" >
|
|
||||||
<string>Anti-aliasing makes the result look better, but it makes the display take longer</string>
|
|
||||||
</property>
|
|
||||||
<property name="text" >
|
|
||||||
<string>&Enable anti-aliasing of graphics</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
<item>
|
||||||
<widget class="QCheckBox" name="kcfg_PlatformFonts" >
|
<widget class="QCheckBox" name="kcfg_PlatformFonts" >
|
||||||
<property name="enabled" >
|
<property name="enabled" >
|
||||||
|
|
|
@ -70,7 +70,23 @@ GSGenerator::~GSGenerator()
|
||||||
|
|
||||||
bool GSGenerator::reparseConfig()
|
bool GSGenerator::reparseConfig()
|
||||||
{
|
{
|
||||||
return false;
|
bool changed = false;
|
||||||
|
if (m_internalDocument)
|
||||||
|
{
|
||||||
|
#define SET_HINT(hintname, hintdefvalue, hintvar) \
|
||||||
|
{ \
|
||||||
|
bool newhint = documentMetaData(hintname, hintdefvalue).toBool(); \
|
||||||
|
if (newhint != cache_##hintvar) \
|
||||||
|
{ \
|
||||||
|
cache_##hintvar = newhint; \
|
||||||
|
changed = true; \
|
||||||
|
} \
|
||||||
|
}
|
||||||
|
SET_HINT("GraphicsAntialias", true, AAgfx)
|
||||||
|
SET_HINT("TextAntialias", true, AAtext)
|
||||||
|
#undef SET_HINT
|
||||||
|
}
|
||||||
|
return changed;
|
||||||
}
|
}
|
||||||
|
|
||||||
void GSGenerator::addPages( KConfigDialog *dlg )
|
void GSGenerator::addPages( KConfigDialog *dlg )
|
||||||
|
@ -135,6 +151,9 @@ bool GSGenerator::print( QPrinter& printer )
|
||||||
|
|
||||||
bool GSGenerator::loadDocument( const QString & fileName, QVector< Okular::Page * > & pagesVector )
|
bool GSGenerator::loadDocument( const QString & fileName, QVector< Okular::Page * > & pagesVector )
|
||||||
{
|
{
|
||||||
|
cache_AAtext = documentMetaData("TextAntialias", true).toBool();
|
||||||
|
cache_AAgfx = documentMetaData("GraphicsAntialias", true).toBool();
|
||||||
|
|
||||||
m_internalDocument = spectre_document_new();
|
m_internalDocument = spectre_document_new();
|
||||||
spectre_document_load(m_internalDocument, QFile::encodeName(fileName));
|
spectre_document_load(m_internalDocument, QFile::encodeName(fileName));
|
||||||
pagesVector.resize( spectre_document_get_n_pages(m_internalDocument) );
|
pagesVector.resize( spectre_document_get_n_pages(m_internalDocument) );
|
||||||
|
@ -197,8 +216,8 @@ void GSGenerator::generatePixmap( Okular::PixmapRequest * req )
|
||||||
renderer->setPlatformFonts(GSSettings::platformFonts());
|
renderer->setPlatformFonts(GSSettings::platformFonts());
|
||||||
int graphicsAA = 1;
|
int graphicsAA = 1;
|
||||||
int textAA = 1;
|
int textAA = 1;
|
||||||
if (GSSettings::graphicsAntialiasing()) graphicsAA = 4;
|
if (cache_AAgfx) graphicsAA = 4;
|
||||||
if (GSSettings::textAntialiasing()) textAA = 2;
|
if (cache_AAtext) textAA = 2;
|
||||||
renderer->setAABits(graphicsAA, textAA);
|
renderer->setAABits(graphicsAA, textAA);
|
||||||
|
|
||||||
renderer->setRotation( req->page()->orientation() * 90 );
|
renderer->setRotation( req->page()->orientation() * 90 );
|
||||||
|
|
|
@ -62,6 +62,9 @@ class GSGenerator : public Okular::Generator, public Okular::ConfigInterface, pu
|
||||||
Okular::DocumentInfo *m_docInfo;
|
Okular::DocumentInfo *m_docInfo;
|
||||||
|
|
||||||
Okular::PixmapRequest *m_request;
|
Okular::PixmapRequest *m_request;
|
||||||
|
|
||||||
|
bool cache_AAtext;
|
||||||
|
bool cache_AAgfx;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in a new issue