summaryrefslogtreecommitdiffstats
path: root/src/k3bthemedlabel.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-02-03 02:15:56 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-02-03 02:15:56 +0000
commit50b48aec6ddd451a6d1709c0942477b503457663 (patch)
treea9ece53ec06fd0a2819de7a2a6de997193566626 /src/k3bthemedlabel.cpp
downloadk3b-50b48aec6ddd451a6d1709c0942477b503457663.tar.gz
k3b-50b48aec6ddd451a6d1709c0942477b503457663.zip
Added abandoned KDE3 version of K3B
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/k3b@1084400 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'src/k3bthemedlabel.cpp')
-rw-r--r--src/k3bthemedlabel.cpp76
1 files changed, 76 insertions, 0 deletions
diff --git a/src/k3bthemedlabel.cpp b/src/k3bthemedlabel.cpp
new file mode 100644
index 0000000..d2ea05b
--- /dev/null
+++ b/src/k3bthemedlabel.cpp
@@ -0,0 +1,76 @@
+/*
+ *
+ * $Id: sourceheader 511311 2006-02-19 14:51:05Z trueg $
+ * Copyright (C) 2006 Sebastian Trueg <trueg@k3b.org>
+ *
+ * This file is part of the K3b project.
+ * Copyright (C) 1998-2007 Sebastian Trueg <trueg@k3b.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ * See the file "COPYING" for the exact licensing terms.
+ */
+
+#include "k3bthemedlabel.h"
+#include "k3bapplication.h"
+
+K3bThemedLabel::K3bThemedLabel( QWidget* parent )
+ : KCutLabel( parent ),
+ m_themePixmapCode( -1 )
+{
+ slotThemeChanged();
+
+ connect( k3bappcore->themeManager(), SIGNAL(themeChanged()),
+ this, SLOT(slotThemeChanged()) );
+ connect( kapp, SIGNAL(appearanceChanged()),
+ this, SLOT(slotThemeChanged()) );
+}
+
+
+K3bThemedLabel::K3bThemedLabel( const QString& text, QWidget* parent )
+ : KCutLabel( text, parent ),
+ m_themePixmapCode( -1 )
+{
+ slotThemeChanged();
+
+ connect( k3bappcore->themeManager(), SIGNAL(themeChanged()),
+ this, SLOT(slotThemeChanged()) );
+ connect( kapp, SIGNAL(appearanceChanged()),
+ this, SLOT(slotThemeChanged()) );
+}
+
+
+K3bThemedLabel::K3bThemedLabel( K3bTheme::PixmapType pix, QWidget* parent )
+ : KCutLabel( parent )
+{
+ setThemePixmap( pix );
+
+ connect( k3bappcore->themeManager(), SIGNAL(themeChanged()),
+ this, SLOT(slotThemeChanged()) );
+ connect( kapp, SIGNAL(appearanceChanged()),
+ this, SLOT(slotThemeChanged()) );
+}
+
+
+void K3bThemedLabel::setThemePixmap( K3bTheme::PixmapType pix )
+{
+ m_themePixmapCode = pix;
+ slotThemeChanged();
+}
+
+
+void K3bThemedLabel::slotThemeChanged()
+{
+ if( K3bTheme* theme = k3bappcore->themeManager()->currentTheme() ) {
+ setPaletteBackgroundColor( theme->backgroundColor() );
+ setPaletteForegroundColor( theme->foregroundColor() );
+ if( m_themePixmapCode > -1 ) {
+ setPixmap( theme->pixmap( (K3bTheme::PixmapType)m_themePixmapCode ) );
+ setScaledContents( false );
+ }
+ }
+}
+
+#include "k3bthemedlabel.moc"