summaryrefslogtreecommitdiffstats
path: root/ksirc/KSPrefs/page_font.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'ksirc/KSPrefs/page_font.cpp')
-rw-r--r--ksirc/KSPrefs/page_font.cpp38
1 files changed, 38 insertions, 0 deletions
diff --git a/ksirc/KSPrefs/page_font.cpp b/ksirc/KSPrefs/page_font.cpp
new file mode 100644
index 00000000..e9f9e0e6
--- /dev/null
+++ b/ksirc/KSPrefs/page_font.cpp
@@ -0,0 +1,38 @@
+#include "page_font.h"
+#include "qapplication.h"
+PageFont::PageFont( QWidget *parent, const char *name ) :
+ QWidget( parent, name)
+{
+ layout = new QHBoxLayout(this);
+ fontchooser = new KFontChooser(this);
+ layout->addWidget(fontchooser);
+ connect(fontchooser,SIGNAL(fontSelected ( const QFont&)), this, SLOT(update()));
+}
+
+PageFont::~PageFont( )
+{
+
+}
+
+void PageFont::update( void ){
+ emit modified();
+}
+
+void PageFont::saveConfig( void )
+{
+ ksopts->defaultFont = fontchooser->font();
+ QApplication::setFont(fontchooser->font(), true, "KSirc::TextView" );
+}
+
+void PageFont::readConfig( const KSOColors * opts )
+{
+ /* Just set the font from the preferences */
+ fontchooser->setFont( opts->defaultFont );
+}
+
+void PageFont::defaultConfig( void )
+{
+ fontchooser->setFont( ksopts->defaultFont );
+}
+
+#include "page_font.moc"