modified conctencts of functional test document
[situare] / src / ui / zoombuttonpanel.cpp
1 /*
2    Situare - A location system for Facebook
3    Copyright (C) 2010  Ixonos Plc. Authors:
4
5        Pekka Nissinen - pekka.nissinen@ixonos.com
6
7    Situare is free software; you can redistribute it and/or
8    modify it under the terms of the GNU General Public License
9    version 2 as published by the Free Software Foundation.
10
11    Situare is distributed in the hope that it will be useful,
12    but WITHOUT ANY WARRANTY; without even the implied warranty of
13    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14    GNU General Public License for more details.
15
16    You should have received a copy of the GNU General Public License
17    along with Situare; if not, write to the Free Software
18    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301,
19    USA.
20 */
21
22 #include <QDebug>
23 #include <QPainter>
24
25 #include "zoombuttonpanel.h"
26 #include "panelcommon.h"
27
28 ZoomButtonPanel::ZoomButtonPanel(QWidget *parent, int x, int y)
29     : QWidget(parent),
30       m_panelLayout(this),
31       m_x(x),
32       m_y(y)
33 {
34     qDebug() << __PRETTY_FUNCTION__;
35
36     m_zoomInButton = new ImageButton(this, ":/res/images/zoom_in.png");
37     m_zoomOutButton = new ImageButton(this, ":/res/images/zoom_out.png");
38
39     m_panelLayout.setMargin(0);
40     m_panelLayout.setSpacing(0);
41     m_panelLayout.setVerticalSpacing(ZOOM_BUTTON_PANEL_BUTTON_SPACING);
42     m_panelLayout.setSizeConstraint(QLayout::SetFixedSize);
43
44     m_panelLayout.addWidget(m_zoomInButton, 0, 0);
45     m_panelLayout.addWidget(m_zoomOutButton, 1, 0);
46
47     move(m_x, m_y);
48 }
49
50 void ZoomButtonPanel::disableZoomInButton()
51 {
52     qDebug() << __PRETTY_FUNCTION__;
53
54     m_zoomInButton->setMode(QIcon::Disabled);
55 }
56
57 void ZoomButtonPanel::disableZoomOutButton()
58 {
59     qDebug() << __PRETTY_FUNCTION__;
60
61     m_zoomOutButton->setMode(QIcon::Disabled);
62 }
63
64 void ZoomButtonPanel::resetButtons()
65 {
66     qDebug() << __PRETTY_FUNCTION__;
67
68     m_zoomInButton->setMode(QIcon::Normal);
69     m_zoomOutButton->setMode(QIcon::Normal);
70 }