From 746ec155a588976a4bdfb44fe0c1e65ea32dd338 Mon Sep 17 00:00:00 2001 From: Tobias Doerffel Date: Mon, 12 Dec 2005 14:29:43 +0000 Subject: [PATCH] GUI-improvements git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@32 0778d3d1-df1d-0410-868b-ea421aaaa00d --- resources/step_btn_add.png | Bin 0 -> 725 bytes resources/step_btn_remove.png | Bin 0 -> 544 bytes src/widgets/tool_button.cpp | 74 ++++++++++++++++++++++++++++++++++ 3 files changed, 74 insertions(+) create mode 100644 resources/step_btn_add.png create mode 100644 resources/step_btn_remove.png create mode 100644 src/widgets/tool_button.cpp diff --git a/resources/step_btn_add.png b/resources/step_btn_add.png new file mode 100644 index 0000000000000000000000000000000000000000..a83192dfdeed09c799840e0ce104d5db3a4f91be GIT binary patch literal 725 zcmV;`0xJE9P)_C zX>@2HRA^-&M@dak?_?!z0006^NklNPX6`d* z-gE95p-pidE9Yo-c2?+9VLPx`EMBxv`#nJ7IM$h&nVvS!&(HS^4*{&TT(-J^1wj)Z zkpBmZB(7?cm*D>)VrMNXl8{7CqeT@FX=SfpaKqUqD7mnh$X1epoGJtK^L%dwp9iv$x>xA_z8IM3HLC)$52>JS&ncxd~lq} zKIfhacu9itP_H~=QQ|n(LSgbu?JBUVTZ9iCg^@hQc#QFgcq*=h)jD1sp+p!`G`y#7 zJvHn3vbWBg*Y9qgTG6QnmXRnzOuY$qh;djwKyj!##H2Aqi1lDRY8+w8qY%hR6B-{M zZ%dW1W40(yzv61f5JeD#iB*~5Jn85fULB?5ZK{=B6lgS*Y8Cd6981g9TXIp$tWe=c zeuW@VOaRB(ojE|J9^|GAxv>GKj}RvAxEVZVI4tJ$$reHYal7 zs33g%Zdc}}-PAchriNX>oget2$dewb0}w^Y+=b=VkFo<dx+^fpy`-r{&eJ6ae;rvC?aDdQl26&9MW{eI@_C zX>@2HRA^-&M@dak?_?!z0004(Nkl6F+);Uy-mT(;2Tgnuw|~%78wU0Zf7Vt-!5aVpIO;YQ?ITFtMaq}nbNm` z)YEYYzH0+%?YfD6SvQWCYrT6DM}4En<-F(d`6XqzW={jLC8IKnkIT_m%{?E-!yS-Fp*U zN$sJi8`tW>&*81(z>vAmGQO@abACPeaOBGZ$^r_P+_qrR#StTfCX(6{PvFPjM%Dm$ i(&Hva;Iw)FSJEFZx5*`4dj~fF0000 + * + * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net + * + * 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. + * + * 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. + * + * You should have received a copy of the GNU General Public + * License along with this program (see COPYING); if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + * + */ + + +#include "tool_button.h" +#include "tooltip.h" + + + +const QColor toolButton::s_stdColor = QColor( 216, 216, 216 ); +const QColor toolButton::s_hlColor = QColor( 240, 240, 240 ); + + + +toolButton::toolButton( const QPixmap & _pixmap, const QString & _tooltip, + QObject * _receiver, const char * _slot, + QWidget * _parent ) : + QToolButton( _parent ), + m_colorStandard( s_stdColor ), + m_colorHighlighted( s_hlColor ) +{ + if( _receiver != NULL && _slot != NULL ) + { + connect( this, SIGNAL( clicked() ), _receiver, _slot ); + } + toolTip::add( this, _tooltip ); + setFixedSize( 30, 30 ); + setPixmap( _pixmap ); + leaveEvent( NULL ); +} + + + + +toolButton::~toolButton() +{ +} + + + +void toolButton::enterEvent( QEvent * ) +{ + setPaletteBackgroundColor( m_colorHighlighted ); +} + + + + +void toolButton::leaveEvent( QEvent * ) +{ + setPaletteBackgroundColor( m_colorStandard ); +} +