mirror of
https://github.com/fergalmoran/flameshot.git
synced 2026-04-01 21:11:11 +00:00
Add comments and better format of the code
This commit is contained in:
@@ -52,7 +52,10 @@ bool ButtonHandler::isVisible() const {
|
||||
size_t ButtonHandler::size() const {
|
||||
return m_vectorButtons.size();
|
||||
}
|
||||
|
||||
// updatePosition updates the position of the buttons arround the
|
||||
// selection area. Ignores the sides blocked by the end of the screen.
|
||||
// When the selection is too small it works on a virtual selection with
|
||||
// the original in the center.
|
||||
void ButtonHandler::updatePosition(const QRect &selection,
|
||||
const QRect &limits) {
|
||||
const QVector<Button*>::size_type vecLength = m_vectorButtons.size();
|
||||
@@ -239,6 +242,9 @@ void ButtonHandler::updatePosition(const QRect &selection,
|
||||
}
|
||||
}
|
||||
|
||||
// getHPoints is an auxiliar method for the button position computation.
|
||||
// starts from a known center and keeps adding elements horizontally
|
||||
// and returns the computed positions.
|
||||
QVector<QPoint> ButtonHandler::getHPoints(
|
||||
const QPoint ¢er, const int elements) const {
|
||||
|
||||
@@ -261,6 +267,9 @@ QVector<QPoint> ButtonHandler::getHPoints(
|
||||
return res;
|
||||
}
|
||||
|
||||
// getHPoints is an auxiliar method for the button position computation.
|
||||
// starts from a known center and keeps adding elements vertically
|
||||
// and returns the computed positions.
|
||||
QVector<QPoint> ButtonHandler::getVPoints(
|
||||
const QPoint ¢er, const int elements) const {
|
||||
|
||||
@@ -282,7 +291,7 @@ QVector<QPoint> ButtonHandler::getVPoints(
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
// setButtons redefines the buttons of the button handler
|
||||
void ButtonHandler::setButtons(QVector<Button *> v) {
|
||||
for (Button *b: m_vectorButtons) delete(b);
|
||||
m_vectorButtons = v;
|
||||
|
||||
Reference in New Issue
Block a user