summaryrefslogtreecommitdiffstats
path: root/kicker/libkicker/panelbutton.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-12-11 20:21:27 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-12-11 20:21:27 +0000
commit10e41144596fc9ced40fc349d9ecd099b1c2ea19 (patch)
tree88ab04e475ff5a4cd889cb082f5760b6e0bf5e4e /kicker/libkicker/panelbutton.cpp
parent4aed2c8219774f5d797760606b8489a92ddc5163 (diff)
downloadtdebase-10e41144596fc9ced40fc349d9ecd099b1c2ea19.tar.gz
tdebase-10e41144596fc9ced40fc349d9ecd099b1c2ea19.zip
Initial import of Trinity 3.5.11 to kdebase
Extends krandrtray, adds iccconfig kcontrol module, adds run dialog autocomplete and lots of bugfixes Will need to check for commit warnings and repair as encountered Also needs full compile test git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdebase@1061475 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kicker/libkicker/panelbutton.cpp')
-rw-r--r--kicker/libkicker/panelbutton.cpp14
1 files changed, 10 insertions, 4 deletions
diff --git a/kicker/libkicker/panelbutton.cpp b/kicker/libkicker/panelbutton.cpp
index f53d4b38f..407a78ca6 100644
--- a/kicker/libkicker/panelbutton.cpp
+++ b/kicker/libkicker/panelbutton.cpp
@@ -29,6 +29,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include <qstyle.h>
#include <qstylesheet.h>
#include <qtooltip.h>
+#include <qpixmap.h>
#include <kapplication.h>
#include <kconfig.h>
@@ -39,6 +40,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include <kglobalsettings.h>
#include <kiconloader.h>
#include <kicontheme.h>
+#include <kiconeffect.h>
#include <kipc.h>
#include <kstandarddirs.h>
#include <klocale.h>
@@ -289,10 +291,11 @@ int PanelButton::widthForHeight(int height) const
if (orientation() == Horizontal && !m_buttonText.isEmpty())
{
QFont f(font());
- f.setPixelSize(KMIN(height, KMAX(int(float(height) * m_fontPercent), 16)));
+ //f.setPixelSize(KMIN(height, KMAX(int(float(height) * m_fontPercent), 16)));
QFontMetrics fm(f);
- rc += fm.width(m_buttonText) + KMIN(25, KMAX(5, fm.width('m') / 2));
+ //rc += fm.width(m_buttonText) + KMIN(25, KMAX(5, fm.width('m') / 2));
+ rc += fm.width(m_buttonText);
}
return rc;
@@ -348,7 +351,7 @@ bool PanelButton::hasText() const
void PanelButton::setButtonText(const QString& text)
{
- m_buttonText = text;
+ m_buttonText = " " + text;
update();
}
@@ -489,6 +492,9 @@ void PanelButton::mouseReleaseEvent(QMouseEvent *e)
if (e->button() == LeftButton)
{
m_isLeftMouseButtonDown = false;
+
+ QPixmap pix = labelIcon();
+ KIconEffect::visualActivate(this, this->geometry(), &pix);
}
QButton::mouseReleaseEvent(e);
}
@@ -569,7 +575,7 @@ void PanelButton::drawButtonLabel(QPainter *p)
{
fontPercent *= .8;
}
- f.setPixelSize(KMIN(h, KMAX(int(float(h) * m_fontPercent), 16)));
+ //f.setPixelSize(KMIN(h, KMAX(int(float(h) * m_fontPercent), 16)));
QFontMetrics fm(f);
p->setFont(f);