mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-16 19:19:56 +00:00
focus main input widget when bringing up creator bar (Fixes #2514)
This commit is contained in:
parent
0bf28a6eab
commit
d873c2c603
8 changed files with 30 additions and 1 deletions
|
@ -40,6 +40,9 @@ namespace CSVWorld
|
|||
/// Default implementation: Throw an exception if scope!=Scope_Content.
|
||||
virtual void setScope (unsigned int scope);
|
||||
|
||||
/// Focus main input widget
|
||||
virtual void focus() = 0;
|
||||
|
||||
signals:
|
||||
|
||||
void done();
|
||||
|
|
|
@ -225,6 +225,11 @@ void CSVWorld::GenericCreator::toggleWidgets(bool active)
|
|||
{
|
||||
}
|
||||
|
||||
void CSVWorld::GenericCreator::focus()
|
||||
{
|
||||
mId->setFocus();
|
||||
}
|
||||
|
||||
void CSVWorld::GenericCreator::setScope (unsigned int scope)
|
||||
{
|
||||
mScopes = scope;
|
||||
|
|
|
@ -101,6 +101,9 @@ namespace CSVWorld
|
|||
|
||||
virtual void setScope (unsigned int scope);
|
||||
|
||||
/// Focus main input widget
|
||||
virtual void focus();
|
||||
|
||||
private slots:
|
||||
|
||||
void textChanged (const QString& text);
|
||||
|
|
|
@ -91,6 +91,11 @@ std::string CSVWorld::InfoCreator::getErrors() const
|
|||
return errors;
|
||||
}
|
||||
|
||||
void CSVWorld::InfoCreator::focus()
|
||||
{
|
||||
mTopic->setFocus();
|
||||
}
|
||||
|
||||
void CSVWorld::InfoCreator::topicChanged()
|
||||
{
|
||||
update();
|
||||
|
|
|
@ -35,7 +35,10 @@ namespace CSVWorld
|
|||
virtual std::string getErrors() const;
|
||||
///< Return formatted error descriptions for the current state of the creator. if an empty
|
||||
/// string is returned, there is no error.
|
||||
|
||||
|
||||
/// Focus main input widget
|
||||
virtual void focus();
|
||||
|
||||
private slots:
|
||||
|
||||
void topicChanged();
|
||||
|
|
|
@ -118,6 +118,11 @@ std::string CSVWorld::ReferenceCreator::getErrors() const
|
|||
return errors;
|
||||
}
|
||||
|
||||
void CSVWorld::ReferenceCreator::focus()
|
||||
{
|
||||
mCell->setFocus();
|
||||
}
|
||||
|
||||
void CSVWorld::ReferenceCreator::cellChanged()
|
||||
{
|
||||
update();
|
||||
|
|
|
@ -39,6 +39,9 @@ namespace CSVWorld
|
|||
///< Return formatted error descriptions for the current state of the creator. if an empty
|
||||
/// string is returned, there is no error.
|
||||
|
||||
/// Focus main input widget
|
||||
virtual void focus();
|
||||
|
||||
private slots:
|
||||
|
||||
void cellChanged();
|
||||
|
|
|
@ -157,6 +157,7 @@ void CSVWorld::TableBottomBox::createRequest()
|
|||
mLayout->setCurrentWidget (mCreator);
|
||||
setVisible (true);
|
||||
mCreating = true;
|
||||
mCreator->focus();
|
||||
}
|
||||
|
||||
void CSVWorld::TableBottomBox::cloneRequest(const std::string& id,
|
||||
|
@ -168,4 +169,5 @@ void CSVWorld::TableBottomBox::cloneRequest(const std::string& id,
|
|||
mCreator->toggleWidgets(false);
|
||||
setVisible (true);
|
||||
mCreating = true;
|
||||
mCreator->focus();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue