--- /dev/null
+<!DOCTYPE UI><UI version="3.1" stdsetdef="1">
+<class>KitaColorPrefBase</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>KitaColorPrefBase</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>600</width>
+ <height>480</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Form1</string>
+ </property>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>customColorCheck</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>10</x>
+ <y>10</y>
+ <width>122</width>
+ <height>18</height>
+ </rect>
+ </property>
+ <property name="text">
+ <string>Use custom colors</string>
+ </property>
+ </widget>
+ <widget class="KListBox">
+ <property name="name">
+ <cstring>colorList</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>10</x>
+ <y>40</y>
+ <width>230</width>
+ <height>170</height>
+ </rect>
+ </property>
+ </widget>
+ <widget class="KPushButton">
+ <property name="name">
+ <cstring>kPushButton1</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>250</x>
+ <y>40</y>
+ <width>80</width>
+ <height>30</height>
+ </rect>
+ </property>
+ <property name="text">
+ <string>Change...</string>
+ </property>
+ </widget>
+</widget>
+<connections>
+ <connection>
+ <sender>customColorCheck</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>colorList</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+</connections>
+<slots>
+ <slot>customColorCheck_toggled( bool state )</slot>
+</slots>
+<layoutdefaults spacing="6" margin="11"/>
+<includehints>
+ <includehint>klistbox.h</includehint>
+ <includehint>kpushbutton.h</includehint>
+</includehints>
+</UI>
#include <qlayout.h>
#include <qlabel.h>
#include <qpushbutton.h>
+#include <qlistbox.h>
#include "kitafontprefbase.h"
#include "kitaconfig.h"
// this is the base class for your preferences dialog. it is now
// a Treelist dialog.. but there are a number of other
// possibilities (including Tab, Swallow, and just Plain)
- QFrame *frame;
- frame = addPage(i18n("Font"), i18n("Font"));
- m_fontPage = new KitaFontPrefPage(frame);
-
-// frame = addPage(i18n("Second Page"), i18n("Page Two Options"));
-// m_pageTwo = new KitaPrefPageTwo(frame);
+ QFrame* fontFrame = addPage( i18n( "Font" ), i18n( "Font" ) );
+ m_fontPage = new KitaFontPrefPage( fontFrame );
connect( m_fontPage, SIGNAL( fontChanged( const QFont& ) ),
SIGNAL( fontChanged( const QFont& ) ) );
connect( m_fontPage, SIGNAL( threadFontChanged( const QFont& ) ),
SIGNAL( threadFontChanged( const QFont& ) ) );
+
+ QFrame* colorFrame = addPage( i18n( "Color(broken)" ), i18n( "Color" ) );
+ m_colorPage = new KitaColorPrefPage( colorFrame );
}
KitaFontPrefPage::KitaFontPrefPage( QWidget *parent )
}
}
-KitaPrefPageTwo::KitaPrefPageTwo( QWidget *parent )
- : QFrame(parent)
+KitaColorPrefPage::KitaColorPrefPage( QWidget *parent )
+ : KitaColorPrefBase(parent)
{
- QHBoxLayout *layout = new QHBoxLayout(this);
- layout->setAutoAdd(true);
-
- new QLabel(i18n("Add something here"), this);
+ // FIXME: refactoring.
+ QPixmap textPixmap( 30, 10 );
+ textPixmap.fill( Qt::black );
+ colorList->insertItem( textPixmap, "text" );
+
+ QPixmap backPixmap( 30, 10 );
+ backPixmap.fill( Qt::white );
+ colorList->insertItem( backPixmap, "background" );
+
+ QPixmap popupTextPixmap( 30, 10 );
+ popupTextPixmap.fill( Qt::black );
+ colorList->insertItem( popupTextPixmap, "popup text" );
+
+ QPixmap popupBackPixmap( 30, 10 );
+ popupBackPixmap.fill( Qt::yellow );
+ colorList->insertItem( popupBackPixmap, "popup background" );
}
+
#include "pref.moc"
#include <qframe.h>
#include "kitafontprefbase.h"
+#include "kitacolorprefbase.h"
class KitaFontPrefPage;
-class KitaPrefPageTwo;
+class KitaColorPrefPage;
class KitaPreferences : public KDialogBase
{
private:
KitaFontPrefPage *m_fontPage;
- KitaPrefPageTwo *m_pageTwo;
+ KitaColorPrefPage *m_colorPage;
signals:
void fontChanged( const QFont& );
void threadFontChanged( const QFont & );
};
-class KitaPrefPageTwo : public QFrame
+class KitaColorPrefPage : public KitaColorPrefBase
{
Q_OBJECT
public:
- KitaPrefPageTwo( QWidget *parent = 0 );
+ KitaColorPrefPage( QWidget *parent = 0 );
};
#endif // _KITAPREF_H_