mirror of
https://github.com/obsproject/obs-studio.git
synced 2024-07-19 17:49:14 +00:00
Merge pull request #2954 from cg2121/property-list-reorder
UI: Allow drag & drop reorder of property lists
This commit is contained in:
commit
d027c41165
|
@ -594,6 +594,13 @@ void OBSPropertiesView::AddEditableList(obs_property_t *prop,
|
|||
|
||||
WidgetInfo *info = new WidgetInfo(this, prop, list);
|
||||
|
||||
list->setDragDropMode(QAbstractItemView::InternalMove);
|
||||
connect(list->model(),
|
||||
SIGNAL(rowsMoved(QModelIndex, int, int, QModelIndex, int)),
|
||||
info,
|
||||
SLOT(EditListReordered(const QModelIndex &, int, int,
|
||||
const QModelIndex &, int)));
|
||||
|
||||
QVBoxLayout *sideLayout = new QVBoxLayout();
|
||||
NewButton(sideLayout, info, "addIconSmall", &WidgetInfo::EditListAdd);
|
||||
NewButton(sideLayout, info, "removeIconSmall",
|
||||
|
@ -1774,6 +1781,19 @@ void WidgetInfo::GroupChanged(const char *setting)
|
|||
: true);
|
||||
}
|
||||
|
||||
void WidgetInfo::EditListReordered(const QModelIndex &parent, int start,
|
||||
int end, const QModelIndex &destination,
|
||||
int row)
|
||||
{
|
||||
UNUSED_PARAMETER(parent);
|
||||
UNUSED_PARAMETER(start);
|
||||
UNUSED_PARAMETER(end);
|
||||
UNUSED_PARAMETER(destination);
|
||||
UNUSED_PARAMETER(row);
|
||||
|
||||
EditableListChanged();
|
||||
}
|
||||
|
||||
void WidgetInfo::EditableListChanged()
|
||||
{
|
||||
const char *setting = obs_property_name(property);
|
||||
|
|
|
@ -58,6 +58,8 @@ public slots:
|
|||
void EditListEdit();
|
||||
void EditListUp();
|
||||
void EditListDown();
|
||||
void EditListReordered(const QModelIndex &parent, int start, int end,
|
||||
const QModelIndex &destination, int row);
|
||||
};
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
|
Loading…
Reference in a new issue