1 | // Aseprite |
---|---|
2 | // Copyright (C) 2016 David Capello |
3 | // |
4 | // This program is distributed under the terms of |
5 | // the End-User License Agreement for Aseprite. |
6 | |
7 | #ifdef HAVE_CONFIG_H |
8 | #include "config.h" |
9 | #endif |
10 | |
11 | #include "app/ui/file_list_view.h" |
12 | |
13 | #include "app/ui/file_list.h" |
14 | #include "ui/scroll_region_event.h" |
15 | |
16 | namespace app { |
17 | |
18 | void FileListView::onScrollRegion(ui::ScrollRegionEvent& ev) |
19 | { |
20 | if (auto fileList = dynamic_cast<FileList*>(attachedWidget())) { |
21 | gfx::Rect tbounds = fileList->mainThumbnailBounds(); |
22 | if (!tbounds.isEmpty()) { |
23 | tbounds |
24 | .enlarge(1) |
25 | .offset(fileList->bounds().origin()); |
26 | |
27 | ev.region().createSubtraction(ev.region(), gfx::Region(tbounds)); |
28 | } |
29 | } |
30 | } |
31 | |
32 | } // namespace app |
33 |