diff --git a/es-app/src/guis/GuiMetaDataEd.cpp b/es-app/src/guis/GuiMetaDataEd.cpp index 1e5b01f71..0d160ec92 100644 --- a/es-app/src/guis/GuiMetaDataEd.cpp +++ b/es-app/src/guis/GuiMetaDataEd.cpp @@ -158,7 +158,7 @@ GuiMetaDataEd::GuiMetaDataEd( spacer->setSize(Renderer::getScreenWidth() * 0.0025f, 0); row.addElement(spacer, false); - ed = std::make_shared(window); + ed = std::make_shared(window, true); ed->setOriginalColor(DEFAULT_TEXTCOLOR); ed->setChangedColor(TEXTCOLOR_USERMARKED); row.addElement(ed, false); diff --git a/es-core/src/components/DateTimeEditComponent.cpp b/es-core/src/components/DateTimeEditComponent.cpp index b3837b467..62a4a166b 100644 --- a/es-core/src/components/DateTimeEditComponent.cpp +++ b/es-core/src/components/DateTimeEditComponent.cpp @@ -13,6 +13,7 @@ DateTimeEditComponent::DateTimeEditComponent( Window* window, + bool alignRight, DisplayMode dispMode) : GuiComponent(window), mEditing(false), @@ -22,7 +23,8 @@ DateTimeEditComponent::DateTimeEditComponent( mColor(0x777777FF), mFont(Font::get(FONT_SIZE_SMALL, FONT_PATH_LIGHT)), mUppercase(false), - mAutoSize(true) + mAutoSize(true), + mAlignRight(alignRight) { updateTextCache(); } @@ -170,8 +172,8 @@ void DateTimeEditComponent::render(const Transform4x4f& parentTrans) // Vertically center. Vector3f off(0, (mSize.y() - mTextCache->metrics.size.y()) / 2.0f, 0.0f); - // Right align. - off.x() += referenceSize - mTextCache->metrics.size.x(); + if (mAlignRight) + off.x() += referenceSize - mTextCache->metrics.size.x(); trans.translate(off); Renderer::setMatrix(trans); diff --git a/es-core/src/components/DateTimeEditComponent.h b/es-core/src/components/DateTimeEditComponent.h index 376ad1c3c..cc79053b7 100644 --- a/es-core/src/components/DateTimeEditComponent.h +++ b/es-core/src/components/DateTimeEditComponent.h @@ -24,7 +24,8 @@ public: DISP_RELATIVE_TO_NOW }; - DateTimeEditComponent(Window* window, DisplayMode dispMode = DISP_DATE); + DateTimeEditComponent(Window* window, bool alignRight = false, + DisplayMode dispMode = DISP_DATE); void setValue(const std::string& val) override; std::string getValue() const override; @@ -86,6 +87,7 @@ private: unsigned int mColorChangedValue; std::shared_ptr mFont; + bool mAlignRight; bool mUppercase; bool mAutoSize; };