summaryrefslogtreecommitdiff
path: root/src/gui/widgets
diff options
context:
space:
mode:
authorBlue <bluesansdouze@gmail.com>2009-05-13 20:35:44 +0200
committerBlue <bluesansdouze@gmail.com>2009-05-13 20:35:44 +0200
commit22685431a23b05d66af28abda488d0891b1c0a34 (patch)
treea207b9230833abbed3da751ca7e3c4ccdc8e9783 /src/gui/widgets
parent9071a692116745f2cafd8556cbff28095910730e (diff)
parentb5ad7e490f0f429a5abac2acae48ecf25485256f (diff)
downloadmana-22685431a23b05d66af28abda488d0891b1c0a34.tar.gz
mana-22685431a23b05d66af28abda488d0891b1c0a34.tar.bz2
mana-22685431a23b05d66af28abda488d0891b1c0a34.tar.xz
mana-22685431a23b05d66af28abda488d0891b1c0a34.zip
Merge branch 'master' of git@gitorious.org:tmw/mainline
Diffstat (limited to 'src/gui/widgets')
-rw-r--r--src/gui/widgets/avatar.cpp5
-rw-r--r--src/gui/widgets/browserbox.cpp12
-rw-r--r--src/gui/widgets/chattab.cpp7
3 files changed, 9 insertions, 15 deletions
diff --git a/src/gui/widgets/avatar.cpp b/src/gui/widgets/avatar.cpp
index b120c51f..0bbdc468 100644
--- a/src/gui/widgets/avatar.cpp
+++ b/src/gui/widgets/avatar.cpp
@@ -42,7 +42,7 @@ Avatar::Avatar():
mMaxHp(0)
{
setOpaque(false);
- setSize(200, 12);
+ setSize(250, 12);
if (avatarCount == 0)
{
@@ -58,7 +58,7 @@ Avatar::Avatar():
mStatus->setSize(12, 12);
add(mStatus, 1, 0);
mLabel = new Label;
- mLabel->setSize(174, 12);
+ mLabel->adjustSize();
add(mLabel, 16, 0);
}
@@ -108,4 +108,5 @@ void Avatar::updateAvatarLabel()
ss << " (" << mHp << "/" << mMaxHp << ")";
mLabel->setCaption(ss.str());
+ mLabel->adjustSize();
}
diff --git a/src/gui/widgets/browserbox.cpp b/src/gui/widgets/browserbox.cpp
index 52b9bfa6..a03d53eb 100644
--- a/src/gui/widgets/browserbox.cpp
+++ b/src/gui/widgets/browserbox.cpp
@@ -23,9 +23,9 @@
#include "gui/linkhandler.h"
#include "gui/palette.h"
-#include "gui/truetypefont.h"
#include <guichan/graphics.hpp>
+#include <guichan/font.hpp>
#include <algorithm>
@@ -71,7 +71,7 @@ void BrowserBox::addRow(const std::string &row)
std::string newRow;
BROWSER_LINK bLink;
std::string::size_type idx1, idx2, idx3;
- TrueTypeFont *font = static_cast<TrueTypeFont*>(getFont());
+ gcn::Font *font = getFont();
// Use links and user defined colors
if (mUseLinksAndUserColors)
@@ -116,7 +116,6 @@ void BrowserBox::addRow(const std::string &row)
newRow += tmp;
}
-
// Don't use links and user defined colors
else
{
@@ -281,7 +280,7 @@ void BrowserBox::draw(gcn::Graphics *graphics)
int x = 0, y = 0;
int wrappedLines = 0;
int link = 0;
- TrueTypeFont *font = static_cast<TrueTypeFont*>(getFont());
+ gcn::Font *font = getFont();
graphics->setColor(guiPalette->getColor(Palette::TEXT));
for (TextRowIterator i = mTextRows.begin(); i != mTextRows.end(); i++)
@@ -296,10 +295,11 @@ void BrowserBox::draw(gcn::Graphics *graphics)
// Check for separator lines
if (row.find("---", 0) == 0)
{
+ const int dashWidth = font->getWidth("-");
for (x = 0; x < getWidth(); x++)
{
font->drawString(graphics, "-", x, y);
- x += font->getWidth("-") - 2;
+ x += dashWidth - 2;
}
y += font->getHeight();
continue;
@@ -389,7 +389,7 @@ void BrowserBox::draw(gcn::Graphics *graphics)
{
bool forced = false;
char const *hyphen = "~";
- int hyphenWidth = font->getWidth(hyphen);
+ int hyphenWidth = font->getWidth(hyphen);
/* FIXME: This code layout makes it easy to crash remote
clients by talking garbage. Forged long utf-8 characters
diff --git a/src/gui/widgets/chattab.cpp b/src/gui/widgets/chattab.cpp
index d55e5da8..711680d1 100644
--- a/src/gui/widgets/chattab.cpp
+++ b/src/gui/widgets/chattab.cpp
@@ -162,13 +162,6 @@ void ChatTab::chatLog(std::string line, int own, bool ignoreRecord)
lineColor = "##S";
}
-#ifdef EATHENA_SUPPORT
- if (tmp.nick.empty() && tmp.text.substr(0, 17) == "Visible GM status")
- {
- player_node->setGM();
- }
-#endif
-
// Get the current system time
time_t t;
time(&t);