diff --git a/apps/code/python_toolbox.cpp b/apps/code/python_toolbox.cpp index a22c14730..b6bec4d4b 100644 --- a/apps/code/python_toolbox.cpp +++ b/apps/code/python_toolbox.cpp @@ -362,7 +362,7 @@ KDCoordinate PythonToolbox::rowHeight(int j) { * children of the toolbox, which is the only menu that has special height * rows. */ const ToolboxMessageTree * messageTree = static_cast(m_messageTreeModel->children(j)); - return k_font->stringSize(I18n::translate(messageTree->label())).height() + 2*Metric::TableCellLabelTopMargin + (messageTree->text() == I18n::Message::Default ? 0 : Toolbox::rowHeight(j)); + return k_font->stringSize(I18n::translate(messageTree->label())).height() + 2*Metric::TableCellVerticalMargin + (messageTree->text() == I18n::Message::Default ? 0 : Toolbox::rowHeight(j)); } return Toolbox::rowHeight(j); } diff --git a/apps/code/script_node_cell.cpp b/apps/code/script_node_cell.cpp index 8fcdbc15a..3fda4c1eb 100644 --- a/apps/code/script_node_cell.cpp +++ b/apps/code/script_node_cell.cpp @@ -23,12 +23,12 @@ void ScriptNodeCell::ScriptNodeView::setScriptStore(ScriptStore * scriptStore) { } void ScriptNodeCell::ScriptNodeView::drawRect(KDContext * ctx, KDRect rect) const { - ctx->drawString(m_scriptNode->name(), KDPoint(0, Metric::TableCellLabelTopMargin), k_font, KDColorBlack, isHighlighted()? Palette::Select : KDColorWhite); + ctx->drawString(m_scriptNode->name(), KDPoint(0, Metric::TableCellVerticalMargin), k_font, KDColorBlack, isHighlighted()? Palette::Select : KDColorWhite); KDSize nameSize = k_font->stringSize(m_scriptNode->name()); if (m_scriptNode->type() == ScriptNode::Type::Function) { - ctx->drawString(ScriptNodeCell::k_parentheses, KDPoint(nameSize.width(), Metric::TableCellLabelTopMargin), k_font, KDColorBlack, isHighlighted()? Palette::Select : KDColorWhite); + ctx->drawString(ScriptNodeCell::k_parentheses, KDPoint(nameSize.width(), Metric::TableCellVerticalMargin), k_font, KDColorBlack, isHighlighted()? Palette::Select : KDColorWhite); } - ctx->drawString(m_scriptStore->scriptAtIndex(m_scriptNode->scriptIndex()).fullName(), KDPoint(0, Metric::TableCellLabelTopMargin + nameSize.height() + k_verticalMargin), k_font, Palette::GreyDark, isHighlighted()? Palette::Select : KDColorWhite); + ctx->drawString(m_scriptStore->scriptAtIndex(m_scriptNode->scriptIndex()).fullName(), KDPoint(0, Metric::TableCellVerticalMargin + nameSize.height() + k_verticalMargin), k_font, Palette::GreyDark, isHighlighted()? Palette::Select : KDColorWhite); } KDSize ScriptNodeCell::ScriptNodeView::minimalSizeForOptimalDisplay() const { @@ -41,7 +41,7 @@ KDSize ScriptNodeCell::ScriptNodeView::minimalSizeForOptimalDisplay() const { if (m_scriptNode->type() == ScriptNode::Type::Function) { size3 = k_font->stringSize(ScriptNodeCell::k_parentheses); } - return KDSize(size1.width() + size3.width() > size2.width() ? size1.width() + size3.width() : size2.width(), Metric::TableCellLabelTopMargin + size1.width() + k_verticalMargin + size2.width()); + return KDSize(size1.width() + size3.width() > size2.width() ? size1.width() + size3.width() : size2.width(), Metric::TableCellVerticalMargin + size1.width() + k_verticalMargin + size2.width()); } ScriptNodeCell::ScriptNodeCell() : diff --git a/apps/graph/list/list_parameter_controller.cpp b/apps/graph/list/list_parameter_controller.cpp index 331808e24..29b7bbdef 100644 --- a/apps/graph/list/list_parameter_controller.cpp +++ b/apps/graph/list/list_parameter_controller.cpp @@ -89,7 +89,7 @@ void ListParameterController::willDisplayCellForIndex(HighlightCell * cell, int constexpr int bufferSize = BufferTextView::k_maxNumberOfChar; char buffer[bufferSize]; int glyphLength = writeInterval(buffer, bufferSize, min, max, Preferences::VeryShortNumberOfSignificantDigits, Preferences::sharedPreferences()->displayMode()); - int numberOfAvailableGlyphs = (m_functionDomain.bounds().width() - m_functionDomain.labelView()->bounds().width() - m_functionDomain.accessoryView()->bounds().width() - TableCell::k_labelMargin - TableCell::k_accessoryMargin)/KDFont::SmallFont->glyphSize().width(); + int numberOfAvailableGlyphs = (m_functionDomain.bounds().width() - m_functionDomain.labelView()->bounds().width() - m_functionDomain.accessoryView()->bounds().width() - 2*Metric::TableCellHorizontalMargin)/KDFont::SmallFont->glyphSize().width(); if (glyphLength > numberOfAvailableGlyphs) { writeInterval(buffer, bufferSize, min, max, Preferences::VeryShortNumberOfSignificantDigits-1, Preferences::PrintFloatMode::Scientific); } diff --git a/escher/include/escher/metric.h b/escher/include/escher/metric.h index dfd388772..b82640a2c 100644 --- a/escher/include/escher/metric.h +++ b/escher/include/escher/metric.h @@ -17,7 +17,8 @@ public: constexpr static KDCoordinate ParameterCellHeight = 35; constexpr static KDCoordinate ModalTopMargin = 5; constexpr static KDCoordinate ModalBottomMargin = 18; - constexpr static KDCoordinate TableCellLabelTopMargin = 3; + constexpr static KDCoordinate TableCellVerticalMargin = 3; + constexpr static KDCoordinate TableCellHorizontalMargin = 10; constexpr static KDCoordinate TabHeight = 27; constexpr static KDCoordinate ScrollStep = 10; constexpr static KDCoordinate PopUpLeftMargin = 32; diff --git a/escher/src/table_cell.cpp b/escher/src/table_cell.cpp index e2d9f73cf..45b1502fa 100644 --- a/escher/src/table_cell.cpp +++ b/escher/src/table_cell.cpp @@ -50,7 +50,7 @@ void TableCell::layoutSubviews(bool force) { case Layout::Vertical: { KDCoordinate x = k_separatorThickness+labelMargin(); - KDCoordinate y = k_separatorThickness+Metric::TableCellLabelTopMargin; + KDCoordinate y = k_separatorThickness+Metric::TableCellVerticalMargin; label->setFrame(KDRect( x, y,