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.
11 #include <QResizeEvent>
12 #include "infodisplay.h"
13 #include "kgamecanvas.h"
15 class MessageItem
: public KGameCanvasText
{
17 MessageItem(const QString
& text
, const QFont
& font
, KGameCanvasAbstract
* canvas
)
18 : KGameCanvasText(text
, Qt::black
, font
,
19 KGameCanvasText::HStart
, KGameCanvasText::VCenter
,
23 InfoDisplay::InfoDisplay(KGameCanvasAbstract
* parent
)
24 : KGameCanvasGroup(parent
) {
25 m_message
= new MessageItem("", QFont(), this);
26 m_message
->moveTo(QPoint(0, 0));
30 InfoDisplay::~InfoDisplay() {
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() {