Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions src/program/ui/InputEditorView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
#include <QtWidgets/QScrollBar>
#include <QtWidgets/QMenuBar>
#include <QtWidgets/QMessageBox>
#include <QtWidgets/QPushButton>
#include <QtGui/QClipboard>
#include <QtGui/QGuiApplication>
#include <QShortcut>
Expand Down Expand Up @@ -113,6 +114,12 @@ InputEditorView::InputEditorView(Context* c, MovieFile *m, QWidget *parent) : QT
keyDialog = new KeyPressedDialog(c, this);
keyDialog->withModifiers = false;

addColumnBtn = new QPushButton("+", horizontalHeader());
addColumnBtn->setFixedSize(20, horizontalHeader()->height());
addColumnBtn->move(horizontalHeader()->length(), 0);
addColumnBtn->show();
connect(addColumnBtn, &QPushButton::clicked, this, &InputEditorView::addInputColumn);

inputEventWindow = new InputEventWindow(c, movie, this);

currentMarkerText = "";
Expand Down Expand Up @@ -239,6 +246,14 @@ void InputEditorView::resizeAllColumns()
}
}

void InputEditorView::resizeEvent(QResizeEvent* event)
{
QTableView::resizeEvent(event);
if (addColumnBtn && horizontalHeader()) {
addColumnBtn->move(horizontalHeader()->length(), 0);
}
}

void InputEditorView::update()
{
static uint64_t last_framecount = -1;
Expand Down
4 changes: 4 additions & 0 deletions src/program/ui/InputEditorView.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

#include <QtWidgets/QTableView>
#include <QtWidgets/QMenu>
#include <QtWidgets/QPushButton>

/* Forward declaration */
struct Context;
Expand Down Expand Up @@ -91,6 +92,7 @@ public slots:
void timerEvent(QTimerEvent* event) override;
void hideEvent(QHideEvent* event) override;
void leaveEvent(QEvent *event) override;
void resizeEvent(QResizeEvent* event) override;

private slots:
void resizeAllColumns();
Expand Down Expand Up @@ -139,6 +141,8 @@ private slots:
QAction *autoholdAction;
QAction *autofireAction;

QPushButton *addColumnBtn = nullptr;

bool autoScroll = true;
int markerTimerId = 0;
int markerRow = 0;
Expand Down