summaryrefslogtreecommitdiffabout
path: root/microkde/kfontdialog.cpp
authorzautrix <zautrix>2004-06-26 19:01:18 (UTC)
committer zautrix <zautrix>2004-06-26 19:01:18 (UTC)
commitb9aad1f15dc600e4dbe4c62d3fcced6363188ba3 (patch) (side-by-side diff)
tree2c3d4004fb21c72cba65793859f9bcd8ffd3a49c /microkde/kfontdialog.cpp
downloadkdepimpi-b9aad1f15dc600e4dbe4c62d3fcced6363188ba3.zip
kdepimpi-b9aad1f15dc600e4dbe4c62d3fcced6363188ba3.tar.gz
kdepimpi-b9aad1f15dc600e4dbe4c62d3fcced6363188ba3.tar.bz2
Initial revision
Diffstat (limited to 'microkde/kfontdialog.cpp') (more/less context) (show whitespace changes)
-rw-r--r--microkde/kfontdialog.cpp32
1 files changed, 32 insertions, 0 deletions
diff --git a/microkde/kfontdialog.cpp b/microkde/kfontdialog.cpp
new file mode 100644
index 0000000..174123c
--- a/dev/null
+++ b/microkde/kfontdialog.cpp
@@ -0,0 +1,32 @@
+#include "kfontdialog.h"
+#ifndef DESKTOP_VERSION
+#include "ofontselector.h"
+#else
+#include <qfontdialog.h>
+#endif
+#include <qdialog.h>
+#include <qlayout.h>
+#include <qpushbutton.h>
+QFont KFontDialog::getFont( const QFont & f, bool & ok )
+{
+#ifndef DESKTOP_VERSION
+ QDialog d( 0, "fd", true );;
+ OFontSelector s ( true, &d, "fontsel");
+ QVBoxLayout l ( &d );
+ l.addWidget( &s );
+ s.setSelectedFont ( f );
+ QPushButton b ( "OK", &d );
+ l.addWidget( &b );
+ qDebug("size %d ", f.bold());
+ QObject::connect( &b, SIGNAL( clicked () ), &d, SLOT ( accept () ) );
+ d.show();
+ ok = false;
+ if ( d.exec () ) {
+ ok = true;
+ return s.selectedFont ( );
+ }
+ return f;
+#else
+ return QFontDialog::getFont ( &ok, f, 0, "fontdialog" );
+#endif
+}