started transition tool (#109)

This commit is contained in:
itsmattkc
2018-11-04 19:32:33 +11:00
parent 266105ea9e
commit 0daa4ea607
9 changed files with 1073 additions and 2 deletions
+10 -2
View File
@@ -89,6 +89,7 @@ Timeline::Timeline(QWidget *parent) :
tool_buttons.append(ui->toolSlipButton);
tool_buttons.append(ui->toolRollingButton);
tool_buttons.append(ui->toolSlideButton);
tool_buttons.append(ui->toolTransitionButton);
ui->toolArrowButton->click();
@@ -1042,7 +1043,7 @@ void Timeline::deselect() {
}
long getFrameFromScreenPoint(double zoom, int x) {
long f = qRound((float) x / zoom);
long f = qCeil((float) x / zoom);
if (f < 0) {
return 0;
}
@@ -1050,7 +1051,7 @@ long getFrameFromScreenPoint(double zoom, int x) {
}
int getScreenPointFromFrame(double zoom, long frame) {
return (int) qRound(frame*zoom);
return (int) qFloor(frame*zoom);
}
long Timeline::getTimelineFrameFromScreenPoint(int x) {
@@ -1167,3 +1168,10 @@ void Timeline::on_recordButton_clicked() {
creating_object = ADD_OBJ_AUDIO;
}
}
void Timeline::on_toolTransitionButton_clicked() {
decheck_tool_buttons(sender());
ui->timeline_area->setCursor(Qt::CrossCursor);
tool = TIMELINE_TOOL_TRANSITION;
creating = false;
}
+2
View File
@@ -201,6 +201,8 @@ private slots:
void on_recordButton_clicked();
void on_toolTransitionButton_clicked();
private:
QVector<QPushButton*> tool_buttons;
void decheck_tool_buttons(QObject* sender);
+19
View File
@@ -194,6 +194,25 @@
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="toolTransitionButton">
<property name="toolTip">
<string>Transition Tool (T)</string>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset>
<normalon>:/icons/transition-tool.png</normalon>
<disabledon>:/icons/transition-tool-disabled.png</disabledon>
</iconset>
</property>
<property name="checkable">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="snappingButton">
<property name="text">