button_add->setEnabled(false);
button_delete->setEnabled(false);
keyframe_seek->setEnabled(false);
- label->setHidden(true);
- keyframe_pos->setHidden(true);
+ widgetTable->setHidden(true);
}
m_params.append(e.cloneNode().toElement());
keyframe_list->setFont(KGlobalSettings::generalFont());
keyframe_seek->setChecked(KdenliveSettings::keyframeseek());
connect(keyframe_seek, SIGNAL(stateChanged(int)), this, SLOT(slotSetSeeking(int)));
+ buttonKeyframes->setIcon(KIcon("list-add"));
button_add->setIcon(KIcon("list-add"));
button_add->setToolTip(i18n("Add keyframe"));
button_delete->setIcon(KIcon("list-remove"));
//keyframe_list->horizontalHeader()->resizeSections(QHeaderView::ResizeToContents);
connect(button_delete, SIGNAL(clicked()), this, SLOT(slotDeleteKeyframe()));
connect(button_add, SIGNAL(clicked()), this, SLOT(slotAddKeyframe()));
+ connect(buttonKeyframes, SIGNAL(clicked()), this, SLOT(slotKeyframeMode()));
//connect(keyframe_list, SIGNAL(itemDoubleClicked(QTreeWidgetItem *, int)), this, SLOT(slotSaveCurrentParam(QTreeWidgetItem *, int)));
connect(keyframe_pos, SIGNAL(valueChanged(int)), this, SLOT(slotAdjustKeyframePos(int)));
//connect(keyframe_val, SIGNAL(valueChanged(int)), this, SLOT(slotAdjustKeyframeValue(int)));
keyframe_list->setMinimumHeight(QFontInfo(keyframe_list->font()).pixelSize() * 9);
/*m_delegate = new KeyItemDelegate(minVal, maxVal);
keyframe_list->setItemDelegate(m_delegate);*/
+
+ // Do not show keyframe table if only one keyframe exists at the beginning
+ if (keyframe_list->rowCount() < 2 && getPos(0) == m_min && m_max != -1)
+ widgetTable->setHidden(true);
+ else
+ buttonKeyframes->setHidden(true);
}
KeyframeEdit::~KeyframeEdit()
}
}
+void KeyframeEdit::slotKeyframeMode()
+{
+ widgetTable->setHidden(false);
+ buttonKeyframes->setHidden(true);
+ slotAddKeyframe();
+}
+
/*void KeyframeEdit::slotSaveCurrentParam(QTreeWidgetItem *item, int column)
{
if (item && column == 0) m_previousPos = m_timecode.getFrameCount(item->text(0));
<rect>
<x>0</x>
<y>0</y>
- <width>277</width>
- <height>269</height>
+ <width>336</width>
+ <height>190</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout">
<property name="rightMargin">
<number>0</number>
</property>
- <item row="0" column="0" colspan="3">
- <widget class="QTableWidget" name="keyframe_list">
- <property name="alternatingRowColors">
- <bool>true</bool>
- </property>
- <property name="cornerButtonEnabled">
- <bool>false</bool>
- </property>
- <attribute name="horizontalHeaderHighlightSections">
- <bool>false</bool>
- </attribute>
- <attribute name="horizontalHeaderStretchLastSection">
- <bool>true</bool>
- </attribute>
- <attribute name="verticalHeaderVisible">
- <bool>true</bool>
- </attribute>
- <attribute name="verticalHeaderHighlightSections">
- <bool>false</bool>
- </attribute>
- <attribute name="verticalHeaderVisible">
- <bool>true</bool>
- </attribute>
- <attribute name="horizontalHeaderStretchLastSection">
- <bool>true</bool>
- </attribute>
- <attribute name="horizontalHeaderHighlightSections">
- <bool>false</bool>
- </attribute>
- <attribute name="verticalHeaderHighlightSections">
- <bool>false</bool>
- </attribute>
- </widget>
- </item>
- <item row="1" column="0">
- <widget class="QToolButton" name="button_add">
- <property name="text">
- <string>A</string>
- </property>
- <property name="arrowType">
- <enum>Qt::NoArrow</enum>
- </property>
- </widget>
- </item>
- <item row="1" column="1">
- <widget class="QToolButton" name="button_delete">
- <property name="text">
- <string>D</string>
- </property>
- <property name="arrowType">
- <enum>Qt::NoArrow</enum>
- </property>
- </widget>
- </item>
- <item row="1" column="2">
- <widget class="QCheckBox" name="keyframe_seek">
- <property name="text">
- <string>Seek to active keyframe</string>
- </property>
- </widget>
- </item>
- <item row="2" column="0" colspan="2">
- <widget class="QLabel" name="label">
- <property name="text">
- <string>Position</string>
- </property>
- </widget>
- </item>
- <item row="2" column="2">
- <widget class="QSlider" name="keyframe_pos">
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
- </property>
- </widget>
- </item>
<item row="4" column="0" colspan="3">
<widget class="Line" name="line">
<property name="orientation">
</property>
</widget>
</item>
+ <item row="2" column="0" colspan="3">
+ <widget class="QWidget" name="widgetTable" native="true">
+ <layout class="QGridLayout" name="gridLayout_2">
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <item row="3" column="0" colspan="3">
+ <widget class="QTableWidget" name="keyframe_list">
+ <property name="alternatingRowColors">
+ <bool>true</bool>
+ </property>
+ <property name="cornerButtonEnabled">
+ <bool>false</bool>
+ </property>
+ <attribute name="horizontalHeaderHighlightSections">
+ <bool>false</bool>
+ </attribute>
+ <attribute name="horizontalHeaderStretchLastSection">
+ <bool>true</bool>
+ </attribute>
+ <attribute name="verticalHeaderVisible">
+ <bool>true</bool>
+ </attribute>
+ <attribute name="verticalHeaderHighlightSections">
+ <bool>false</bool>
+ </attribute>
+ </widget>
+ </item>
+ <item row="4" column="0">
+ <widget class="QToolButton" name="button_add">
+ <property name="text">
+ <string>A</string>
+ </property>
+ <property name="arrowType">
+ <enum>Qt::NoArrow</enum>
+ </property>
+ </widget>
+ </item>
+ <item row="4" column="2">
+ <widget class="QCheckBox" name="keyframe_seek">
+ <property name="text">
+ <string>Seek to active keyframe</string>
+ </property>
+ </widget>
+ </item>
+ <item row="5" column="0" colspan="2">
+ <widget class="QLabel" name="label">
+ <property name="text">
+ <string>Position</string>
+ </property>
+ </widget>
+ </item>
+ <item row="5" column="2">
+ <widget class="QSlider" name="keyframe_pos">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ </widget>
+ </item>
+ <item row="4" column="1">
+ <widget class="QToolButton" name="button_delete">
+ <property name="text">
+ <string>D</string>
+ </property>
+ <property name="arrowType">
+ <enum>Qt::NoArrow</enum>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item row="1" column="0">
+ <widget class="QWidget" name="widget" native="true">
+ <layout class="QGridLayout" name="gridLayout_3">
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <item row="0" column="0">
+ <widget class="QToolButton" name="buttonKeyframes">
+ <property name="toolTip">
+ <string>Add keyframes</string>
+ </property>
+ <property name="text">
+ <string>Keyframes</string>
+ </property>
+ <property name="toolButtonStyle">
+ <enum>Qt::ToolButtonTextBesideIcon</enum>
+ </property>
+ <property name="autoRaise">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </item>
</layout>
</widget>
<resources/>