Item Properties fits its content

The popup is small and as tall as its options instead of half the screen;
the existing-items list keeps a fixed height.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
shweetandClaude Opus 5.5 committed 2026-10-08 16:59:35 -04:00
1 parent e8372ca149
commit af60cdc11c
2 files changed
+6 -6

No files matched your search

+5 -5
View File
@@ -11,6 +11,8 @@ using namespace anm2ed::types;
namespace anm2ed::imgui::popup namespace anm2ed::imgui::popup
{ {
constexpr int EXISTING_ITEMS_ROWS = 6;
void ItemProperties::reset() void ItemProperties::reset()
{ {
addItemName.clear(); addItemName.clear();
@@ -50,10 +52,7 @@ namespace anm2ed::imgui::popup
auto& destination = settings.timelineAddItemDestination; auto& destination = settings.timelineAddItemDestination;
auto& source = settings.timelineAddItemSource; auto& source = settings.timelineAddItemSource;
auto contentHeight = ImGui::GetContentRegionAvail().y - ImGui::GetFrameHeightWithSpacing(); if (ImGui::BeginChild("##Content", ImVec2(), ImGuiChildFlags_Borders | ImGuiChildFlags_AutoResizeY))
if (contentHeight < 1.0f) contentHeight = 1.0f;
if (ImGui::BeginChild("##Content", ImVec2(0, contentHeight), ImGuiChildFlags_Borders))
{ {
auto spaced_pair = [](auto left, auto right) auto spaced_pair = [](auto left, auto right)
{ {
@@ -134,7 +133,8 @@ namespace anm2ed::imgui::popup
{ {
ImGui::SeparatorText(localize.get(type == LAYER ? LABEL_LAYER : LABEL_NULL)); ImGui::SeparatorText(localize.get(type == LAYER ? LABEL_LAYER : LABEL_NULL));
if (ImGui::BeginChild("##Existing Items", ImVec2(0, 0))) if (ImGui::BeginChild("##Existing Items",
ImVec2(0, ImGui::GetFrameHeightWithSpacing() * EXISTING_ITEMS_ROWS)))
{ {
auto unusedItems = unused_items_get(type); auto unusedItems = unused_items_get(type);
if (addItemID != -1 && !unusedItems.contains(addItemID)) addItemID = -1; if (addItemID != -1 && !unusedItems.contains(addItemID)) addItemID = -1;
+1 -1
View File
@@ -11,7 +11,7 @@ namespace anm2ed::imgui::popup
{ {
class ItemProperties class ItemProperties
{ {
PopupHelper popup{PopupHelper(LABEL_TIMELINE_PROPERTIES_POPUP, POPUP_NORMAL)}; PopupHelper popup{PopupHelper(LABEL_TIMELINE_PROPERTIES_POPUP, POPUP_SMALL_NO_HEIGHT)};
std::string addItemName{"New Item"}; std::string addItemName{"New Item"};
bool addItemIsShowRect{}; bool addItemIsShowRect{};
int addItemID{-1}; int addItemID{-1};