added it to effect controls

This commit is contained in:
itsmattkc
2018-12-26 18:27:12 +11:00
parent 9bc9d33ee5
commit 26c7133cc7
4 changed files with 15 additions and 4 deletions
+1
View File
@@ -43,6 +43,7 @@ EffectControls::EffectControls(QWidget *parent) :
ui->label_2->setVisible(false);
connect(ui->horizontalScrollBar, SIGNAL(valueChanged(int)), ui->headers, SLOT(set_scroll(int)));
connect(ui->horizontalScrollBar, SIGNAL(resize_move(double)), ui->keyframeView, SLOT(resize_move(double)));
connect(ui->horizontalScrollBar, SIGNAL(valueChanged(int)), ui->keyframeView, SLOT(set_x_scroll(int)));
connect(ui->verticalScrollBar, SIGNAL(valueChanged(int)), ui->keyframeView, SLOT(set_y_scroll(int)));
connect(ui->verticalScrollBar, SIGNAL(valueChanged(int)), ui->scrollArea->verticalScrollBar(), SLOT(setValue(int)));
+8 -3
View File
@@ -71,8 +71,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>225</width>
<height>477</height>
<width>189</width>
<height>483</height>
</rect>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_3">
@@ -502,7 +502,7 @@
</widget>
</item>
<item>
<widget class="QScrollBar" name="horizontalScrollBar">
<widget class="ResizableScrollBar" name="horizontalScrollBar">
<property name="maximum">
<number>0</number>
</property>
@@ -543,6 +543,11 @@
<header>panels/effectcontrols.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>ResizableScrollBar</class>
<extends>QScrollBar</extends>
<header>ui/resizablescrollbar.h</header>
</customwidget>
</customwidgets>
<resources/>
<connections/>
+4
View File
@@ -189,6 +189,10 @@ void KeyframeView::draw_keyframe(QPainter &p, int type, int x, int y, bool darke
}
}
void KeyframeView::resize_move(double d) {
header->update_zoom(header->get_zoom()*d);
}
void KeyframeView::mousePressEvent(QMouseEvent *event) {
if (event->button() == Qt::LeftButton) {
int row_index = -1;
+2 -1
View File
@@ -23,6 +23,7 @@ public:
public slots:
void set_x_scroll(int);
void set_y_scroll(int);
void resize_move(double d);
private:
long adjust_row_keyframe(EffectRow* row, long time);
QVector<EffectRow*> selected_rows;
@@ -38,7 +39,7 @@ private:
bool mousedown;
bool dragging;
bool keys_selected;
bool select_rect;
bool select_rect;
bool keyframeIsSelected(EffectRow* row, int keyframe);