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:
1 parent
e8372ca149
commit
af60cdc11c
2 files changed
+6
-6
No files matched your search
@@ -11,6 +11,8 @@ using namespace anm2ed::types;
|
||||
|
||||
namespace anm2ed::imgui::popup
|
||||
{
|
||||
constexpr int EXISTING_ITEMS_ROWS = 6;
|
||||
|
||||
void ItemProperties::reset()
|
||||
{
|
||||
addItemName.clear();
|
||||
@@ -50,10 +52,7 @@ namespace anm2ed::imgui::popup
|
||||
auto& destination = settings.timelineAddItemDestination;
|
||||
auto& source = settings.timelineAddItemSource;
|
||||
|
||||
auto contentHeight = ImGui::GetContentRegionAvail().y - ImGui::GetFrameHeightWithSpacing();
|
||||
if (contentHeight < 1.0f) contentHeight = 1.0f;
|
||||
|
||||
if (ImGui::BeginChild("##Content", ImVec2(0, contentHeight), ImGuiChildFlags_Borders))
|
||||
if (ImGui::BeginChild("##Content", ImVec2(), ImGuiChildFlags_Borders | ImGuiChildFlags_AutoResizeY))
|
||||
{
|
||||
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));
|
||||
|
||||
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);
|
||||
if (addItemID != -1 && !unusedItems.contains(addItemID)) addItemID = -1;
|
||||
|
||||
@@ -11,7 +11,7 @@ namespace anm2ed::imgui::popup
|
||||
{
|
||||
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"};
|
||||
bool addItemIsShowRect{};
|
||||
int addItemID{-1};
|
||||
|
||||
Reference in new issue
Block a user