Reorder methods to match declaration order
This commit is contained in:
parent
0822ef20ab
commit
f2ddf230dc
1 changed files with 23 additions and 23 deletions
|
@ -104,29 +104,6 @@ std::size_t BlockGrid::size() const {
|
|||
return m_icons.size();
|
||||
}
|
||||
|
||||
unsigned int BlockGrid::rows() const {
|
||||
if (m_rows) {
|
||||
return m_rows;
|
||||
}
|
||||
else {
|
||||
const auto widget_h = static_cast<unsigned int>(std::max(this->height(), g_icon_spacing));
|
||||
const auto ico_spacing_uns = static_cast<unsigned int>(g_icon_spacing);
|
||||
return (widget_h - ico_spacing_uns) / (icon_size().height() + ico_spacing_uns);
|
||||
}
|
||||
}
|
||||
|
||||
unsigned int BlockGrid::columns() const {
|
||||
if (m_columns) {
|
||||
return m_columns;
|
||||
}
|
||||
else {
|
||||
const auto widget_w = static_cast<unsigned int>(std::max(this->width(), g_icon_spacing));
|
||||
const auto ico_spacing_uns = static_cast<unsigned int>(g_icon_spacing);
|
||||
|
||||
return (widget_w - ico_spacing_uns) / (icon_size().width() + ico_spacing_uns);
|
||||
}
|
||||
}
|
||||
|
||||
void BlockGrid::paintEvent (QPaintEvent* event) {
|
||||
QPainter painter(this);
|
||||
const int max_col = static_cast<int>(this->columns());
|
||||
|
@ -186,6 +163,29 @@ void BlockGrid::advance_frame() {
|
|||
this->update();
|
||||
}
|
||||
|
||||
unsigned int BlockGrid::rows() const {
|
||||
if (m_rows) {
|
||||
return m_rows;
|
||||
}
|
||||
else {
|
||||
const auto widget_h = static_cast<unsigned int>(std::max(this->height(), g_icon_spacing));
|
||||
const auto ico_spacing_uns = static_cast<unsigned int>(g_icon_spacing);
|
||||
return (widget_h - ico_spacing_uns) / (icon_size().height() + ico_spacing_uns);
|
||||
}
|
||||
}
|
||||
|
||||
unsigned int BlockGrid::columns() const {
|
||||
if (m_columns) {
|
||||
return m_columns;
|
||||
}
|
||||
else {
|
||||
const auto widget_w = static_cast<unsigned int>(std::max(this->width(), g_icon_spacing));
|
||||
const auto ico_spacing_uns = static_cast<unsigned int>(g_icon_spacing);
|
||||
|
||||
return (widget_w - ico_spacing_uns) / (icon_size().width() + ico_spacing_uns);
|
||||
}
|
||||
}
|
||||
|
||||
std::pair<int, QPoint> BlockGrid::locate_icon_index_at(QPoint pt) const {
|
||||
if (pt.x() < g_icon_spacing or pt.y() < g_icon_spacing)
|
||||
return {-1, QPoint()};
|
||||
|
|
Loading…
Add table
Reference in a new issue