projects
/
evehomescreen
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
78eff68
)
Indicate press event
v0.1.0
author
jasu
<jasu@skeletor.(none)>
Mon, 24 May 2010 18:58:46 +0000
(21:58 +0300)
committer
jasu
<jasu@skeletor.(none)>
Mon, 24 May 2010 18:58:46 +0000
(21:58 +0300)
src/widget.cpp
patch
|
blob
|
history
src/widget.h
patch
|
blob
|
history
diff --git
a/src/widget.cpp
b/src/widget.cpp
index
e3ac861
..
af5521b
100644
(file)
--- a/
src/widget.cpp
+++ b/
src/widget.cpp
@@
-23,7
+23,8
@@
Widget::Widget(QWidget *parent)
m_skills(new SkillTree(this)),
m_model(new EveModel),
m_timer(new QTimer(this)),
m_skills(new SkillTree(this)),
m_model(new EveModel),
m_timer(new QTimer(this)),
- m_updateTimer(new QTimer(this))
+ m_updateTimer(new QTimer(this)),
+ m_pressed(false)
{
setAlignment(Qt::AlignCenter);
setAttribute(Qt::WA_TranslucentBackground);
{
setAlignment(Qt::AlignCenter);
setAttribute(Qt::WA_TranslucentBackground);
@@
-58,6
+59,8
@@
void Widget::paintEvent(QPaintEvent *event)
{
QPainter p(this);
QColor bgColor(0, 0, 0, 128);
{
QPainter p(this);
QColor bgColor(0, 0, 0, 128);
+ if (m_pressed)
+ bgColor.setRgb(101,150,254,128);
p.setBrush(bgColor);
p.setPen(Qt::NoPen);
p.drawRoundedRect(rect(), 25, 25);
p.setBrush(bgColor);
p.setPen(Qt::NoPen);
p.drawRoundedRect(rect(), 25, 25);
@@
-197,6
+200,15
@@
void Widget::mousePressEvent(QMouseEvent *event)
{
Q_UNUSED(event);
qDebug() << "Press event";
{
Q_UNUSED(event);
qDebug() << "Press event";
+ m_pressed = true;
+ update();
+}
+
+void Widget::mouseReleaseEvent(QMouseEvent *event)
+{
+ Q_UNUSED(event);
+ qDebug() << "Release event";
+ m_pressed = false;
m_training->fetchInfo();
update();
}
m_training->fetchInfo();
update();
}
diff --git
a/src/widget.h
b/src/widget.h
index
a9a80df
..
5d81605
100644
(file)
--- a/
src/widget.h
+++ b/
src/widget.h
@@
-38,6
+38,7
@@
public slots:
void loadTraining();
void trainingLoaded();
virtual void mousePressEvent ( QMouseEvent * event );
void loadTraining();
void trainingLoaded();
virtual void mousePressEvent ( QMouseEvent * event );
+ virtual void mouseReleaseEvent ( QMouseEvent * event );
private:
EveSettingsDialog *m_settings;
EveSkillTraining *m_training;
private:
EveSettingsDialog *m_settings;
EveSkillTraining *m_training;
@@
-46,6
+47,7
@@
private:
QSharedPointer<EveModel> m_model;
QTimer *m_timer;
QTimer *m_updateTimer;
QSharedPointer<EveModel> m_model;
QTimer *m_timer;
QTimer *m_updateTimer;
+ bool m_pressed;
};
#endif // WIDGET_H
};
#endif // WIDGET_H