UI: Change preview handles/outline and add hover

This commit is contained in:
VodBox
2019-02-08 20:58:40 +13:00
parent f095cb2d0e
commit 6c880fb3c8
4 changed files with 159 additions and 35 deletions
+12
View File
@@ -35,6 +35,7 @@ SourceTreeItem::SourceTreeItem(SourceTree *tree_, OBSSceneItem sceneitem_)
sceneitem (sceneitem_)
{
setAttribute(Qt::WA_TranslucentBackground);
setMouseTracking(true);
obs_source_t *source = obs_sceneitem_get_source(sceneitem);
const char *name = obs_source_get_name(source);
@@ -911,6 +912,8 @@ SourceTree::SourceTree(QWidget *parent_) : QListView(parent_)
"*[bgColor=\"6\"]{background-color:rgba(255,68,255,33%);}" \
"*[bgColor=\"7\"]{background-color:rgba(68,68,68,33%);}" \
"*[bgColor=\"8\"]{background-color:rgba(255,255,255,33%);}"));
setMouseTracking(true);
}
void SourceTree::ResetWidgets()
@@ -1264,6 +1267,15 @@ void SourceTree::dropEvent(QDropEvent *event)
QListView::dropEvent(event);
}
void SourceTree::mouseMoveEvent(QMouseEvent *event)
{
QPoint pos = event->pos();
SourceTreeItem *item = qobject_cast<SourceTreeItem *>
(childAt(pos));
currentHover = item;
}
void SourceTree::selectionChanged(
const QItemSelection &selected,
const QItemSelection &deselected)