mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-02-21 00:39:58 +00:00
Make search fields behave more consistently
This commit is contained in:
parent
8442446080
commit
4b17d5da43
@ -48,6 +48,9 @@ CompanionWindow::CompanionWindow(DragAndDrop *dragAndDrop, MessageBoxManager* ma
|
|||||||
getWidget(mEncumbranceBar, "EncumbranceBar");
|
getWidget(mEncumbranceBar, "EncumbranceBar");
|
||||||
getWidget(mFilterEdit, "FilterEdit");
|
getWidget(mFilterEdit, "FilterEdit");
|
||||||
getWidget(mItemView, "ItemView");
|
getWidget(mItemView, "ItemView");
|
||||||
|
|
||||||
|
mFilterEdit->setUserString("AcceptTab", "true");
|
||||||
|
|
||||||
mItemView->eventBackgroundClicked += MyGUI::newDelegate(this, &CompanionWindow::onBackgroundSelected);
|
mItemView->eventBackgroundClicked += MyGUI::newDelegate(this, &CompanionWindow::onBackgroundSelected);
|
||||||
mItemView->eventItemClicked += MyGUI::newDelegate(this, &CompanionWindow::onItemSelected);
|
mItemView->eventItemClicked += MyGUI::newDelegate(this, &CompanionWindow::onItemSelected);
|
||||||
mFilterEdit->eventEditTextChange += MyGUI::newDelegate(this, &CompanionWindow::onNameFilterChanged);
|
mFilterEdit->eventEditTextChange += MyGUI::newDelegate(this, &CompanionWindow::onNameFilterChanged);
|
||||||
@ -121,6 +124,7 @@ void CompanionWindow::setPtr(const MWWorld::Ptr& npc)
|
|||||||
|
|
||||||
mModel = new CompanionItemModel(npc);
|
mModel = new CompanionItemModel(npc);
|
||||||
mSortModel = new SortFilterItemModel(mModel);
|
mSortModel = new SortFilterItemModel(mModel);
|
||||||
|
mFilterEdit->setCaption(std::string());
|
||||||
mItemView->setModel(mSortModel);
|
mItemView->setModel(mSortModel);
|
||||||
mItemView->resetScrollBars();
|
mItemView->resetScrollBars();
|
||||||
|
|
||||||
|
@ -91,6 +91,8 @@ namespace MWGui
|
|||||||
getWidget(mArmorRating, "ArmorRating");
|
getWidget(mArmorRating, "ArmorRating");
|
||||||
getWidget(mFilterEdit, "FilterEdit");
|
getWidget(mFilterEdit, "FilterEdit");
|
||||||
|
|
||||||
|
mFilterEdit->setUserString("AcceptTab", "true");
|
||||||
|
|
||||||
mAvatarImage->eventMouseButtonClick += MyGUI::newDelegate(this, &InventoryWindow::onAvatarClicked);
|
mAvatarImage->eventMouseButtonClick += MyGUI::newDelegate(this, &InventoryWindow::onAvatarClicked);
|
||||||
mAvatarImage->setRenderItemTexture(mPreviewTexture.get());
|
mAvatarImage->setRenderItemTexture(mPreviewTexture.get());
|
||||||
mAvatarImage->getSubWidgetMain()->_setUVSet(MyGUI::FloatRect(0.f, 0.f, 1.f, 1.f));
|
mAvatarImage->getSubWidgetMain()->_setUVSet(MyGUI::FloatRect(0.f, 0.f, 1.f, 1.f));
|
||||||
@ -134,6 +136,8 @@ namespace MWGui
|
|||||||
else
|
else
|
||||||
mSortModel = new SortFilterItemModel(mTradeModel);
|
mSortModel = new SortFilterItemModel(mTradeModel);
|
||||||
|
|
||||||
|
mSortModel->setNameFilter(mFilterEdit->getCaption());
|
||||||
|
|
||||||
mItemView->setModel(mSortModel);
|
mItemView->setModel(mSortModel);
|
||||||
|
|
||||||
mFilterAll->setStateSelected(true);
|
mFilterAll->setStateSelected(true);
|
||||||
|
@ -16,9 +16,6 @@ namespace MWGui
|
|||||||
|
|
||||||
bool shouldAcceptKeyFocus(MyGUI::Widget* w)
|
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();
|
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(mEffectBox, "EffectsBox");
|
||||||
getWidget(mFilterEdit, "FilterEdit");
|
getWidget(mFilterEdit, "FilterEdit");
|
||||||
|
|
||||||
mFilterEdit->setUserString("IgnoreTabKey", "y");
|
mFilterEdit->setUserString("AcceptTab", "true");
|
||||||
|
|
||||||
mSpellView->eventSpellClicked += MyGUI::newDelegate(this, &SpellWindow::onModelIndexSelected);
|
mSpellView->eventSpellClicked += MyGUI::newDelegate(this, &SpellWindow::onModelIndexSelected);
|
||||||
mFilterEdit->eventEditTextChange += MyGUI::newDelegate(this, &SpellWindow::onFilterChanged);
|
mFilterEdit->eventEditTextChange += MyGUI::newDelegate(this, &SpellWindow::onFilterChanged);
|
||||||
|
@ -71,6 +71,8 @@ namespace MWGui
|
|||||||
getWidget(mBottomPane, "BottomPane");
|
getWidget(mBottomPane, "BottomPane");
|
||||||
getWidget(mFilterEdit, "FilterEdit");
|
getWidget(mFilterEdit, "FilterEdit");
|
||||||
|
|
||||||
|
mFilterEdit->setUserString("AcceptTab", "true");
|
||||||
|
|
||||||
getWidget(mItemView, "ItemView");
|
getWidget(mItemView, "ItemView");
|
||||||
mItemView->eventItemClicked += MyGUI::newDelegate(this, &TradeWindow::onItemSelected);
|
mItemView->eventItemClicked += MyGUI::newDelegate(this, &TradeWindow::onItemSelected);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user