UI: Add text autoselect on scene rename

This commit is contained in:
Anthony Torres 2019-04-07 03:34:21 -04:00 • committed by jp9000
commit bd71839259
2 changed files with 26 additions and 0 deletions

View file

@ -258,6 +258,8 @@ OBSBasic::OBSBasic(QWidget *parent)
ui->scenes->setAttribute(Qt::WA_MacShowFocusRect, false);
ui->sources->setAttribute(Qt::WA_MacShowFocusRect, false);
ui->scenes->setItemDelegate(new SceneRenameDelegate(ui->scenes));
auto displayResize = [this]() {
struct obs_video_info ovi;
@ -7178,3 +7180,17 @@ bool OBSBasic::ReplayBufferActive()
return false;
return outputHandler->ReplayBufferActive();
}
SceneRenameDelegate::SceneRenameDelegate(QObject *parent)
: QStyledItemDelegate(parent)
{
}
void SceneRenameDelegate::setEditorData(QWidget *editor,
const QModelIndex &index) const
{
QStyledItemDelegate::setEditorData(editor, index);
QLineEdit *lineEdit = qobject_cast<QLineEdit*>(editor);
if (lineEdit)
lineEdit->selectAll();
}