1
/****************************************************************************
2
* Copyright (C) 2012-2013 by Savoir-Faire Linux *
3
* Author : Emmanuel Lepage Vallee <emmanuel.lepage@savoirfairelinux.com> *
5
* This library is free software; you can redistribute it and/or *
6
* modify it under the terms of the GNU Lesser General Public *
7
* License as published by the Free Software Foundation; either *
8
* version 2.1 of the License, or (at your option) any later version. *
10
* This library is distributed in the hope that it will be useful, *
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
13
* Lesser General Public License for more details. *
15
* You should have received a copy of the GNU General Public License *
16
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
17
***************************************************************************/
18
#include "dialpadtip.h"
21
#include <QtSvg/QSvgRenderer>
22
#include <QtGui/QPainter>
23
#include <QtGui/QFontMetrics>
24
#include <QtCore/QFile>
29
#include <KStandardDirs>
32
DialPadTip::DialPadTip(QWidget* parent) : Tip(i18n("Use the dialpad below or start typing a number. Press enter or double click on the call to launch the call. Press escape or \"Hang Up\" to end the call."),parent)
35
loadSvg(KStandardDirs::locate("data", "sflphone-client-kde/tips/keyboard.svg"));
39
DialPadTip::~DialPadTip()
43
QRect DialPadTip::getDecorationRect()
45
return QRect(0,0,m_CurrentSize.width()-2*m_Padding,60);
48
void DialPadTip::paintDecorations(QPainter& p, const QRect& textRect)
51
m_pR = new QSvgRenderer(m_OriginalFile);
52
m_pR->render(&p,QRect(m_CurrentRect.width() - m_Padding - 50*2.59143327842 - 10 ,textRect.y()+textRect.height() + 10,50*2.59143327842,50));