Added gitignore
[tagua/yd.git] / src / infodisplay.cpp
blobc7ca83efbd39825b1b1aa9674d34cdd46ed2df7e
1 /*
2 Copyright (c) 2006 Paolo Capriotti <p.capriotti@sns.it>
3 (c) 2006 Maurizio Monge <maurizio.monge@kdemail.net>
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version.
9 */
11 #include <QResizeEvent>
12 #include "infodisplay.h"
13 #include "canvas/text.h"
15 class MessageItem : public Canvas::Text {
16 public:
17 MessageItem(const QString& text, const QFont& font, Canvas::Abstract* canvas)
18 : Canvas::Text(text, Qt::black, font,
19 Canvas::Text::HStart, Canvas::Text::VCenter,
20 canvas) { }
23 InfoDisplay::InfoDisplay(Canvas::Abstract* parent)
24 : Canvas::Group(parent) {
25 m_message = new MessageItem("", QFont(), this);
26 m_message->moveTo(QPoint(0, 0));
27 m_message->show();
30 InfoDisplay::~InfoDisplay() {
31 delete m_message;
34 void InfoDisplay::resizeEvent(QResizeEvent* e) {
35 // m_message->setSize(e->size());
38 void InfoDisplay::setMessage(const QString& msg) {
39 m_message->setText(msg);
42 void InfoDisplay::settingsChanged() {