From ce51228ca87d52fb5e728b8f2a9e16049ca9b915 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9a=20Saviot?= Date: Thu, 2 Nov 2017 13:38:29 +0100 Subject: [PATCH] [escher/code] Changed Console and TitleBar margins. Change-Id: I8ac4d84da84e0194122f34bb6259a1a7b6a1c81e --- apps/code/console_controller.cpp | 2 +- apps/title_bar_view.cpp | 6 +++--- apps/title_bar_view.h | 2 -- escher/include/escher/metric.h | 1 + 4 files changed, 5 insertions(+), 6 deletions(-) diff --git a/apps/code/console_controller.cpp b/apps/code/console_controller.cpp index 982fbee05..139999964 100644 --- a/apps/code/console_controller.cpp +++ b/apps/code/console_controller.cpp @@ -15,7 +15,7 @@ ConsoleController::ConsoleController(Responder * parentResponder, ScriptStore * SelectableTableViewDataSource(), TextFieldDelegate(), m_rowHeight(KDText::charSize(k_fontSize).height()), - m_selectableTableView(this, this, 0, 1, 0, Metric::CommonRightMargin, 3, Metric::HistoryHorizontalMargin, this, this, true, true, KDColorWhite), + m_selectableTableView(this, this, 0, 1, 0, Metric::CommonRightMargin, 0, Metric::TitleBarExternHorizontalMargin, this, this, true, true, KDColorWhite), m_editCell(this, this), m_pythonHeap(nullptr), m_scriptStore(scriptStore) diff --git a/apps/title_bar_view.cpp b/apps/title_bar_view.cpp index 7f49cec9e..9dbbbdafe 100644 --- a/apps/title_bar_view.cpp +++ b/apps/title_bar_view.cpp @@ -69,16 +69,16 @@ void TitleBarView::layoutSubviews() { * (because their glyph never cross the baseline). To avoid this effect, we * translate the frame of the title downwards.*/ m_titleView.setFrame(KDRect(0, 2, bounds().width(), bounds().height()-2)); - m_preferenceView.setFrame(KDRect(k_preferenceMargin, 0, m_preferenceView.minimalSizeForOptimalDisplay().width(), bounds().height())); + m_preferenceView.setFrame(KDRect(Metric::TitleBarExternHorizontalMargin, 0, m_preferenceView.minimalSizeForOptimalDisplay().width(), bounds().height())); KDSize batterySize = m_batteryView.minimalSizeForOptimalDisplay(); - m_batteryView.setFrame(KDRect(bounds().width() - batterySize.width() - k_batteryRightMargin, (bounds().height()- batterySize.height())/2, batterySize)); + m_batteryView.setFrame(KDRect(bounds().width() - batterySize.width() - Metric::TitleBarExternHorizontalMargin, (bounds().height()- batterySize.height())/2, batterySize)); if (GlobalPreferences::sharedGlobalPreferences()->examMode() == GlobalPreferences::ExamMode::Activate) { m_examModeIconView.setFrame(KDRect(k_examIconMargin, (bounds().height() - k_examIconHeight)/2, k_examIconWidth, k_examIconHeight)); } else { m_examModeIconView.setFrame(KDRectZero); } KDSize shiftAlphaLockSize = m_shiftAlphaLockView.minimalSizeForOptimalDisplay(); - m_shiftAlphaLockView.setFrame(KDRect(bounds().width()-batterySize.width()-k_batteryRightMargin-k_alphaRightMargin-shiftAlphaLockSize.width(), (bounds().height()- shiftAlphaLockSize.height())/2, shiftAlphaLockSize)); + m_shiftAlphaLockView.setFrame(KDRect(bounds().width()-batterySize.width()-Metric::TitleBarExternHorizontalMargin-k_alphaRightMargin-shiftAlphaLockSize.width(), (bounds().height()- shiftAlphaLockSize.height())/2, shiftAlphaLockSize)); } void TitleBarView::refreshPreferences() { diff --git a/apps/title_bar_view.h b/apps/title_bar_view.h index 5cac9bb24..264be8a96 100644 --- a/apps/title_bar_view.h +++ b/apps/title_bar_view.h @@ -17,9 +17,7 @@ public: bool setShiftAlphaLockStatus(Ion::Events::ShiftAlphaStatus status); void refreshPreferences(); private: - constexpr static KDCoordinate k_batteryRightMargin = 5; constexpr static KDCoordinate k_alphaRightMargin = 5; - constexpr static KDCoordinate k_preferenceMargin = 3; constexpr static KDCoordinate k_examIconWidth = 18; constexpr static KDCoordinate k_examIconHeight = 9; constexpr static KDCoordinate k_examIconMargin = 93; diff --git a/escher/include/escher/metric.h b/escher/include/escher/metric.h index a5535e469..0fe7ac70b 100644 --- a/escher/include/escher/metric.h +++ b/escher/include/escher/metric.h @@ -10,6 +10,7 @@ public: constexpr static KDCoordinate CommonTopMargin = 15; constexpr static KDCoordinate CommonBottomMargin = 15; constexpr static KDCoordinate HistoryHorizontalMargin = 10; + constexpr static KDCoordinate TitleBarExternHorizontalMargin = 5; constexpr static KDCoordinate ParameterCellHeight = 35; constexpr static KDCoordinate ModalTopMargin = 5; constexpr static KDCoordinate ModalBottomMargin = 18;