added graph editor to maximize panel

This commit is contained in:
itsmattkc
2019-02-07 03:54:03 +11:00
parent 04084c36d2
commit 101ad79e9d
3 changed files with 22 additions and 17 deletions
+2 -1
View File
@@ -1231,7 +1231,8 @@ void MainWindow::maximize_panel() {
if (focused_panel != panel_effect_controls) removeDockWidget(panel_effect_controls);
if (focused_panel != panel_timeline) removeDockWidget(panel_timeline);
if (focused_panel != panel_sequence_viewer) removeDockWidget(panel_sequence_viewer);
if (focused_panel != panel_footage_viewer) removeDockWidget(panel_footage_viewer);
if (focused_panel != panel_footage_viewer) removeDockWidget(panel_footage_viewer);
if (focused_panel != panel_graph_editor) removeDockWidget(panel_graph_editor);
}
} else {
// we must be maximized, restore previous state
+16 -16
View File
@@ -84,24 +84,21 @@ void ViewerContainer::adjust() {
if (!fit) {
widget_width -= vertical_scrollbar->sizeHint().width();
widget_height -= horizontal_scrollbar->sizeHint().height();
}
double widget_ar = double(widget_width) / double(widget_height);
bool widget_is_wider_than_sequence = widget_ar > aspect_ratio;
if (widget_is_wider_than_sequence) {
widget_width = widget_height * aspect_ratio;
widget_x = (width() / 2) - (widget_width / 2);
} else {
widget_height = widget_width / aspect_ratio;
widget_y = (height() / 2) - (widget_height / 2);
}
child->move(widget_x, widget_y);
child->resize(widget_width, widget_height);
}
if (fit) {
double widget_ar = double(widget_width) / double(widget_height);
bool widget_is_wider_than_sequence = widget_ar > aspect_ratio;
if (widget_is_wider_than_sequence) {
widget_width = widget_height * aspect_ratio;
widget_x = (width() / 2) - (widget_width / 2);
} else {
widget_height = widget_width / aspect_ratio;
widget_y = (height() / 2) - (widget_height / 2);
}
zoom = double(widget_width) / double(viewer->seq->width);
} else if (zoomed_width > width() || zoomed_height > height()) {
horizontal_scrollbar->setVisible(true);
@@ -115,6 +112,9 @@ void ViewerContainer::adjust() {
adjust_scrollbars();
}
child->move(widget_x, widget_y);
child->resize(widget_width, widget_height);
} else {
// if the zoom size is smaller than the available area, scale the surface down
+4
View File
@@ -585,6 +585,7 @@ void ViewerWidget::paintGL() {
glBegin(GL_QUADS);
double ar_diff = (double(viewer->seq->width)/double(viewer->seq->height)/(double(width())/double(height())));
double zoom_factor = container->zoom/(double(width())/double(viewer->seq->width));
double zoom_size = (zoom_factor*2.0) - 2.0;
double zoom_left = -zoom_size*x_scroll - 1.0;
@@ -592,6 +593,9 @@ void ViewerWidget::paintGL() {
double zoom_bottom = -zoom_size*(1.0-y_scroll) - 1.0;
double zoom_top = zoom_size*(y_scroll) + 1.0;
//zoom_left *= ar_diff;
//zoom_right *= ar_diff;
glVertex2d(zoom_left, zoom_bottom);
glTexCoord2d(0, 0);
glVertex2d(zoom_left, zoom_top);