Moved global.* to mastersettings.*, and converted many error messages to use the...
[tagua/yd.git] / src / infodisplay.cpp
blobfa22b9a30a5f520123a32e96e136fff0a54b883a
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 "kgamecanvas.h"
15 class MessageItem : public KGameCanvasText {
16 public:
17 MessageItem(const QString& text, const QFont& font, KGameCanvasAbstract* canvas)
18 : KGameCanvasText(text, Qt::black, font,
19 KGameCanvasText::HStart, KGameCanvasText::VCenter,
20 canvas) { }
23 InfoDisplay::InfoDisplay(KGameCanvasAbstract* parent)
24 : KGameCanvasGroup(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() {