From 3ccc240d0549a3c6ebef8ed1a026bc96d48fe0be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89milie=20Feral?= Date: Thu, 10 Nov 2016 11:25:59 +0100 Subject: [PATCH] [escher] in menu list cell, change name contentView->accessoryView Change-Id: Ide0ce134f83b6b491b66bc6df9900a1928888a8a --- apps/graph/list/parameter_controller.cpp | 2 +- .../values/function_parameter_controller.cpp | 2 +- .../values/values_parameter_controller.cpp | 8 ++++---- escher/include/escher/chevron_menu_list_cell.h | 4 ++-- escher/include/escher/menu_list_cell.h | 2 +- escher/include/escher/switch_menu_list_cell.h | 4 ++-- escher/include/escher/text_menu_list_cell.h | 8 ++++---- escher/src/chevron_menu_list_cell.cpp | 8 ++++---- escher/src/menu_list_cell.cpp | 12 ++++++------ escher/src/switch_menu_list_cell.cpp | 6 +++--- escher/src/text_menu_list_cell.cpp | 18 +++++++++--------- 11 files changed, 37 insertions(+), 37 deletions(-) diff --git a/apps/graph/list/parameter_controller.cpp b/apps/graph/list/parameter_controller.cpp index f65114a58..994eca462 100644 --- a/apps/graph/list/parameter_controller.cpp +++ b/apps/graph/list/parameter_controller.cpp @@ -29,7 +29,7 @@ void ParameterController::didBecomeFirstResponder() { void ParameterController::willDisplayCellForIndex(TableViewCell * cell, int index) { if (cell == &m_enableCell) { - SwitchView * switchView = (SwitchView *)m_enableCell.contentView(); + SwitchView * switchView = (SwitchView *)m_enableCell.accessoryView(); switchView->setState(m_function->isActive()); } } diff --git a/apps/graph/values/function_parameter_controller.cpp b/apps/graph/values/function_parameter_controller.cpp index 956f4b4c5..fd938b47b 100644 --- a/apps/graph/values/function_parameter_controller.cpp +++ b/apps/graph/values/function_parameter_controller.cpp @@ -83,7 +83,7 @@ KDCoordinate FunctionParameterController::cellHeight() { void FunctionParameterController::willDisplayCellForIndex(TableViewCell * cell, int index) { if (cell == &m_displayDerivativeColumn) { - SwitchView * switchView = (SwitchView *)m_displayDerivativeColumn.contentView(); + SwitchView * switchView = (SwitchView *)m_displayDerivativeColumn.accessoryView(); switchView->setState(m_function->displayDerivative()); } } diff --git a/apps/graph/values/values_parameter_controller.cpp b/apps/graph/values/values_parameter_controller.cpp index 994e90a7c..75bed4d80 100644 --- a/apps/graph/values/values_parameter_controller.cpp +++ b/apps/graph/values/values_parameter_controller.cpp @@ -44,15 +44,15 @@ void ValuesParameterController::willDisplayCellForIndex(TableViewCell * cell, in switch (index) { case 0: Float(m_interval->start()).convertFloatToText(buffer, Constant::FloatBufferSizeInScientificMode, Constant::NumberOfDigitsInMantissaInScientificMode); - myCell->setText(buffer); + myCell->setAccessoryText(buffer); break; case 1: Float(m_interval->end()).convertFloatToText(buffer, Constant::FloatBufferSizeInScientificMode, Constant::NumberOfDigitsInMantissaInScientificMode); - myCell->setText(buffer); + myCell->setAccessoryText(buffer); break; case 2: Float(m_interval->step()).convertFloatToText(buffer, Constant::FloatBufferSizeInScientificMode, Constant::NumberOfDigitsInMantissaInScientificMode); - myCell->setText(buffer); + myCell->setAccessoryText(buffer); break; default: assert(false); @@ -100,7 +100,7 @@ void ValuesParameterController::editInterval(bool overwrite, char initialDigit) initialTextContent[1] = 0; } else { TextMenuListCell * textMenuListCell = (TextMenuListCell *)reusableCell(activeCell()); - strlcpy(initialTextContent, textMenuListCell->textContent(), sizeof(initialTextContent)); + strlcpy(initialTextContent, textMenuListCell->accessoryText(), sizeof(initialTextContent)); } App * myApp = (App *)app(); InputViewController * inputController = myApp->inputViewController(); diff --git a/escher/include/escher/chevron_menu_list_cell.h b/escher/include/escher/chevron_menu_list_cell.h index 99c8cda1c..002870067 100644 --- a/escher/include/escher/chevron_menu_list_cell.h +++ b/escher/include/escher/chevron_menu_list_cell.h @@ -7,10 +7,10 @@ class ChevronMenuListCell : public MenuListCell { public: ChevronMenuListCell(char * label = nullptr); - View * contentView() const override; + View * accessoryView() const override; void reloadCell() override; private: - ChevronView m_contentView; + ChevronView m_accessoryView; }; #endif diff --git a/escher/include/escher/menu_list_cell.h b/escher/include/escher/menu_list_cell.h index b98e289fd..a99b700c4 100644 --- a/escher/include/escher/menu_list_cell.h +++ b/escher/include/escher/menu_list_cell.h @@ -10,7 +10,7 @@ class MenuListCell : public TableViewCell { public: MenuListCell(char * label = nullptr); - virtual View * contentView() const; + virtual View * accessoryView() const; void setText(const char * text); void drawRect(KDContext * ctx, KDRect rect) const override; void reloadCell() override; diff --git a/escher/include/escher/switch_menu_list_cell.h b/escher/include/escher/switch_menu_list_cell.h index 0db98555d..26623ad52 100644 --- a/escher/include/escher/switch_menu_list_cell.h +++ b/escher/include/escher/switch_menu_list_cell.h @@ -7,9 +7,9 @@ class SwitchMenuListCell : public MenuListCell { public: SwitchMenuListCell(char * label); - View * contentView() const override; + View * accessoryView() const override; private: - SwitchView m_contentView; + SwitchView m_accessoryView; }; #endif diff --git a/escher/include/escher/text_menu_list_cell.h b/escher/include/escher/text_menu_list_cell.h index 68b465b60..88e3a33d8 100644 --- a/escher/include/escher/text_menu_list_cell.h +++ b/escher/include/escher/text_menu_list_cell.h @@ -8,12 +8,12 @@ class TextMenuListCell : public MenuListCell { public: TextMenuListCell(char * label); void reloadCell() override; - View * contentView() const override; + View * accessoryView() const override; void setHighlighted(bool highlight); - void setText(const char * textBody); - const char * textContent(); + void setAccessoryText(const char * textBody); + const char * accessoryText(); private: - BufferTextView m_contentView; + BufferTextView m_accessoryView; }; #endif diff --git a/escher/src/chevron_menu_list_cell.cpp b/escher/src/chevron_menu_list_cell.cpp index 113ac929a..2987d5cff 100644 --- a/escher/src/chevron_menu_list_cell.cpp +++ b/escher/src/chevron_menu_list_cell.cpp @@ -2,15 +2,15 @@ ChevronMenuListCell::ChevronMenuListCell(char * label) : MenuListCell(label), - m_contentView(ChevronView()) + m_accessoryView(ChevronView()) { } -View * ChevronMenuListCell::contentView() const { - return (View *)&m_contentView; +View * ChevronMenuListCell::accessoryView() const { + return (View *)&m_accessoryView; } void ChevronMenuListCell::reloadCell() { MenuListCell::reloadCell(); - m_contentView.setHighlighted(isHighlighted()); + m_accessoryView.setHighlighted(isHighlighted()); } \ No newline at end of file diff --git a/escher/src/menu_list_cell.cpp b/escher/src/menu_list_cell.cpp index d76236d95..59793e58d 100644 --- a/escher/src/menu_list_cell.cpp +++ b/escher/src/menu_list_cell.cpp @@ -10,7 +10,7 @@ MenuListCell::MenuListCell(char * label) : } int MenuListCell::numberOfSubviews() const { - if (contentView() == nullptr) { + if (accessoryView() == nullptr) { return 1; } return 2; @@ -21,7 +21,7 @@ View * MenuListCell::subviewAtIndex(int index) { return &m_pointerTextView; } assert(numberOfSubviews() == 2 && index == 1); - return contentView(); + return accessoryView(); } void MenuListCell::layoutSubviews() { @@ -29,9 +29,9 @@ void MenuListCell::layoutSubviews() { KDCoordinate height = bounds().height(); KDSize labelSize = m_pointerTextView.minimalSizeForOptimalDisplay(); m_pointerTextView.setFrame(KDRect(k_separatorThickness, k_separatorThickness, labelSize.width(), height - 2*k_separatorThickness)); - View * content = contentView(); - if (content) { - content->setFrame(KDRect(k_separatorThickness + labelSize.width(), k_separatorThickness, width - labelSize.width()-2*k_separatorThickness, height-2*k_separatorThickness)); + View * accessory = accessoryView(); + if (accessory) { + accessory->setFrame(KDRect(k_separatorThickness + labelSize.width(), k_separatorThickness, width - labelSize.width()-2*k_separatorThickness, height-2*k_separatorThickness)); } } @@ -46,7 +46,7 @@ void MenuListCell::setText(const char * text) { layoutSubviews(); } -View * MenuListCell::contentView() const { +View * MenuListCell::accessoryView() const { return nullptr; } diff --git a/escher/src/switch_menu_list_cell.cpp b/escher/src/switch_menu_list_cell.cpp index ade6df3bf..bcdf92686 100644 --- a/escher/src/switch_menu_list_cell.cpp +++ b/escher/src/switch_menu_list_cell.cpp @@ -2,10 +2,10 @@ SwitchMenuListCell::SwitchMenuListCell(char * label) : MenuListCell(label), - m_contentView(SwitchView()) + m_accessoryView(SwitchView()) { } -View * SwitchMenuListCell::contentView() const { - return (View *)&m_contentView; +View * SwitchMenuListCell::accessoryView() const { + return (View *)&m_accessoryView; } diff --git a/escher/src/text_menu_list_cell.cpp b/escher/src/text_menu_list_cell.cpp index dd740b7ec..4a27d826d 100644 --- a/escher/src/text_menu_list_cell.cpp +++ b/escher/src/text_menu_list_cell.cpp @@ -2,30 +2,30 @@ TextMenuListCell::TextMenuListCell(char * label) : MenuListCell(label), - m_contentView(BufferTextView(1.0f, 0.5f)) + m_accessoryView(BufferTextView(1.0f, 0.5f)) { } -void TextMenuListCell::setText(const char * textBody) { - m_contentView.setText(textBody); +void TextMenuListCell::setAccessoryText(const char * textBody) { + m_accessoryView.setText(textBody); } -const char * TextMenuListCell::textContent() { - return m_contentView.text(); +const char * TextMenuListCell::accessoryText() { + return m_accessoryView.text(); } -View * TextMenuListCell::contentView() const { - return (View *)&m_contentView; +View * TextMenuListCell::accessoryView() const { + return (View *)&m_accessoryView; } void TextMenuListCell::reloadCell() { MenuListCell::reloadCell(); KDColor backgroundColor = isHighlighted()? Palette::FocusCellBackgroundColor : Palette::CellBackgroundColor; - m_contentView.setBackgroundColor(backgroundColor); + m_accessoryView.setBackgroundColor(backgroundColor); } void TextMenuListCell::setHighlighted(bool highlight) { MenuListCell::setHighlighted(highlight); KDColor backgroundColor = highlight? Palette::FocusCellBackgroundColor : Palette::CellBackgroundColor; - m_contentView.setBackgroundColor(backgroundColor); + m_accessoryView.setBackgroundColor(backgroundColor); } \ No newline at end of file