aseprite/src/ui/scroll_region_event.h
David Capello b0650f6afe Generalize View::setViewScroll() to blit valid/scrollable region automatically
With this change we are removing specific code to scroll the Editor widget.
Now if we use Editor::setEditorScroll() to scroll it should work as
View::setViewScroll(). In this way we remove the ugly "blitValidRegion"
parameter from setEditorScroll().

Changes:
* Removed Widget::scrollRegion() because each widget must control
  valid/invalid regions after a ui::move_region() in a very specific way
  (see View::setViewScroll() or Window::moveWindow)
* Invalidate the whole widget on Widget::setBoundsQuietly()
* Fixed problems blitting invalid regions/not yet updated/painted: using
  the new ui::Manager::m_invalidRegion.
* Added View::onSetViewScroll() and View::onScrollRegion()
* Added FileListView to avoid moving the thumbnail region when we scroll
2016-01-05 16:37:52 -03:00

31 lines
610 B
C++

// Aseprite UI Library
// Copyright (C) 2015 David Capello
//
// This file is released under the terms of the MIT license.
// Read LICENSE.txt for more information.
#ifndef UI_SCROLL_REGION_EVENT_H_INCLUDED
#define UI_SCROLL_REGION_EVENT_H_INCLUDED
#pragma once
#include "gfx/region.h"
#include "ui/event.h"
namespace ui {
class ScrollRegionEvent : public Event {
public:
ScrollRegionEvent(Component* source, gfx::Region& region)
: Event(source), m_region(region) {
}
gfx::Region& region() { return m_region; }
private:
gfx::Region& m_region;
};
} // namespace ui
#endif