mirror of
https://github.com/WarmUpTill/SceneSwitcher.git
synced 2026-08-15 22:04:17 -05:00
Focus name edit for new items
This commit is contained in:
@@ -4,9 +4,11 @@
|
||||
#include "ui-helpers.hpp"
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
#include <QAction>
|
||||
#include <QMenu>
|
||||
#include <QLayout>
|
||||
#include <QMenu>
|
||||
#include <QTimer>
|
||||
|
||||
Q_DECLARE_METATYPE(advss::Item *);
|
||||
|
||||
@@ -330,6 +332,13 @@ void ItemSettingsDialog::NameChanged(const QString &text)
|
||||
SetNameWarning("");
|
||||
}
|
||||
|
||||
void ItemSettingsDialog::showEvent(QShowEvent *)
|
||||
{
|
||||
if (_showNameEmptyWarning && _name->text().isEmpty()) {
|
||||
_name->setFocus(Qt::OtherFocusReason);
|
||||
}
|
||||
}
|
||||
|
||||
void ItemSettingsDialog::SetNameWarning(const QString warn)
|
||||
{
|
||||
if (warn.isEmpty()) {
|
||||
|
||||
Reference in New Issue
Block a user