fix: Better icon text input width calculation
This commit is contained in:
parent
5f2c07f2d8
commit
382599dcf6
@ -981,7 +981,9 @@ namespace ImGuiExt {
|
||||
|
||||
SetCursorPosX(GetCursorPosX() + frame_size.x);
|
||||
|
||||
bool value_changed = InputTextEx(label, nullptr, buffer.data(), buffer.size() + 1, ImVec2(CalcItemWidth() - icon_frame_size.x, label_size.y + style.FramePadding.y * 2.0F), ImGuiInputTextFlags_CallbackResize | flags, UpdateStringSizeCallback, &buffer);
|
||||
float width_adjustment = window->DC.ItemWidth < 0 ? 0 : icon_frame_size.x;
|
||||
|
||||
bool value_changed = InputTextEx(label, hint, buffer.data(), buffer.size() + 1, ImVec2(CalcItemWidth() - width_adjustment, label_size.y + style.FramePadding.y * 2.0F), ImGuiInputTextFlags_CallbackResize | flags, UpdateStringSizeCallback, &buffer);
|
||||
|
||||
if (value_changed)
|
||||
MarkItemEdited(GImGui->LastItemData.ID);
|
||||
|
@ -1242,7 +1242,7 @@ namespace hex::ui {
|
||||
this->resetEditing();
|
||||
}
|
||||
|
||||
ImGui::PushItemWidth(ImGui::GetContentRegionAvail().x - (ImGui::GetTextLineHeightWithSpacing() * 9.4F));
|
||||
ImGui::PushItemWidth(-(ImGui::GetTextLineHeightWithSpacing() * 8));
|
||||
if (ImGuiExt::InputTextIcon("##Search", ICON_VS_FILTER, m_filterText)) {
|
||||
m_filter = parseRValueFilter(m_filterText).value_or(Filter{ });
|
||||
updateFilter();
|
||||
|
Loading…
x
Reference in New Issue
Block a user