reimplemented zooming controls

This commit is contained in:
itsmattkc
2019-08-15 11:39:07 +10:00
parent b4529205b9
commit fb7c7f1bdb
15 changed files with 142 additions and 9 deletions
+8
View File
@@ -39,6 +39,14 @@ void PanelWidget::SetBorderVisible(bool enabled)
update();
}
void PanelWidget::ZoomIn()
{
}
void PanelWidget::ZoomOut()
{
}
void PanelWidget::SetTitle(const QString &t)
{
title_ = t;
+16
View File
@@ -46,6 +46,22 @@ public:
* @param enabled
*/
void SetBorderVisible(bool enabled);
/**
* @brief Called whenever this panel is focused and user uses "Zoom In" (either in menus or as a keyboard shortcut)
*
* This function is up to the Panel's interpretation of what the user intends to zoom into. Default behavior is a
* no-op.
*/
virtual void ZoomIn();
/**
* @brief Called whenever this panel is focused and user uses "Zoom Out" (either in menus or as a keyboard shortcut)
*
* This function is up to the Panel's interpretation of what the user intends to zoom out of. Default behavior is a
* no-op.
*/
virtual void ZoomOut();
protected:
/**
* @brief Set panel's title
+5 -1
View File
@@ -98,7 +98,11 @@ void TimelineView::SetScale(const double &scale)
QMapIterator<Block*, TimelineViewRect*> iterator(clip_items_);
while (iterator.hasNext()) {
iterator.value()->SetScale(scale_);
iterator.next();
if (iterator.value() != nullptr) {
iterator.value()->SetScale(scale_);
}
}
playhead_line_->SetScale(scale_);
+6 -1
View File
@@ -69,7 +69,12 @@ void TimeRuler::SetTextVisible(bool e)
update();
}
void TimeRuler::SetScale(double d)
const double &TimeRuler::scale()
{
return scale_;
}
void TimeRuler::SetScale(const double &d)
{
scale_ = d;
+2 -1
View File
@@ -35,7 +35,8 @@ public:
void SetTextVisible(bool e);
void SetScale(double d);
const double& scale();
void SetScale(const double& d);
void SetTimebase(const rational& r);
+10
View File
@@ -67,6 +67,16 @@ void ViewerWidget::SetTimebase(const rational &r)
controls_->SetTimebase(r);
}
const double &ViewerWidget::scale()
{
return ruler_->scale();
}
void ViewerWidget::SetScale(const double &scale_)
{
ruler_->SetScale(scale_);
}
void ViewerWidget::SetTexture(GLuint tex)
{
gl_widget_->SetTexture(tex);
+4
View File
@@ -46,6 +46,10 @@ public:
void SetTimebase(const rational& r);
const double& scale();
void SetScale(const double& scale_);
public slots:
/**
* @brief Set the texture to draw and draw it