summaryrefslogtreecommitdiffstats
path: root/src/themedesigner/themedicongroupitem.cpp
diff options
context:
space:
mode:
authorMichele Calgaro <michele.calgaro@yahoo.it>2024-11-22 18:41:30 +0900
committerMichele Calgaro <michele.calgaro@yahoo.it>2024-11-22 20:55:03 +0900
commit5bed6e4a4c916a97f8fe4d1b07f7eecf4d733b90 (patch)
treef89cc49efc9ca1d0e1579ecb079ee7e7088ff8c8 /src/themedesigner/themedicongroupitem.cpp
parent0bfbf616d9c1fd7abb1bd02732389ab35e5f8771 (diff)
downloaddigikam-5bed6e4a4c916a97f8fe4d1b07f7eecf4d733b90.tar.gz
digikam-5bed6e4a4c916a97f8fe4d1b07f7eecf4d733b90.zip
Rename 'digikam' folder to 'src'
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it> (cherry picked from commit ee0d99607c14cb63d3ebdb3a970b508949fa8219)
Diffstat (limited to 'src/themedesigner/themedicongroupitem.cpp')
-rw-r--r--src/themedesigner/themedicongroupitem.cpp105
1 files changed, 105 insertions, 0 deletions
diff --git a/src/themedesigner/themedicongroupitem.cpp b/src/themedesigner/themedicongroupitem.cpp
new file mode 100644
index 00000000..1da37fd3
--- /dev/null
+++ b/src/themedesigner/themedicongroupitem.cpp
@@ -0,0 +1,105 @@
+/* ============================================================
+ *
+ * This file is a part of digiKam project
+ * http://www.digikam.org
+ *
+ * Date : 2005-07-15
+ * Description : themed icon group item
+ *
+ * Copyright (C) 2005 by Renchi Raju <renchi at pooh.tam.uiuc.edu>
+ *
+ * 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, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * ============================================================ */
+
+// TQt includes.
+
+#include <tqpixmap.h>
+#include <tqpainter.h>
+
+// KDE includes.
+
+#include <tdelocale.h>
+
+// Local includes.
+
+#include "themeengine.h"
+#include "themediconview.h"
+#include "themedicongroupitem.h"
+
+namespace Digikam
+{
+
+ThemedIconGroupItem::ThemedIconGroupItem(ThemedIconView* view)
+ : IconGroupItem(view), m_view(view)
+{
+}
+
+ThemedIconGroupItem::~ThemedIconGroupItem()
+{
+}
+
+void ThemedIconGroupItem::paintBanner()
+{
+ TQRect r(0, 0, rect().width(), rect().height());
+
+ TQPixmap pix(m_view->bannerPixmap());
+
+ TQFont fn(m_view->font());
+ fn.setBold(true);
+ int fnSize = fn.pointSize();
+ bool usePointSize;
+ if (fnSize > 0)
+ {
+ fn.setPointSize(fnSize+2);
+ usePointSize = true;
+ }
+ else
+ {
+ fnSize = fn.pixelSize();
+ fn.setPixelSize(fnSize+2);
+ usePointSize = false;
+ }
+
+ TQPainter p(&pix);
+ p.setPen(ThemeEngine::instance()->textSelColor());
+ p.setFont(fn);
+
+ TQRect tr;
+ p.drawText(5, 5, r.width(), r.height(),
+ TQt::AlignLeft | TQt::AlignTop, i18n("Album Banner"),
+ -1, &tr);
+
+ r.setY(tr.height() + 2);
+
+ if (usePointSize)
+ fn.setPointSize(m_view->font().pointSize());
+ else
+ fn.setPixelSize(m_view->font().pixelSize());
+
+ fn.setBold(false);
+ p.setFont(fn);
+
+ p.drawText(5, r.y(), r.width(), r.height(),
+ TQt::AlignLeft | TQt::AlignVCenter, i18n("July 2007 - 10 Items"));
+
+ p.end();
+
+ r = rect();
+ r = TQRect(iconView()->contentsToViewport(TQPoint(r.x(), r.y())),
+ TQSize(r.width(), r.height()));
+
+ bitBlt(iconView()->viewport(), r.x(), r.y(), &pix,
+ 0, 0, r.width(), r.height());
+}
+
+} // NameSpace Digikam