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
+13 -2
View File
@@ -23,6 +23,7 @@
#include <QEvent>
#include "core.h"
#include "panel/panelmanager.h"
#include "tool/tool.h"
#include "ui/style/style.h"
#include "undo/undostack.h"
@@ -84,8 +85,8 @@ MainMenu::MainMenu(QWidget *parent) :
// VIEW MENU
//
view_menu_ = new Menu(this);
view_zoom_in_item_ = view_menu_->AddItem("zoomin", nullptr, nullptr, "=");
view_zoom_out_item_ = view_menu_->AddItem("zoomout", nullptr, nullptr, "-");
view_zoom_in_item_ = view_menu_->AddItem("zoomin", this, SLOT(ZoomInTriggered()), "=");
view_zoom_out_item_ = view_menu_->AddItem("zoomout", this, SLOT(ZoomOutTriggered()), "-");
view_increase_track_height_item_ = view_menu_->AddItem("vzoomin", nullptr, nullptr, "Ctrl+=");
view_decrease_track_height_item_ = view_menu_->AddItem("vzoomout", nullptr, nullptr, "Ctrl+-");
view_show_all_item_ = view_menu_->AddItem("showall", nullptr, nullptr, "\\");
@@ -333,6 +334,16 @@ void MainMenu::ToolsMenuAboutToShow()
tools_snapping_item_->setChecked(olive::core.snapping());
}
void MainMenu::ZoomInTriggered()
{
olive::panel_focus_manager->CurrentlyFocused()->ZoomIn();
}
void MainMenu::ZoomOutTriggered()
{
olive::panel_focus_manager->CurrentlyFocused()->ZoomOut();
}
void MainMenu::Retranslate()
{
// MenuShared is not a QWidget and therefore does not receive a LanguageEvent, we use MainMenu's to update it
+14
View File
@@ -60,6 +60,20 @@ private slots:
*/
void ToolsMenuAboutToShow();
/**
* @brief Slot for zooming in
*
* Finds the currently focused panel and sends it a "zoom in" signal
*/
void ZoomInTriggered();
/**
* @brief Slot for zooming out
*
* Finds the currently focused panel and sends it a "zoom out" signal
*/
void ZoomOutTriggered();
private:
/**
* @brief Set strings based on the current application language.