diff options
author | Mavridis Philippe <[email protected]> | 2021-01-13 19:26:24 +0200 |
---|---|---|
committer | Mavridis Philippe <[email protected]> | 2021-01-13 19:26:24 +0200 |
commit | 8c20dc919f7d54eb48fb60f39ba5e1d466a70763 (patch) | |
tree | 44d89f278d5dd066603e5ab9c0b270bc8eb4ad51 /src/clicklineedit.cpp | |
download | klamav-8c20dc919f7d54eb48fb60f39ba5e1d466a70763.tar.gz klamav-8c20dc919f7d54eb48fb60f39ba5e1d466a70763.zip |
Initial commit
Signed-off-by: Mavridis Philippe <[email protected]>
Diffstat (limited to 'src/clicklineedit.cpp')
-rw-r--r-- | src/clicklineedit.cpp | 99 |
1 files changed, 99 insertions, 0 deletions
diff --git a/src/clicklineedit.cpp b/src/clicklineedit.cpp new file mode 100644 index 0000000..a4ceb21 --- /dev/null +++ b/src/clicklineedit.cpp @@ -0,0 +1,99 @@ +/* + This file is part of libkdepim. + Copyright (c) 2004 Daniel Molkentin <[email protected]> + based on code by Cornelius Schumacher <[email protected]> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. +*/ + + +#include "clicklineedit.h" +#include "klamscan.h" +#include "klamav.h" + +#include "qpainter.h" + +ClickComboBox::ClickComboBox( bool rw,QWidget *parent, const char* name ) : + KComboBox( rw,parent, name ) +{ +/* mDrawClickMsg = true; + setClickMessage( msg );*/ +} + + +///////////////////////////////////////////////////////////////////////////////////// +// PUBLIC +///////////////////////////////////////////////////////////////////////////////////// + +// void ClickComboBox::setClickMessage( const QString &msg ) +// { +// mClickMessage = msg; +// repaint(); +// } + + +void ClickComboBox::mousePressEvent( QMouseEvent * e ) +{ + + QComboBox::mousePressEvent( e ); + repaint(); + +} + + +///////////////////////////////////////////////////////////////////////////////////// +// PROTECTED +///////////////////////////////////////////////////////////////////////////////////// + +void ClickComboBox::paintEvent( QPaintEvent * ev) +{ + + KComboBox::paintEvent(ev); + + if (kmain->klamscan->isMultiScan()){ + //kdDebug() << "drawing text" << endl; + QPainter p (this->lineEdit()); + p.setPen( palette().color( QPalette::Disabled, QColorGroup::Text ) ); + QRect cr = this->lineEdit()->contentsRect(); + // Add two pixel margin on the left side + //cr.setRight( cr.right() + 800 ); + cr.setWidth(800); + //kdDebug() << cr << endl; + p.drawText( cr, AlignAuto , i18n( "Multiple Directories Selected" ) ); + //this->setPaletteForegroundColor(palette().color( QPalette::Disabled, QColorGroup::Text )); + } +} + + +void ClickComboBox::focusInEvent( QFocusEvent *ev ) +{ +/* if ( mDrawClickMsg == true ) { + mDrawClickMsg = false; + repaint(); + }*/ + QComboBox::focusInEvent( ev ); +} + + +void ClickComboBox::focusOutEvent( QFocusEvent *ev ) +{ +/* if ( currentText().isEmpty() ) { + mDrawClickMsg = true; + repaint(); + }*/ + QComboBox::focusOutEvent( ev ); +} + |