// Related to ImageGrid //
const TString SLOT_PART_FMT {"swallow.cell_%d"};
+ // Related to Scroller //
+ constexpr ElmStyle SCROLLER_STYLE {"effect"};
+
// Related to Button //
constexpr ElmStyle ITEM_BTN_STYLE {"gallery_image"};
constexpr EdjePart PART_BTN_BG {"swallow.bg"};
constexpr SmartEvent BTN_CLICKED {"clicked"};
+
+ // Other //
+ constexpr auto HCOMB_SCROLL_LIMIT = 1000;
}}}
namespace gallery {
const std::array<LayoutTheme, 2> slotThemes;
const std::array<int, 2> slotLens;
const int scrollLimit;
+ const int slotsPerPage;
const bool isHorizontal;
virtual int calcItemIndexFromCell(
Info(const std::array<LayoutTheme, 2> &slotThemes,
const std::array<int, 2> &slotLens,
- const int scrollLimit, const bool isHorizontal) :
+ const int scrollLimit, const int slotsPerPage,
+ const bool isHorizontal) :
slotThemes(slotThemes),
slotLens(slotLens),
scrollLimit(scrollLimit),
+ slotsPerPage(slotsPerPage),
isHorizontal(isHorizontal)
{
}
HcombInfo(const int totalLength,
const std::array<LayoutTheme, 2> &slotThemes) :
Info(slotThemes, {{(totalLength / 2), ceilDiv<2>(totalLength)}},
- (totalLength - 1), true),
+ impl::HCOMB_SCROLL_LIMIT, (totalLength - 1), true),
totalLength(totalLength)
{
}
}
LinearInfo(const LayoutTheme &slotTheme, const bool isHorizontal) :
- Info({{slotTheme}}, {{1, 0}}, 1, isHorizontal)
+ Info({{slotTheme}}, {{1, 0}}, 1, 1, isHorizontal)
{
}
};
elm_box_horizontal_set(m_box, toEina(m_info.isHorizontal));
show(m_box);
+ m_scroller->setStyle(impl::SCROLLER_STYLE);
expandAndFill(*m_scroller);
if (m_info.isHorizontal) {
elm_scroller_page_scroll_limit_set(
*m_scroller, m_info.scrollLimit, 0);
+ elm_scroller_bounce_set(*m_scroller, EINA_TRUE, EINA_FALSE);
} else {
elm_scroller_page_scroll_limit_set(
*m_scroller, 0, m_info.scrollLimit);
+ elm_scroller_bounce_set(*m_scroller, EINA_FALSE, EINA_TRUE);
}
show(*m_scroller);
if (m_slotSize == 0) {
UCL_ASSERT(!isOdd, "Must be even!");
m_slotSize = std::max(slot->calcSize(), 1);
+ const int pageSize = (m_slotSize * m_info.slotsPerPage);
if (m_info.isHorizontal) {
- elm_scroller_page_size_set(*m_scroller, m_slotSize, 0);
+ elm_scroller_page_size_set(*m_scroller, pageSize, 0);
} else {
- elm_scroller_page_size_set(*m_scroller, 0, m_slotSize);
+ elm_scroller_page_size_set(*m_scroller, 0, pageSize);
}
}