Commit a0b1d75c authored by Karl Ove Hufthammer's avatar Karl Ove Hufthammer
Browse files

Add proper spacing around operators and equals sign

In proper mathematical typography, there should be a space
on each side of arithmetic operators and the equals sign.

Note that a space have *not* been added around the equals
sign string in the factorize exercise, as this equal sign
is painted using QGridLayout, which already adds some spacing
between each cell.
parent 696a59c9
......@@ -108,7 +108,7 @@ void RationalWidget::paintEvent(QPaintEvent* /* p_paintEvent */)
// paint a = at the end
x_pos += _MARGIN_X;
paintMiddle(paint, QStringLiteral("="), x_pos, y_pos, fm, m_colorOperation);
paintMiddle(paint, QStringLiteral(" = "), x_pos, y_pos, fm, m_colorOperation);
// stop the painter
paint.end();
......
......@@ -117,13 +117,16 @@ void TaskWidget::paintEvent(QPaintEvent* /* p_paintEvent */)
break;
} /* switch (operation) */
// add proper spacing around the operator
str_operation = QStringLiteral(" ") + str_operation + QStringLiteral(" ");
// paint the operation
paintMiddle(paint, str_operation, old_x, old_y, fm, m_colorOperation);
} else {
// no further operations to show, so we always show the = sign at the
// end of a task
paintMiddle(paint, QStringLiteral("="), old_x, old_y, fm, m_colorOperation);
paintMiddle(paint, QStringLiteral(" = "), old_x, old_y, fm, m_colorOperation);
break;
} // if (tmp_counter < m_task.getNumberOfOperations())
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment