moved zoom controls to context menu
This commit is contained in:
@@ -65,7 +65,6 @@ Viewer::Viewer(QWidget *parent) :
|
||||
connect(&recording_flasher, SIGNAL(timeout()), this, SLOT(recording_flasher_update()));
|
||||
connect(ui->horizontalScrollBar, SIGNAL(valueChanged(int)), ui->headers, SLOT(set_scroll(int)));
|
||||
connect(ui->horizontalScrollBar, SIGNAL(valueChanged(int)), viewer_widget, SLOT(set_waveform_scroll(int)));
|
||||
connect(ui->zoomComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(zoom_update(int)));
|
||||
|
||||
update_playhead_timecode(0);
|
||||
update_end_timecode();
|
||||
@@ -560,18 +559,6 @@ void Viewer::recording_flasher_update() {
|
||||
}
|
||||
}
|
||||
|
||||
void Viewer::zoom_update(int i) {
|
||||
if (i == 0) {
|
||||
ui->glViewerPane->fit = true;
|
||||
} else {
|
||||
ui->glViewerPane->fit = false;
|
||||
QString pc = ui->zoomComboBox->itemText(i);
|
||||
pc = pc.left(pc.length() - 1);
|
||||
ui->glViewerPane->zoom = pc.toDouble()*0.01;
|
||||
}
|
||||
ui->glViewerPane->adjust();
|
||||
}
|
||||
|
||||
void Viewer::clean_created_seq() {
|
||||
viewer_widget->waveform = false;
|
||||
|
||||
|
||||
+1
-2
@@ -82,8 +82,7 @@ private slots:
|
||||
void on_pushButton_3_clicked();
|
||||
void update_playhead();
|
||||
void timer_update();
|
||||
void recording_flasher_update();
|
||||
void zoom_update(int i);
|
||||
void recording_flasher_update();
|
||||
private:
|
||||
void clean_created_seq();
|
||||
void set_sequence(bool main, Sequence* s);
|
||||
|
||||
@@ -70,99 +70,6 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QWidget" name="zoomControlBar" native="true">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_6">
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>260</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QComboBox" name="zoomComboBox">
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Fit</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>10%</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>25%</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>50%</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>75%</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>100%</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>150%</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>200%</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>400%</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>259</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QWidget" name="playbackControls" native="true">
|
||||
<property name="sizePolicy">
|
||||
|
||||
@@ -75,6 +75,8 @@ void ViewerContainer::adjust() {
|
||||
|
||||
child->move(widget_x, widget_y);
|
||||
child->resize(widget_width, widget_height);
|
||||
|
||||
zoom = double(widget_width) / double(viewer->seq->width);
|
||||
} else {
|
||||
int zoomed_width = double(viewer->seq->width)*zoom;
|
||||
int zoomed_height = double(viewer->seq->height)*zoom;
|
||||
|
||||
@@ -35,6 +35,7 @@
|
||||
#include <QFileDialog>
|
||||
#include <QPolygon>
|
||||
#include <QDesktopWidget>
|
||||
#include <QInputDialog>
|
||||
|
||||
extern "C" {
|
||||
#include <libavformat/avformat.h>
|
||||
@@ -91,6 +92,22 @@ void ViewerWidget::show_context_menu() {
|
||||
QAction* show_fullscreen_action = menu.addAction("Show Fullscreen");
|
||||
connect(show_fullscreen_action, SIGNAL(triggered()), this, SLOT(show_fullscreen()));
|
||||
|
||||
QMenu zoom_menu("Zoom");
|
||||
QAction* fit_zoom = zoom_menu.addAction("Fit");
|
||||
connect(fit_zoom, SIGNAL(triggered(bool)), this, SLOT(set_fit_zoom()));
|
||||
zoom_menu.addAction("10%")->setData(0.1);
|
||||
zoom_menu.addAction("25%")->setData(0.25);
|
||||
zoom_menu.addAction("50%")->setData(0.5);
|
||||
zoom_menu.addAction("75%")->setData(0.75);
|
||||
zoom_menu.addAction("100%")->setData(1.0);
|
||||
zoom_menu.addAction("150%")->setData(1.5);
|
||||
zoom_menu.addAction("200%")->setData(2.0);
|
||||
zoom_menu.addAction("400%")->setData(4.0);
|
||||
QAction* custom_zoom = zoom_menu.addAction("Custom");
|
||||
connect(custom_zoom, SIGNAL(triggered(bool)), this, SLOT(set_custom_zoom()));
|
||||
connect(&zoom_menu, SIGNAL(triggered(QAction*)), this, SLOT(set_menu_zoom(QAction*)));
|
||||
menu.addMenu(&zoom_menu);
|
||||
|
||||
menu.exec(QCursor::pos());
|
||||
}
|
||||
|
||||
@@ -130,6 +147,30 @@ void ViewerWidget::show_fullscreen() {
|
||||
showFullScreen();
|
||||
}
|
||||
|
||||
void ViewerWidget::set_fit_zoom() {
|
||||
container->fit = true;
|
||||
container->adjust();
|
||||
}
|
||||
|
||||
void ViewerWidget::set_custom_zoom() {
|
||||
bool ok;
|
||||
double d = QInputDialog::getDouble(this, "Viewer Zoom", "Set Custom Zoom Value:", container->zoom*100, 0, 2147483647, 2, &ok);
|
||||
if (ok) {
|
||||
container->fit = false;
|
||||
container->zoom = d*0.01;
|
||||
container->adjust();
|
||||
}
|
||||
}
|
||||
|
||||
void ViewerWidget::set_menu_zoom(QAction* action) {
|
||||
const QVariant& data = action->data();
|
||||
if (!data.isNull()) {
|
||||
container->fit = false;
|
||||
container->zoom = data.toDouble();
|
||||
container->adjust();
|
||||
}
|
||||
}
|
||||
|
||||
void ViewerWidget::retry() {
|
||||
update();
|
||||
}
|
||||
|
||||
@@ -70,6 +70,10 @@ private slots:
|
||||
void show_context_menu();
|
||||
void save_frame();
|
||||
void show_fullscreen();
|
||||
|
||||
void set_fit_zoom();
|
||||
void set_custom_zoom();
|
||||
void set_menu_zoom(QAction *action);
|
||||
};
|
||||
|
||||
#endif // VIEWERWIDGET_H
|
||||
|
||||
Reference in New Issue
Block a user