[escher/code] Changed Console and TitleBar margins.

Change-Id: I8ac4d84da84e0194122f34bb6259a1a7b6a1c81e
This commit is contained in:
Léa Saviot
2017-11-02 13:38:29 +01:00
committed by Romain Goyet
parent fbdf6379d8
commit ce51228ca8
4 changed files with 5 additions and 6 deletions

View File

@@ -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)

View File

@@ -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() {

View File

@@ -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;

View File

@@ -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;