mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2024-11-22 06:05:38 +00:00
Made the switches slightly smaller in the metadata editor.
Also made the value 'unknown' be set for some entries when clearing them individually in the metadata editor.
This commit is contained in:
parent
bddc87bbcc
commit
ade0160ffe
|
@ -106,6 +106,11 @@ GuiMetaDataEd::GuiMetaDataEd(
|
|||
switch (iter->type) {
|
||||
case MD_BOOL: {
|
||||
ed = std::make_shared<SwitchComponent>(window);
|
||||
// Make the switches slightly smaller.
|
||||
auto switchSize = ed->getSize() * 0.9;
|
||||
ed->setResize(switchSize.x(), switchSize.y());
|
||||
ed->setOrigin(-0.05, -0.09);
|
||||
|
||||
ed->setChangedColor(ICONCOLOR_USERMARKED);
|
||||
row.addElement(ed, false, true);
|
||||
break;
|
||||
|
@ -220,6 +225,15 @@ GuiMetaDataEd::GuiMetaDataEd(
|
|||
else
|
||||
ed->setColor(TEXTCOLOR_USERMARKED);
|
||||
}
|
||||
else if (newVal == "" && (currentKey == "developer" ||
|
||||
currentKey == "publisher" || currentKey == "genre" ||
|
||||
currentKey == "players")) {
|
||||
ed->setValue("unknown");
|
||||
if (originalValue == "unknown")
|
||||
ed->setColor(DEFAULT_TEXTCOLOR);
|
||||
else
|
||||
ed->setColor(TEXTCOLOR_USERMARKED);
|
||||
}
|
||||
else {
|
||||
ed->setValue(newVal);
|
||||
if (newVal == originalValue)
|
||||
|
|
|
@ -88,6 +88,7 @@ public:
|
|||
virtual Vector2f getSize() const;
|
||||
inline void setSize(const Vector2f& size) { setSize(size.x(), size.y()); }
|
||||
void setSize(float w, float h);
|
||||
virtual void setResize(float width, float height) {};
|
||||
virtual void onSizeChanged() {};
|
||||
|
||||
virtual Vector2f getRotationSize() const { return getSize(); };
|
||||
|
|
|
@ -38,7 +38,7 @@ public:
|
|||
// zero, don't do any resizing.
|
||||
// Can be set before or after an image is loaded.
|
||||
// setMaxSize() and setResize() are mutually exclusive.
|
||||
void setResize(float width, float height);
|
||||
void setResize(float width, float height) override;
|
||||
inline void setResize(const Vector2f& size) { setResize(size.x(), size.y()); }
|
||||
|
||||
// Resize the image to be as large as possible but fit within a box of this size.
|
||||
|
|
|
@ -30,6 +30,11 @@ void SwitchComponent::onSizeChanged()
|
|||
mImage.setSize(mSize);
|
||||
}
|
||||
|
||||
void SwitchComponent::setResize(float width, float height)
|
||||
{
|
||||
mImage.setResize(width, height);
|
||||
}
|
||||
|
||||
bool SwitchComponent::input(InputConfig* config, Input input)
|
||||
{
|
||||
if (config->isMappedTo("a", input) && input.value) {
|
||||
|
|
|
@ -22,6 +22,8 @@ public:
|
|||
void render(const Transform4x4f& parentTrans) override;
|
||||
void onSizeChanged() override;
|
||||
|
||||
void setResize(float width, float height) override;
|
||||
|
||||
bool getState() const;
|
||||
void setState(bool state);
|
||||
std::string getValue() const override;
|
||||
|
|
|
@ -71,7 +71,7 @@ public:
|
|||
// aspect ratio. If both are non-zero, potentially break the aspect ratio. If both are
|
||||
// zero, no resizing. This can be set before or after a video is loaded.
|
||||
// setMaxSize() and setResize() are mutually exclusive.
|
||||
virtual void setResize(float width, float height) = 0;
|
||||
virtual void setResize(float width, float height) override = 0;
|
||||
inline void setResize(const Vector2f& size) { setResize(size.x(), size.y()); }
|
||||
|
||||
// Resize the video to be as large as possible but fit within a box of this size.
|
||||
|
|
Loading…
Reference in a new issue