started transition tool (#109)
This commit is contained in:
+10
-2
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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">
|
||||
|
||||
Reference in New Issue
Block a user