Make search fields behave more consistently

pull/558/head
Capostrophic 5 years ago
parent 8442446080
commit 4b17d5da43

@ -48,6 +48,9 @@ CompanionWindow::CompanionWindow(DragAndDrop *dragAndDrop, MessageBoxManager* ma
getWidget(mEncumbranceBar, "EncumbranceBar");
getWidget(mFilterEdit, "FilterEdit");
getWidget(mItemView, "ItemView");
mFilterEdit->setUserString("AcceptTab", "true");
mItemView->eventBackgroundClicked += MyGUI::newDelegate(this, &CompanionWindow::onBackgroundSelected);
mItemView->eventItemClicked += MyGUI::newDelegate(this, &CompanionWindow::onItemSelected);
mFilterEdit->eventEditTextChange += MyGUI::newDelegate(this, &CompanionWindow::onNameFilterChanged);
@ -121,6 +124,7 @@ void CompanionWindow::setPtr(const MWWorld::Ptr& npc)
mModel = new CompanionItemModel(npc);
mSortModel = new SortFilterItemModel(mModel);
mFilterEdit->setCaption(std::string());
mItemView->setModel(mSortModel);
mItemView->resetScrollBars();

@ -91,6 +91,8 @@ namespace MWGui
getWidget(mArmorRating, "ArmorRating");
getWidget(mFilterEdit, "FilterEdit");
mFilterEdit->setUserString("AcceptTab", "true");
mAvatarImage->eventMouseButtonClick += MyGUI::newDelegate(this, &InventoryWindow::onAvatarClicked);
mAvatarImage->setRenderItemTexture(mPreviewTexture.get());
mAvatarImage->getSubWidgetMain()->_setUVSet(MyGUI::FloatRect(0.f, 0.f, 1.f, 1.f));
@ -134,6 +136,8 @@ namespace MWGui
else
mSortModel = new SortFilterItemModel(mTradeModel);
mSortModel->setNameFilter(mFilterEdit->getCaption());
mItemView->setModel(mSortModel);
mFilterAll->setStateSelected(true);

@ -16,9 +16,6 @@ namespace MWGui
bool shouldAcceptKeyFocus(MyGUI::Widget* w)
{
if (w && w->getUserString("IgnoreTabKey") == "y")
return false;
return w && !w->castType<MyGUI::Window>(false) && w->getInheritedEnabled() && w->getInheritedVisible() && w->getVisible() && w->getEnabled();
}

@ -45,7 +45,7 @@ namespace MWGui
getWidget(mEffectBox, "EffectsBox");
getWidget(mFilterEdit, "FilterEdit");
mFilterEdit->setUserString("IgnoreTabKey", "y");
mFilterEdit->setUserString("AcceptTab", "true");
mSpellView->eventSpellClicked += MyGUI::newDelegate(this, &SpellWindow::onModelIndexSelected);
mFilterEdit->eventEditTextChange += MyGUI::newDelegate(this, &SpellWindow::onFilterChanged);

@ -71,6 +71,8 @@ namespace MWGui
getWidget(mBottomPane, "BottomPane");
getWidget(mFilterEdit, "FilterEdit");
mFilterEdit->setUserString("AcceptTab", "true");
getWidget(mItemView, "ItemView");
mItemView->eventItemClicked += MyGUI::newDelegate(this, &TradeWindow::onItemSelected);

Loading…
Cancel
Save