diff options
author | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
---|---|---|
committer | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
commit | ce599e4f9f94b4eb00c1b5edb85bce5431ab3df2 (patch) | |
tree | d3bb9f5d25a2dc09ca81adecf39621d871534297 /kwordquiz/src/prefcardappearance.cpp | |
download | tdeedu-ce599e4f9f94b4eb00c1b5edb85bce5431ab3df2.tar.gz tdeedu-ce599e4f9f94b4eb00c1b5edb85bce5431ab3df2.zip |
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdeedu@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kwordquiz/src/prefcardappearance.cpp')
-rw-r--r-- | kwordquiz/src/prefcardappearance.cpp | 95 |
1 files changed, 95 insertions, 0 deletions
diff --git a/kwordquiz/src/prefcardappearance.cpp b/kwordquiz/src/prefcardappearance.cpp new file mode 100644 index 00000000..165abeab --- /dev/null +++ b/kwordquiz/src/prefcardappearance.cpp @@ -0,0 +1,95 @@ +// +// C++ Implementation: +// +// Description: KWordQuiz flashcard appearance preferences +// +// +// Author: Peter Hedlund <peter.hedlund@kdemail.net>, (C) 2004 +// +// Copyright: See COPYING file that comes with this distribution +// +// +#include <qwidgetstack.h> +#include <qlabel.h> + +#include <kfontrequester.h> +#include <kcolorbutton.h> +#include <klocale.h> + +#include "prefcardappearance.h" + +PrefCardAppearance::PrefCardAppearance(QWidget *parent, const char *name) + : PrefCardAppearanceBase(parent, name) +{ + widgetStack->raiseWidget(frontStackPage); +} + + +PrefCardAppearance::~PrefCardAppearance() +{ +} + +void PrefCardAppearance::slotFlipButtonClicked( ) +{ + if (widgetStack->visibleWidget() == frontStackPage) + widgetStack->raiseWidget(backStackPage); + else + widgetStack->raiseWidget(frontStackPage); +} + +void PrefCardAppearance::slotFontChanged(const QFont & font) +{ + textLabel->setFont(font); +} + +void PrefCardAppearance::slotTextColorChanged( const QColor & color) +{ + textLabel->setPaletteForegroundColor(color); +} + +void PrefCardAppearance::slotCardColorChanged( const QColor & color) +{ + cardFrame->setPaletteBackgroundColor(color); + titleLabel->setPaletteBackgroundColor(color); + textLabel->setPaletteBackgroundColor(color); + line->setPaletteBackgroundColor(color); +} + +void PrefCardAppearance::slotFrameColorChanged( const QColor & color) +{ + cardFrame->setPaletteForegroundColor(color); + line->setPaletteForegroundColor(color); +} + +void PrefCardAppearance::slotAboutToShowWidget(QWidget * widget) +{ + if (widget == backStackPage) + { + titleLabel->setText(i18n("Back of the flashcard", "Back")); + titleLabel->setPaletteBackgroundColor(kcfg_BackCardColor->color()); + textLabel->setText(i18n("Answer")); + textLabel->setFont(kcfg_BackFont->font()); + textLabel->setPaletteForegroundColor(kcfg_BackTextColor->color()); + textLabel->setPaletteBackgroundColor(kcfg_BackCardColor->color()); + cardFrame->setPaletteBackgroundColor(kcfg_BackCardColor->color()); + cardFrame->setPaletteForegroundColor(kcfg_BackFrameColor->color()); + line->setPaletteForegroundColor(kcfg_BackFrameColor->color()); + line->setPaletteBackgroundColor(kcfg_BackCardColor->color()); + } + else + { + titleLabel->setText(i18n("Front")); + titleLabel->setPaletteBackgroundColor(kcfg_FrontCardColor->color()); + textLabel->setText(i18n("Question")); + textLabel->setFont(kcfg_FrontFont->font()); + textLabel->setPaletteForegroundColor(kcfg_FrontTextColor->color()); + textLabel->setPaletteBackgroundColor(kcfg_FrontCardColor->color()); + cardFrame->setPaletteBackgroundColor(kcfg_FrontCardColor->color()); + cardFrame->setPaletteForegroundColor(kcfg_FrontFrameColor->color()); + line->setPaletteForegroundColor(kcfg_FrontFrameColor->color()); + line->setPaletteBackgroundColor(kcfg_FrontCardColor->color()); + } +} + + +#include "prefcardappearance.moc" |