diff --git a/apps/Makefile b/apps/Makefile index ec371132a..85433e051 100644 --- a/apps/Makefile +++ b/apps/Makefile @@ -13,7 +13,6 @@ include apps/code/Makefile #include apps/picview/Makefile app_objs += $(addprefix apps/,\ - alpha_lock_view.o\ apps_container.o\ apps_window.o\ battery_timer.o\ @@ -29,6 +28,7 @@ app_objs += $(addprefix apps/,\ main.o\ math_toolbox.o\ node.o\ + shift_alpha_lock_view.o\ suspend_timer.o\ title_bar_view.o\ toolbox_node.o\ diff --git a/apps/i18n.cpp b/apps/i18n.cpp index 8933ac9d3..a78460e62 100644 --- a/apps/i18n.cpp +++ b/apps/i18n.cpp @@ -316,12 +316,13 @@ constexpr static char leftIntegralFirstLegend[] = {'P', '(', 'X', Ion::Charset:: constexpr static char finiteIntegralLegend[] = {Ion::Charset::LessEqual, 'X', Ion::Charset::LessEqual, 0}; -const char * universalMessages[241] { +const char * universalMessages[242] { "", "Python", "PYTHON (BETA)", "alpha", "ALPHA", + "shift", "x", "y", "n", diff --git a/apps/i18n.h b/apps/i18n.h index 3805c003e..4f126ba5b 100644 --- a/apps/i18n.h +++ b/apps/i18n.h @@ -152,7 +152,7 @@ namespace I18n { ValueNotReachedBySequence, NColumn, - /* Statistics */ + /* Statistics */ StatsApp, StatsAppCapital, DataTab, @@ -276,6 +276,7 @@ namespace I18n { CodeAppCapital, Alpha, CapitalAlpha, + Shift, X, Y, N, diff --git a/apps/alpha_lock_view.cpp b/apps/shift_alpha_lock_view.cpp similarity index 51% rename from apps/alpha_lock_view.cpp rename to apps/shift_alpha_lock_view.cpp index 645914af8..3edc66bba 100644 --- a/apps/alpha_lock_view.cpp +++ b/apps/shift_alpha_lock_view.cpp @@ -1,8 +1,8 @@ -#include "alpha_lock_view.h" +#include "shift_alpha_lock_view.h" AlphaLockView::AlphaLockView() : View(), - m_alphaView(KDText::FontSize::Small, I18n::Message::Default, 1.0f, 0.5f, KDColorWhite, Palette::YellowDark), + m_modifierView(KDText::FontSize::Small, I18n::Message::Default, 1.0f, 0.5f, KDColorWhite, Palette::YellowDark), m_status(Ion::Events::ShiftAlphaStatus::Default) { } @@ -14,18 +14,21 @@ void AlphaLockView::drawRect(KDContext * ctx, KDRect rect) const { bool AlphaLockView::setStatus(Ion::Events::ShiftAlphaStatus status) { if (status != m_status) { m_status = status; - switch (status) { + switch (m_status) { case Ion::Events::ShiftAlphaStatus::Alpha: case Ion::Events::ShiftAlphaStatus::AlphaLock: case Ion::Events::ShiftAlphaStatus::AlphaLockShift: - m_alphaView.setMessage(I18n::Message::Alpha); + m_modifierView.setMessage(I18n::Message::Alpha); break; case Ion::Events::ShiftAlphaStatus::ShiftAlpha: case Ion::Events::ShiftAlphaStatus::ShiftAlphaLock: - m_alphaView.setMessage(I18n::Message::CapitalAlpha); + m_modifierView.setMessage(I18n::Message::CapitalAlpha); break; - default: - m_alphaView.setMessage(I18n::Message::Default); + case Ion::Events::ShiftAlphaStatus::Shift: + m_modifierView.setMessage(I18n::Message::Shift); + break; + case Ion::Events::ShiftAlphaStatus::Default: + m_modifierView.setMessage(I18n::Message::Default); break; } markRectAsDirty(bounds()); @@ -35,37 +38,38 @@ bool AlphaLockView::setStatus(Ion::Events::ShiftAlphaStatus status) { } KDSize AlphaLockView::minimalSizeForOptimalDisplay() const { - KDSize alphaSize = KDText::stringSize(I18n::translate(I18n::Message::Alpha)); + KDSize modifierSize = KDText::stringSize(I18n::translate(I18n::Message::Alpha), KDText::FontSize::Small); KDSize lockSize = m_lockView.minimalSizeForOptimalDisplay(); - KDCoordinate height = lockSize.height() > alphaSize.height() ? lockSize.height() : alphaSize.height(); - return KDSize(alphaSize.width() + lockSize.width() + k_lockRightMargin, height); + KDCoordinate height = lockSize.height() > modifierSize.height() ? lockSize.height() : modifierSize.height(); + return KDSize(modifierSize.width() + lockSize.width() + k_lockRightMargin, height); } int AlphaLockView::numberOfSubviews() const { switch (m_status) { case Ion::Events::ShiftAlphaStatus::Alpha: + case Ion::Events::ShiftAlphaStatus::Shift: case Ion::Events::ShiftAlphaStatus::ShiftAlpha: return 1; case Ion::Events::ShiftAlphaStatus::AlphaLock: case Ion::Events::ShiftAlphaStatus::AlphaLockShift: case Ion::Events::ShiftAlphaStatus::ShiftAlphaLock: return 2; - default: + case Ion::Events::ShiftAlphaStatus::Default: return 0; } } View * AlphaLockView::subviewAtIndex(int index) { if (index == 0) { - return &m_alphaView; + return &m_modifierView; } return &m_lockView; } void AlphaLockView::layoutSubviews() { - KDSize alphaSize = KDText::stringSize(I18n::translate(I18n::Message::Alpha), KDText::FontSize::Small); - m_alphaView.setFrame(KDRect(bounds().width() - alphaSize.width(), (bounds().height()- alphaSize.height())/2, alphaSize)); + KDSize modifierSize = KDText::stringSize(I18n::translate(I18n::Message::Alpha), KDText::FontSize::Small); + m_modifierView.setFrame(KDRect(bounds().width() - modifierSize.width(), (bounds().height()- modifierSize.height())/2, modifierSize)); KDSize lockSize = m_lockView.minimalSizeForOptimalDisplay(); - m_lockView.setFrame(KDRect(bounds().width() - alphaSize.width() - lockSize.width() - k_lockRightMargin, (bounds().height()- lockSize.height())/2, lockSize)); + m_lockView.setFrame(KDRect(bounds().width() - modifierSize.width() - lockSize.width() - k_lockRightMargin, (bounds().height()- lockSize.height())/2, lockSize)); } diff --git a/apps/alpha_lock_view.h b/apps/shift_alpha_lock_view.h similarity index 94% rename from apps/alpha_lock_view.h rename to apps/shift_alpha_lock_view.h index c9d0b9d6e..00a57ba9d 100644 --- a/apps/alpha_lock_view.h +++ b/apps/shift_alpha_lock_view.h @@ -17,7 +17,7 @@ private: void layoutSubviews() override; View * subviewAtIndex(int index) override; LockView m_lockView; - MessageTextView m_alphaView; + MessageTextView m_modifierView; Ion::Events::ShiftAlphaStatus m_status; }; diff --git a/apps/title_bar_view.h b/apps/title_bar_view.h index b53da3dc7..26e51b6aa 100644 --- a/apps/title_bar_view.h +++ b/apps/title_bar_view.h @@ -3,7 +3,7 @@ #include #include "battery_view.h" -#include "alpha_lock_view.h" +#include "shift_alpha_lock_view.h" #include "i18n.h" class TitleBarView : public View {