Move drawing code of EditorView from kPaintMessage to onPaint()

This commit is contained in:
David Capello 2014-04-13 15:08:24 -03:00
parent a0e403b6a6
commit b41841ddd2
2 changed files with 21 additions and 30 deletions

View File

@ -28,7 +28,7 @@
#include "app/ui/editor/editor.h"
#include "app/ui/skin/skin_theme.h"
#include "app/ui_context.h"
#include "ui/message.h"
#include "ui/paint_event.h"
#include "ui/resize_event.h"
#include <allegro.h>
@ -59,12 +59,9 @@ EditorView::~EditorView()
UIContext::instance()->settings()->removeObserver(this);
}
bool EditorView::onProcessMessage(Message* msg)
void EditorView::onPaint(PaintEvent& ev)
{
switch (msg->type()) {
case kPaintMessage:
{
Graphics* g = ev.getGraphics();
Widget* viewport = getViewport();
Widget* child = UI_FIRST_WIDGET(viewport->getChildren());
SkinTheme* theme = static_cast<SkinTheme*>(getTheme());
@ -84,16 +81,10 @@ bool EditorView::onProcessMessage(Message* msg)
}
theme->draw_bounds_nw(ji_screen, getBounds(),
theme->draw_bounds_nw(g, getClientBounds(),
selected ? PART_EDITOR_SELECTED_NW:
PART_EDITOR_NORMAL_NW,
ColorNone);
}
return true;
}
return View::onProcessMessage(msg);
}
void EditorView::onResize(ResizeEvent& ev)

View File

@ -34,7 +34,7 @@ namespace app {
~EditorView();
protected:
bool onProcessMessage(ui::Message* msg) OVERRIDE;
void onPaint(ui::PaintEvent& ev) OVERRIDE;
void onResize(ui::ResizeEvent& ev) OVERRIDE;
// GlobalSettingsObserver impl