summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndras Mantia <andras@kdab.com>2017-12-21 18:46:24 +0200
committerMiikka Heikkinen <miikka.heikkinen@qt.io>2018-01-15 10:54:39 +0000
commit33bf9b791c47a493fc2c27ee750aedb39e969bd8 (patch)
treea2e7f397012c173bf2de0a88430a2aa2da09954e
parent5be9b29f0c8ddc11b6c58b18c37cbf7ee66dcea4 (diff)
Add shy/visibility/lock toggle buttons
Change-Id: I3a4e29d0faf9fac96249e0ad20e0c82274cd439f Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
-rw-r--r--src/Authoring/Client/Code/Core/Utility/StudioPreferences.cpp1
-rw-r--r--src/Authoring/Studio/Palettes/Inspector/ObjectListModel.cpp5
-rw-r--r--src/Authoring/Studio/Palettes/Inspector/ObjectListModel.h3
-rw-r--r--src/Authoring/Studio/Palettes/Timeline/Timeline.qml109
-rw-r--r--src/Authoring/Studio/Palettes/Timeline/TimelineObjectModel.cpp129
-rw-r--r--src/Authoring/Studio/Palettes/Timeline/TimelineObjectModel.h22
-rw-r--r--src/Authoring/Studio/Palettes/Timeline/TimelineTreeDelegate.qml168
-rw-r--r--src/Authoring/Studio/Palettes/Timeline/TimelineView.cpp48
-rw-r--r--src/Authoring/Studio/Palettes/Timeline/TimelineView.h12
-rw-r--r--src/Authoring/Studio/Palettes/controls/StyledToggleButton.qml50
-rw-r--r--src/Authoring/Studio/qml.qrc2
11 files changed, 482 insertions, 67 deletions
diff --git a/src/Authoring/Client/Code/Core/Utility/StudioPreferences.cpp b/src/Authoring/Client/Code/Core/Utility/StudioPreferences.cpp
index c0105760..9d2bc13b 100644
--- a/src/Authoring/Client/Code/Core/Utility/StudioPreferences.cpp
+++ b/src/Authoring/Client/Code/Core/Utility/StudioPreferences.cpp
@@ -1669,6 +1669,7 @@ void CStudioPreferences::setQmlContextProperties(QQmlContext *qml)
qml->setContextProperty(QStringLiteral("_studioColor2"), s_studioColor2);
qml->setContextProperty(QStringLiteral("_studioColor3"), s_studioColor3);
qml->setContextProperty(QStringLiteral("_backgroundColor"), s_backgroundColor);
+ qml->setContextProperty(QStringLiteral("_buttonDownColor"), s_ButtonDownColor.getQColor());
qml->setContextProperty(QStringLiteral("_guideColor"), s_guideColor);
qml->setContextProperty(QStringLiteral("_selectionColor"), s_selectionColor);
qml->setContextProperty(QStringLiteral("_textColor"), s_textColor);
diff --git a/src/Authoring/Studio/Palettes/Inspector/ObjectListModel.cpp b/src/Authoring/Studio/Palettes/Inspector/ObjectListModel.cpp
index dee44368..cf287678 100644
--- a/src/Authoring/Studio/Palettes/Inspector/ObjectListModel.cpp
+++ b/src/Authoring/Studio/Palettes/Inspector/ObjectListModel.cpp
@@ -405,6 +405,11 @@ void FlatObjectListModel::setSourceModel(ObjectListModel *sourceModel)
m_sourceInfo = collectSourceIndexes({}, 0);
endResetModel();
});
+
+ connect(sourceModel, &ObjectListModel::roleUpdated, this, [this](int role) {
+ emit dataChanged(index(0,0), index(rowCount() - 1, 0), {role});
+ });
+
m_sourceModel = sourceModel;
m_sourceInfo = collectSourceIndexes({}, 0);
endResetModel();
diff --git a/src/Authoring/Studio/Palettes/Inspector/ObjectListModel.h b/src/Authoring/Studio/Palettes/Inspector/ObjectListModel.h
index 840c089c..af08dadf 100644
--- a/src/Authoring/Studio/Palettes/Inspector/ObjectListModel.h
+++ b/src/Authoring/Studio/Palettes/Inspector/ObjectListModel.h
@@ -71,6 +71,9 @@ public:
void excludeObjectTypes(const QVector<EStudioObjectType> &types);
+Q_SIGNALS:
+ void roleUpdated(int role);
+
protected:
qt3dsdm::Qt3DSDMInstanceHandle handleForIndex(const QModelIndex &index) const;
diff --git a/src/Authoring/Studio/Palettes/Timeline/Timeline.qml b/src/Authoring/Studio/Palettes/Timeline/Timeline.qml
index 4dfb0b78..ba2a2da8 100644
--- a/src/Authoring/Studio/Palettes/Timeline/Timeline.qml
+++ b/src/Authoring/Studio/Palettes/Timeline/Timeline.qml
@@ -57,11 +57,53 @@ Rectangle {
Layout.maximumWidth: root.splitterPos
Layout.preferredWidth: root.width
- Rectangle {
+ Item {
Layout.fillWidth: true
Layout.preferredWidth: parent.width
Layout.preferredHeight: itemHeight
- color: "transparent"
+
+ Row {
+ anchors.right: parent.right
+ StyledToggleButton {
+ width: 20
+ height: 20
+
+ enabledImage: "Toggle-Shy.png"
+ checkedImage: "Toggle-Shy.png"
+ toolTipText: checked ? qsTr("Show shy objects")
+ : qsTr("Hide shy objects")
+
+ checked: _timelineView.hideShy
+ onClicked: _timelineView.hideShy = checked
+ }
+
+ StyledToggleButton {
+ width: 20
+ height: 20
+
+ enabledImage: "filter-toggle-eye-up.png"
+ checkedImage: "filter-toggle-eye-down.png"
+ toolTipText: checked ? qsTr("Show inactive objects")
+ : qsTr("Hide inactive objects")
+
+ checked: _timelineView.hideHidden
+ onClicked: _timelineView.hideHidden = checked
+ }
+
+ StyledToggleButton {
+ width: 20
+ height: 20
+
+ checkedImage: "Toggle-Lock.png"
+ enabledImage: "Toggle-Lock.png"
+ toolTipText: checked ? qsTr("Show locked objects")
+ : qsTr("Hide locked objects")
+
+ checked: _timelineView.hideLocked
+ onClicked: _timelineView.hideLocked = checked
+ }
+ }
+
}
ListView {
@@ -80,14 +122,12 @@ Rectangle {
clip: true
currentIndex: _timelineView.selection
- delegate: Rectangle {
+ delegate: TimelineTreeDelegate {
id: delegateItem
+ splitterPos: root.splitterPos
width: parent.width
- height: model.parentExpanded ? itemHeight : 0
-
- color: model.selected ? _selectionColor : _studioColor2
- border.color: _backgroundColor
+ height: model.parentExpanded && model.visible ? itemHeight : 0
visible: height > 0
@@ -97,59 +137,6 @@ Rectangle {
easing.type: Easing.OutQuad
}
}
-
-
- MouseArea {
- id: delegateArea
-
- anchors.fill: parent
- onClicked: _timelineView.select(model.index, mouse.modifiers)
- }
-
- Row {
- id: row
-
- x: model.depth * 20
- anchors.verticalCenter: parent.verticalCenter
- height: itemHeight
- width: splitterPos - x
- spacing: 5
-
- Image {
- source: {
- if (!model.hasChildren)
- return "";
- model.expanded ? _resDir + "arrow_down.png"
- : _resDir + "arrow.png";
- }
-
- MouseArea {
- anchors.fill: parent
- onClicked: model.expanded = !model.expanded
- }
- }
-
- Item {
- height: itemHeight
- width: typeIcon.width + name.width + 10
-
- Row {
- spacing: 10
- Image {
- id: typeIcon
-
- source: model.icon
- }
-
- StyledLabel {
- id: name
- anchors.verticalCenter: typeIcon.verticalCenter
- color: model.textColor
- text: model.name
- }
- }
- }
- }
}
onCurrentIndexChanged: _timelineView.selection = currentIndex
@@ -210,7 +197,7 @@ Rectangle {
id: timelineItemsDelegateItem
width: parent.width
- height: model.parentExpanded ? itemHeight : 0
+ height: model.parentExpanded && model.visible ? itemHeight : 0
color: model.selected ? _selectionColor : "#404244"
border.color: _backgroundColor
diff --git a/src/Authoring/Studio/Palettes/Timeline/TimelineObjectModel.cpp b/src/Authoring/Studio/Palettes/Timeline/TimelineObjectModel.cpp
index 06bcd9de..fb017a10 100644
--- a/src/Authoring/Studio/Palettes/Timeline/TimelineObjectModel.cpp
+++ b/src/Authoring/Studio/Palettes/Timeline/TimelineObjectModel.cpp
@@ -63,7 +63,11 @@ QHash<int, QByteArray> TimelineObjectModel::roleNames() const
names.insert(ItemColorRole, "itemColor");
names.insert(TimeInfoRole, "timeInfo");
names.insert(KeyframesRole, "keyframes");
-
+ names.insert(ShyRowRole, "shy");
+ names.insert(VisibleRowRole, "rowVisible");
+ names.insert(LockedRowRole, "locked");
+ names.insert(IsPropertyRole, "isProperty");
+ names.insert(VisibleRole, "visible");
return names;
}
@@ -84,6 +88,8 @@ QVariant TimelineObjectModel::data(const QModelIndex &index, int role) const
}
auto timelineItemBinding = timelineRow->GetTimelineItemBinding();
+ auto timelineItem = timelineItemBinding->GetTimelineItem();
+
switch (role) {
case TimelineRowRole: {
return QVariant::fromValue(timelineRow);
@@ -92,19 +98,19 @@ QVariant TimelineObjectModel::data(const QModelIndex &index, int role) const
return timelineRow->IsSelected();
}
case ItemColorRole: {
- auto timebar = timelineItemBinding->GetTimelineItem()->GetTimebar();
+ auto timebar = timelineItem->GetTimebar();
auto color = timebar->GetTimebarColor().getQColor();
return color.name();
}
case SelectedColorRole: {
- auto timebar = timelineItemBinding->GetTimelineItem()->GetTimebar();
+ auto timebar = timelineItem->GetTimebar();
auto color = CColorControl::CalculateSelectedColor(timebar->GetTimebarColor()).getQColor();
return color.name();
}
case TimeInfoRole: {
- auto timebar = timelineItemBinding->GetTimelineItem()->GetTimebar();
+ auto timebar = timelineItem->GetTimebar();
const auto startTime = timebar->GetStartTime();
const auto endTime = timebar->GetEndTime();
@@ -132,12 +138,69 @@ QVariant TimelineObjectModel::data(const QModelIndex &index, int role) const
return keyframes;
}
+ case ShyRowRole: {
+ return timelineItem->IsShy();
+ }
+
+ case VisibleRowRole: {
+ return timelineItem->IsVisible();
+ }
+
+ case LockedRowRole: {
+ return timelineItem->IsLocked();
+ }
+
+ case VisibleRole: {
+ return isVisible(index);
+ }
+
+ case IsPropertyRole: {
+ return false;
+ }
+
default: ;
}
return ObjectListModel::data(index, role);
}
+bool TimelineObjectModel::setData(const QModelIndex &index, const QVariant &value, int role)
+{
+ if (!hasIndex(index.row(), index.column(), index.parent()))
+ return false;
+
+ auto timelineRow = const_cast<TimelineObjectModel*>(this)->timelineRowForIndex(index);
+
+ if (!timelineRow)
+ return false;
+
+ auto propertyRow = dynamic_cast<CPropertyRow *>(timelineRow);
+ if (propertyRow)
+ return false;
+
+ auto timelineItemBinding = timelineRow->GetTimelineItemBinding();
+ auto timelineItem = timelineItemBinding->GetTimelineItem();
+
+ QVariant result;
+ switch (role) {
+ case ShyRowRole:
+ timelineItem->SetShy(value.toBool());
+ break;
+ case VisibleRowRole:
+ timelineItem->SetVisible(value.toBool());
+ break;
+ case LockedRowRole:
+ timelineItem->SetLocked(value.toBool());
+ break;
+ }
+ if (!result.isValid())
+ return ObjectListModel::setData(index, value, role);
+
+ emit dataChanged(index, index, {role});
+
+ return true;
+}
+
QVariant TimelineObjectModel::dataForProperty(CPropertyRow *propertyRow, const QModelIndex &index, int role) const
{
auto timelineItemProperty = propertyRow->GetProperty();
@@ -194,6 +257,15 @@ QVariant TimelineObjectModel::dataForProperty(CPropertyRow *propertyRow, const Q
case AbsolutePathRole:
return {};
+
+ case IsPropertyRole: {
+ return true;
+ }
+
+ case VisibleRole: {
+ return isVisible(index);
+ }
+
default: ;
}
@@ -291,7 +363,10 @@ void TimelineObjectModel::addProperty(qt3dsdm::Qt3DSDMInstanceHandle parentInsta
qt3dsdm::Qt3DSDMPropertyHandle property)
{
auto parentIndex = indexForHandle(parentInstance);
- auto propertyCount = m_properties.value(parentInstance.GetHandleValue(), {}).count();
+ auto properties = m_properties.value(parentInstance.GetHandleValue(), {});
+ if (properties.contains(property))
+ return;
+ auto propertyCount = properties.count();
// Now we rely on rowCount calling childrenList, thus getting the new rows automatically
beginInsertRows(parentIndex, propertyCount, propertyCount);
@@ -310,6 +385,24 @@ void TimelineObjectModel::removeProperty(qt3dsdm::Qt3DSDMInstanceHandle parentIn
endRemoveRows();
}
+void TimelineObjectModel::setHideShy(bool enabled)
+{
+ m_hideShy = enabled;
+ Q_EMIT roleUpdated(VisibleRole);
+}
+
+void TimelineObjectModel::setHideHidden(bool enabled)
+{
+ m_hideHidden = enabled;
+ Q_EMIT roleUpdated(VisibleRole);
+}
+
+void TimelineObjectModel::setHideLocked(bool enabled)
+{
+ m_hideLocked = enabled;
+ Q_EMIT roleUpdated(VisibleRole);
+}
+
qt3dsdm::TInstanceHandleList TimelineObjectModel::childrenList(const qt3dsdm::Qt3DSDMSlideHandle &slideHandle, const qt3dsdm::Qt3DSDMInstanceHandle &handle) const
{
auto studioSystem = m_core->GetDoc()->GetStudioSystem();
@@ -349,3 +442,29 @@ void TimelineObjectModel::appendKey(QVariantList &keyframes, IKeyframe *key, dou
keyframes.append(QVariant::fromValue(keyInfo));
}
+
+bool TimelineObjectModel::isVisible(const QModelIndex &index) const
+{
+ auto idx = index;
+ while (idx.isValid()) {
+ auto row = const_cast<TimelineObjectModel*>(this)->timelineRowForIndex(idx);
+
+ if (!row)
+ return false;
+
+ auto binding = row->GetTimelineItemBinding();
+ if (binding) {
+ auto item = binding->GetTimelineItem();
+
+ auto hidden = (m_hideShy && item->IsShy()) ||
+ (m_hideHidden && !item->IsVisible()) ||
+ (m_hideLocked && item->IsLocked());
+
+ if (hidden)
+ return false;
+ }
+ idx = idx.parent();
+ }
+
+ return true;
+}
diff --git a/src/Authoring/Studio/Palettes/Timeline/TimelineObjectModel.h b/src/Authoring/Studio/Palettes/Timeline/TimelineObjectModel.h
index 32c5d698..ac417de2 100644
--- a/src/Authoring/Studio/Palettes/Timeline/TimelineObjectModel.h
+++ b/src/Authoring/Studio/Palettes/Timeline/TimelineObjectModel.h
@@ -84,10 +84,17 @@ public:
SelectedColorRole,
SelectedRole,
TimeInfoRole,
- KeyframesRole
+ KeyframesRole,
+ ShyRowRole,
+ VisibleRowRole,
+ LockedRowRole,
+ IsPropertyRole,
+ VisibleRole
+
};
QHash<int, QByteArray> roleNames() const override;
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
+ bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole) override;
QVariant dataForProperty(CPropertyRow *propertyRow, const QModelIndex &index,
int role = Qt::DisplayRole) const;
QModelIndex parent(const QModelIndex &index) const override;
@@ -101,6 +108,14 @@ public:
void removeProperty(qt3dsdm::Qt3DSDMInstanceHandle parentInstance,
qt3dsdm::Qt3DSDMPropertyHandle property);
+ void setHideShy(bool enabled);
+ bool hideShy() const { return m_hideShy; }
+ void setHideHidden(bool enabled);
+ bool hideHidden() const { return m_hideHidden; }
+ void setHideLocked(bool enabled);
+ bool hideLocked() const { return m_hideLocked; }
+
+
protected:
qt3dsdm::TInstanceHandleList childrenList(const qt3dsdm::Qt3DSDMSlideHandle &slideHandle,
const qt3dsdm::Qt3DSDMInstanceHandle &handle) const override;
@@ -109,11 +124,16 @@ protected:
private:
void appendKey(QVariantList &keyframes, IKeyframe *key, double timeRatio) const;
+ bool isVisible(const QModelIndex &index) const;
QSharedPointer<CSlideRow> m_slideRow;
ITimelineItemBinding *m_timelineItemBinding = nullptr;
QHash<int, CTimelineRow* > m_rows;
mutable QHash<int, QVector<qt3dsdm::Qt3DSDMInstanceHandle> > m_properties;
+
+ bool m_hideShy = false;
+ bool m_hideHidden = false;
+ bool m_hideLocked = true;
};
Q_DECLARE_METATYPE(CTimelineRow *);
diff --git a/src/Authoring/Studio/Palettes/Timeline/TimelineTreeDelegate.qml b/src/Authoring/Studio/Palettes/Timeline/TimelineTreeDelegate.qml
new file mode 100644
index 00000000..cf6b2c56
--- /dev/null
+++ b/src/Authoring/Studio/Palettes/Timeline/TimelineTreeDelegate.qml
@@ -0,0 +1,168 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of Qt 3D Studio.
+**
+** $QT_BEGIN_LICENSE:GPL-EXCEPT$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3 as published by the Free Software
+** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.8
+import QtQuick.Controls 2.2
+import QtQuick.Layouts 1.3
+import Qt3DStudio 1.0
+import "../controls"
+
+Item {
+ id: root
+
+ property real splitterPos: 0
+
+ Row {
+ id: delegateRow
+
+ anchors.fill: parent
+ spacing: 2
+
+ Rectangle {
+ id: itemDescription
+
+ width: root.width - buttons.width - delegateRow.spacing
+ height: root.height
+
+ color: model.selected ? _selectionColor :
+ model.isProperty ? _backgroundColor : _studioColor2
+ border.color: _backgroundColor
+
+ MouseArea {
+ id: delegateArea
+
+ anchors.fill: parent
+ onClicked: _timelineView.select(model.index, mouse.modifiers)
+ }
+
+ Row {
+ id: row
+
+ x: model.depth * 20
+ anchors.verticalCenter: parent.verticalCenter
+ height: root.height
+ width: splitterPos - x
+ spacing: 5
+
+ Image {
+ source: {
+ if (!model.hasChildren)
+ return "";
+ model.expanded ? _resDir + "arrow_down.png"
+ : _resDir + "arrow.png";
+ }
+
+ MouseArea {
+ anchors.fill: parent
+ onClicked: model.expanded = !model.expanded
+ }
+ }
+
+ Item {
+ height: root.height
+ width: typeIcon.width + name.width + 10
+
+ Row {
+ spacing: 10
+ Image {
+ id: typeIcon
+
+ source: model.icon
+ }
+
+ StyledLabel {
+ id: name
+ anchors.verticalCenter: typeIcon.verticalCenter
+ color: model.textColor
+ text: model.name
+ }
+ }
+ }
+ }
+ }
+
+ Loader {
+ id: buttons
+
+ active: !model.isProperty
+
+ sourceComponent: buttonsComponent
+ }
+
+ Component {
+ id: buttonsComponent
+
+
+ Row {
+ id: buttonsRow
+
+ Layout.alignment: Qt.AlignRight
+
+ StyledToggleButton {
+ width: 20
+ height: 20
+ checked: model.shy
+
+ backgroundColor: itemDescription.color
+ downColor: backgroundColor
+ enabledImage: "Toggle-Empty.png"
+ checkedImage: "Toggle-Shy.png"
+
+ onClicked: model.shy = checked
+ }
+
+ StyledToggleButton {
+ width: 20
+ height: 20
+ checked: model.rowVisible
+
+ backgroundColor: itemDescription.color
+ downColor: backgroundColor
+ enabledImage: "Toggle-Empty.png"
+ checkedImage: "filter-toggle-eye-up.png"
+
+ onClicked: model.rowVisible = checked
+ }
+
+ StyledToggleButton {
+ width: 20
+ height: 20
+
+ checked: model.locked
+
+ backgroundColor: itemDescription.color
+ downColor: backgroundColor
+ checkedImage: "Toggle-Lock.png"
+ enabledImage: "Toggle-Empty.png"
+
+ onClicked: model.locked = checked
+ }
+ }
+ }
+ }
+}
diff --git a/src/Authoring/Studio/Palettes/Timeline/TimelineView.cpp b/src/Authoring/Studio/Palettes/Timeline/TimelineView.cpp
index b764e31c..a2eeb6c8 100644
--- a/src/Authoring/Studio/Palettes/Timeline/TimelineView.cpp
+++ b/src/Authoring/Studio/Palettes/Timeline/TimelineView.cpp
@@ -121,6 +121,54 @@ void TimelineView::select(int index, Qt::KeyboardModifiers modifiers)
setSelection(index);
}
+void TimelineView::setHideShy(bool enabled)
+{
+ if (m_objectListModel && m_objectListModel->hideShy() != enabled) {
+ m_objectListModel->setHideShy(enabled);
+ emit hideShyChanged();
+ }
+}
+
+bool TimelineView::hideShy() const
+{
+ if (m_objectListModel)
+ return m_objectListModel->hideShy();
+
+ return false;
+}
+
+void TimelineView::setHideHidden(bool enabled)
+{
+ if (m_objectListModel && m_objectListModel->hideHidden() != enabled) {
+ m_objectListModel->setHideHidden(enabled);
+ emit hideHiddenChanged();
+ }
+}
+
+bool TimelineView::hideHidden() const
+{
+ if (m_objectListModel)
+ return m_objectListModel->hideHidden();
+
+ return false;
+}
+
+void TimelineView::setHideLocked(bool enabled)
+{
+ if (m_objectListModel && m_objectListModel->hideLocked() != enabled) {
+ m_objectListModel->setHideLocked(enabled);
+ emit hideLockedChanged();
+ }
+}
+
+bool TimelineView::hideLocked() const
+{
+ if (m_objectListModel)
+ return m_objectListModel->hideLocked();
+
+ return false;
+}
+
void TimelineView::OnAnimationCreated(qt3dsdm::Qt3DSDMInstanceHandle parentInstance,
qt3dsdm::Qt3DSDMPropertyHandle property)
{
diff --git a/src/Authoring/Studio/Palettes/Timeline/TimelineView.h b/src/Authoring/Studio/Palettes/Timeline/TimelineView.h
index a09f9307..c6075c92 100644
--- a/src/Authoring/Studio/Palettes/Timeline/TimelineView.h
+++ b/src/Authoring/Studio/Palettes/Timeline/TimelineView.h
@@ -48,6 +48,9 @@ class TimelineView : public QQuickWidget, public CPresentationChangeListener
Q_OBJECT
Q_PROPERTY(QAbstractItemModel *objectModel READ objectModel NOTIFY objectModelChanged FINAL)
Q_PROPERTY(int selection READ selection WRITE setSelection NOTIFY selectionChanged FINAL)
+ Q_PROPERTY(bool hideShy READ hideShy WRITE setHideShy NOTIFY hideShyChanged)
+ Q_PROPERTY(bool hideHidden READ hideHidden WRITE setHideHidden NOTIFY hideHiddenChanged)
+ Q_PROPERTY(bool hideLocked READ hideLocked WRITE setHideLocked NOTIFY hideLockedChanged)
public:
explicit TimelineView(QWidget *parent = nullptr);
@@ -63,10 +66,19 @@ public:
Q_INVOKABLE void select(int index, Qt::KeyboardModifiers modifiers);
+ void setHideShy(bool enabled);
+ bool hideShy() const;
+ void setHideHidden(bool enabled);
+ bool hideHidden() const;
+ void setHideLocked(bool enabled);
+ bool hideLocked() const;
Q_SIGNALS:
void objectModelChanged();
void selectionChanged();
+ void hideShyChanged();
+ void hideHiddenChanged();
+ void hideLockedChanged();
protected:
// DataModel callbacks
diff --git a/src/Authoring/Studio/Palettes/controls/StyledToggleButton.qml b/src/Authoring/Studio/Palettes/controls/StyledToggleButton.qml
new file mode 100644
index 00000000..e548acf4
--- /dev/null
+++ b/src/Authoring/Studio/Palettes/controls/StyledToggleButton.qml
@@ -0,0 +1,50 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of Qt 3D Studio.
+**
+** $QT_BEGIN_LICENSE:GPL-EXCEPT$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3 as published by the Free Software
+** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.6
+
+StyledToolButton {
+ id: control
+
+ property string checkedImage
+ property string backgroundColor: _backgroundColor
+ property string downColor: _buttonDownColor
+
+ checkable: true
+
+ background: Rectangle {
+ color: control.checked ? downColor : backgroundColor
+ border.color: backgroundColor
+ }
+
+ contentItem: Image {
+ fillMode: Image.Pad
+ source: control.enabled ? control.checked ? _resDir + checkedImage : _resDir + enabledImage
+ : _resDir + disabledImage
+ }
+}
diff --git a/src/Authoring/Studio/qml.qrc b/src/Authoring/Studio/qml.qrc
index 506c7df4..5f8863b4 100644
--- a/src/Authoring/Studio/qml.qrc
+++ b/src/Authoring/Studio/qml.qrc
@@ -41,5 +41,7 @@
<file>Palettes/Timeline/Timeline.qml</file>
<file>Palettes/Timeline/TimelineItem.qml</file>
<file>Palettes/Timeline/Keyframes.qml</file>
+ <file>Palettes/controls/StyledToggleButton.qml</file>
+ <file>Palettes/Timeline/TimelineTreeDelegate.qml</file>
</qresource>
</RCC>