[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-kimageshop
Subject: KisListBox improvements
From: Sven Langkamp <longamp () reallygood ! de>
Date: 2004-02-01 14:56:31
Message-ID: 200402011556.31309.longamp () reallygood ! de
[Download RAW message or body]
Hi,
I made some improvements in KisListBox.
Patch changes:
-uses system color for highlighting
-fixed icons
-fixed updating of upper/lower button
Sven
["listboxpatch.diff" (text/x-diff)]
Index: krita/ui/kis_listbox.cc
===================================================================
RCS file: /home/kde/koffice/krita/ui/kis_listbox.cc,v
retrieving revision 1.19
diff -u -r1.19 kis_listbox.cc
--- krita/ui/kis_listbox.cc 12 May 2003 21:32:45 -0000 1.19
+++ krita/ui/kis_listbox.cc 1 Feb 2004 14:29:40 -0000
@@ -174,6 +174,8 @@
}
m_btnRm -> setEnabled(m_lst -> count());
+ m_btnRaise -> setEnabled(m_lst -> selectedItem() && m_lst -> selectedItem() != \
m_lst -> item(0)); + m_btnLower -> setEnabled(m_lst -> selectedItem() && m_lst -> \
currentItem() != -1 && static_cast<uint>(m_lst -> currentItem()) != m_lst -> count() \
- 1); m_lst -> triggerUpdate(false);
}
@@ -319,12 +321,12 @@
KIconLoader il;
m_label = label;
- m_visiblePix = loadPixmap("visible.png", il);
+ m_visiblePix = loadPixmap("visible.png", il, 21);
m_visibleRect = QRect(QPoint(3, (HEIGHT - 24) / 2), QSize(24,24));
- m_invisiblePix = loadPixmap("novisible.png", il);
- m_linkedPix = loadPixmap("linked.png", il);
+ m_invisiblePix = loadPixmap("novisible.png", il, 21);
+ m_linkedPix = loadPixmap("linked.png", il, 21);
m_linkedRect = QRect(QPoint(30, (HEIGHT - 24) / 2), QSize(24,24));
- m_unlinkedPix = loadPixmap("unlinked.png", il);
+ m_unlinkedPix = loadPixmap("unlinked.png", il, 21);
m_previewRect = QRect(QPoint(57, (HEIGHT - 24) / 2), QSize(24,24));
m_parent = parent;
m_visible = true;
@@ -362,7 +364,7 @@
void KisListBoxItem::paint(QPainter *gc)
{
- QBrush br = isSelected() ? QBrush::gray : QBrush::lightGray;
+ QBrush br = isSelected() ? m_parent -> colorGroup().highlight() : QBrush::white;
QPoint pt;
QPixmap *pix;
@@ -383,9 +385,9 @@
gc -> drawText(HEIGHT * 3 + 3 * 3, 20, m_label);
}
-QPixmap KisListBoxItem::loadPixmap(const QString& filename, const KIconLoader& il)
+QPixmap KisListBoxItem::loadPixmap(const QString& filename, const KIconLoader& il, \
int size) {
- QPixmap pixmap = il.loadIcon(filename, KIcon::NoGroup);
+ QPixmap pixmap = il.loadIcon(filename, KIcon::NoGroup, size);
if (pixmap.isNull())
KMessageBox::error(0, i18n("Can't find %1").arg(filename), i18n("Canvas"));
Index: krita/ui/kis_listbox.h
===================================================================
RCS file: /home/kde/koffice/krita/ui/kis_listbox.h,v
retrieving revision 1.12
diff -u -r1.12 kis_listbox.h
--- krita/ui/kis_listbox.h 7 Mar 2003 22:05:52 -0000 1.12
+++ krita/ui/kis_listbox.h 1 Feb 2004 14:29:40 -0000
@@ -115,7 +115,7 @@
private:
void init(const QString& label, QListBox *parent, KisListBox::flags f);
- QPixmap loadPixmap(const QString& filename, const KIconLoader& il);
+ QPixmap loadPixmap(const QString& filename, const KIconLoader& il, int size);
bool intersectRect(const QRect& rc, const QPoint& pos, int yOffset) const;
private:
_______________________________________________
kimageshop mailing list
kimageshop@kde.org
https://mail.kde.org/mailman/listinfo/kimageshop
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic