Skip to content

Commit

Permalink
fix paste button overlapping browse
Browse files Browse the repository at this point in the history
  • Loading branch information
Cvolton committed Jun 26, 2024
1 parent b97d923 commit 93e2966
Showing 1 changed file with 18 additions and 3 deletions.
21 changes: 18 additions & 3 deletions src/CustomizeObjectLayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,13 +89,28 @@ using namespace geode::node_ids;
"paste-button",
"browse-button"
);
idOffset += 3;
}
else {
//if LevelEditorLayer::canPasteState
if(auto btn = typeinfo_cast<CCMenuItemSpriteExtra*>(m_buttonMenu->getChildren()->objectAtIndex(idOffset))) {
if(auto label = typeinfo_cast<ButtonSprite*>(btn->getNormalImage())) {
if(std::string_view(label->m_label->getString()) == "Paste") {
setIDs(
m_buttonMenu,
idOffset,
"paste-button"
);
idOffset += 1;
}
}
}
setIDs(
m_buttonMenu,
idOffset,
"browse-button"
);
idOffset += 1;
}

auto tabsLayout = RowLayout::create()
Expand Down Expand Up @@ -271,10 +286,10 @@ using namespace geode::node_ids;
"copy-paste-menu",
ColumnLayout::create()
->setAxisAlignment(AxisAlignment::End)
->setAxisReverse(true)
->setAxisReverse(false)
->setGap(6.f),
m_buttonMenu->getChildByID("copy-button"),
m_buttonMenu->getChildByID("paste-button")
m_buttonMenu->getChildByID("paste-button"),
m_buttonMenu->getChildByID("copy-button")
);
copyPasteMenu->setContentSize({ 100.f, 140.f });
copyPasteMenu->setPositionY(winSize.height / 2 + 99.5f);
Expand Down

0 comments on commit 93e2966

Please sign in to comment.