various fixes
This commit is contained in:
@@ -10,6 +10,7 @@
|
||||
|
||||
#include <QDragEnterEvent>
|
||||
#include <QMimeData>
|
||||
#include <QHeaderView>
|
||||
#include <QDebug>
|
||||
|
||||
SourceTable::SourceTable(QWidget* parent) : QTreeWidget(parent) {
|
||||
|
||||
+22
-4
@@ -7,6 +7,7 @@
|
||||
#include <QPainter>
|
||||
#include <QMouseEvent>
|
||||
|
||||
#define CLICK_RANGE 5
|
||||
#define PLAYHEAD_SIZE 6
|
||||
|
||||
TimelineHeader::TimelineHeader(QWidget *parent) : QWidget(parent)
|
||||
@@ -23,6 +24,12 @@ void set_playhead(QMouseEvent* event) {
|
||||
}
|
||||
|
||||
void TimelineHeader::mousePressEvent(QMouseEvent* event) {
|
||||
/*if (panel_timeline->using_workarea) {
|
||||
event->pos().x()
|
||||
if (panel_timeline->workarea_in)
|
||||
} else {
|
||||
|
||||
}*/
|
||||
set_playhead(event);
|
||||
dragging = true;
|
||||
}
|
||||
@@ -51,13 +58,24 @@ void TimelineHeader::paintEvent(QPaintEvent*) {
|
||||
p.drawLine(i, 0, i, height());
|
||||
}
|
||||
|
||||
// draw in/out selection
|
||||
int in_x;
|
||||
if (panel_timeline->using_workarea) {
|
||||
in_x = panel_timeline->getScreenPointFromFrame(panel_timeline->workarea_in);
|
||||
int out_x = panel_timeline->getScreenPointFromFrame(panel_timeline->workarea_out);
|
||||
p.fillRect(QRect(in_x, 0, out_x-in_x, height()), QColor(0, 192, 255, 128));
|
||||
p.setPen(Qt::white);
|
||||
p.drawLine(in_x, 0, in_x, height());
|
||||
p.drawLine(out_x, 0, out_x, height());
|
||||
}
|
||||
|
||||
// draw playhead triangle
|
||||
int px = panel_timeline->getScreenPointFromFrame(panel_timeline->playhead);
|
||||
QPoint start(px, height());
|
||||
in_x = panel_timeline->getScreenPointFromFrame(panel_timeline->playhead);
|
||||
QPoint start(in_x, height());
|
||||
QPainterPath path;
|
||||
path.moveTo(start);
|
||||
path.lineTo(px-PLAYHEAD_SIZE, 0);
|
||||
path.lineTo(px+PLAYHEAD_SIZE, 0);
|
||||
path.lineTo(in_x-PLAYHEAD_SIZE, 0);
|
||||
path.lineTo(in_x+PLAYHEAD_SIZE, 0);
|
||||
path.lineTo(start);
|
||||
p.fillPath(path, Qt::red);
|
||||
}
|
||||
|
||||
@@ -232,6 +232,7 @@ void TimelineWidget::dropEvent(QDropEvent* event) {
|
||||
|
||||
if (c->track < 0) {
|
||||
// add default video effects
|
||||
qDebug() << "hello";
|
||||
c->effects.append(create_effect(VIDEO_TRANSFORM_EFFECT, c));
|
||||
} else {
|
||||
// add default audio effects
|
||||
|
||||
@@ -150,9 +150,6 @@ void ViewerWidget::paintGL() {
|
||||
|
||||
c->texture->bind();
|
||||
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
|
||||
|
||||
glBegin(GL_QUADS);
|
||||
glTexCoord2f(0.0, 0.0);
|
||||
glVertex2f(-anchor_x, -anchor_y);
|
||||
|
||||
Reference in New Issue
Block a user