aboutsummaryrefslogtreecommitdiff
path: root/gui
diff options
context:
space:
mode:
authorTorbjörn Andersson2005-06-03 11:15:03 +0000
committerTorbjörn Andersson2005-06-03 11:15:03 +0000
commit36e8989a6e452324e2f57cddee3ea0e6db0264c3 (patch)
tree650e2c5ed88229f351c4a53f41d46cc0f065a289 /gui
parentb3197a803bfb72d57250a51304070cc2c239195c (diff)
downloadscummvm-rg350-36e8989a6e452324e2f57cddee3ea0e6db0264c3.tar.gz
scummvm-rg350-36e8989a6e452324e2f57cddee3ea0e6db0264c3.tar.bz2
scummvm-rg350-36e8989a6e452324e2f57cddee3ea0e6db0264c3.zip
Cleanup
svn-id: r18318
Diffstat (limited to 'gui')
-rw-r--r--gui/widget.cpp22
-rw-r--r--gui/widget.h1
2 files changed, 5 insertions, 18 deletions
diff --git a/gui/widget.cpp b/gui/widget.cpp
index f91c2154bb..1507cb6573 100644
--- a/gui/widget.cpp
+++ b/gui/widget.cpp
@@ -112,18 +112,6 @@ StaticTextWidget::StaticTextWidget(GuiObject *boss, int x, int y, int w, int h,
_flags = WIDGET_ENABLED;
_type = kStaticTextWidget;
_label = text;
-
- switch (_ws) {
- case kNormalWidgetSize:
- _font = FontMan.getFontByUsage(Graphics::FontManager::kGUIFont);
- break;
- case kBigWidgetSize:
- _font = FontMan.getFontByUsage(Graphics::FontManager::kBigGUIFont);
- break;
- case kDefaultWidgetSize:
- _font = &g_gui.getFont();
- break;
- }
}
void StaticTextWidget::setValue(int value) {
@@ -150,7 +138,7 @@ void StaticTextWidget::setAlign(TextAlignment align) {
void StaticTextWidget::drawWidget(bool hilite) {
NewGui *gui = &g_gui;
- gui->drawString(_font, _label, _x, _y, _w, isEnabled() ? gui->_textcolor : gui->_color, _align);
+ gui->drawString(_label, _x, _y, _w, isEnabled() ? gui->_textcolor : gui->_color, _align);
}
#pragma mark -
@@ -169,8 +157,8 @@ void ButtonWidget::handleMouseUp(int x, int y, int button, int clickCount) {
void ButtonWidget::drawWidget(bool hilite) {
NewGui *gui = &g_gui;
- const int off = (_h - _font->getFontHeight()) / 2;
- gui->drawString(_font, _label, _x, _y + off, _w,
+ const int off = (_h - g_gui.getFontHeight()) / 2;
+ gui->drawString(_label, _x, _y + off, _w,
!isEnabled() ? gui->_color :
hilite ? gui->_textcolorhi : gui->_textcolor, _align);
}
@@ -200,7 +188,7 @@ void CheckboxWidget::setState(bool state) {
void CheckboxWidget::drawWidget(bool hilite) {
NewGui *gui = &g_gui;
- int fontHeight = _font->getFontHeight();
+ int fontHeight = gui->getFontHeight();
// Draw the box
gui->box(_x, _y, fontHeight + 4, fontHeight + 4, gui->_color, gui->_shadowcolor);
@@ -231,7 +219,7 @@ void CheckboxWidget::drawWidget(bool hilite) {
}
// Finally draw the label
- gui->drawString(_font, _label, _x + fontHeight + 10, _y + 3, _w, isEnabled() ? gui->_textcolor : gui->_color);
+ gui->drawString(_label, _x + fontHeight + 10, _y + 3, _w, isEnabled() ? gui->_textcolor : gui->_color);
}
#pragma mark -
diff --git a/gui/widget.h b/gui/widget.h
index c1c9459a21..7c573ad838 100644
--- a/gui/widget.h
+++ b/gui/widget.h
@@ -154,7 +154,6 @@ protected:
String _label;
TextAlignment _align;
const WidgetSize _ws;
- const Graphics::Font *_font;
public:
StaticTextWidget(GuiObject *boss, int x, int y, int w, int h, const String &text, TextAlignment align, WidgetSize ws = kDefaultWidgetSize);
void setValue(int value);