From 53274088bed75996ab934110a164240de13cc1cb Mon Sep 17 00:00:00 2001 From: Andrew Belt Date: Wed, 1 May 2019 16:36:59 -0400 Subject: [PATCH] Rename Toolbar to MenuBar. --- include/app/{Toolbar.hpp => MenuBar.hpp} | 8 ++------ include/app/Scene.hpp | 4 ++-- include/rack.hpp | 2 +- src/app/{Toolbar.cpp => MenuBar.cpp} | 6 +++--- src/app/Scene.cpp | 8 ++++---- 5 files changed, 12 insertions(+), 16 deletions(-) rename include/app/{Toolbar.hpp => MenuBar.hpp} (56%) rename src/app/{Toolbar.cpp => MenuBar.cpp} (99%) diff --git a/include/app/Toolbar.hpp b/include/app/MenuBar.hpp similarity index 56% rename from include/app/Toolbar.hpp rename to include/app/MenuBar.hpp index 1ac06eda..6949d57a 100644 --- a/include/app/Toolbar.hpp +++ b/include/app/MenuBar.hpp @@ -7,12 +7,8 @@ namespace rack { namespace app { -struct Toolbar : widget::OpaqueWidget { - // TODO Move these to future Rack app state - float cableOpacity = 0.5; - float cableTension = 0.5; - - Toolbar(); +struct MenuBar : widget::OpaqueWidget { + MenuBar(); void draw(const DrawArgs &args) override; }; diff --git a/include/app/Scene.hpp b/include/app/Scene.hpp index 33fc57b3..11d86094 100644 --- a/include/app/Scene.hpp +++ b/include/app/Scene.hpp @@ -3,7 +3,7 @@ #include "widget/OpaqueWidget.hpp" #include "app/RackScrollWidget.hpp" #include "app/RackWidget.hpp" -#include "app/Toolbar.hpp" +#include "app/MenuBar.hpp" namespace rack { @@ -14,7 +14,7 @@ struct Scene : widget::OpaqueWidget { // Convenience variables for accessing important widgets RackScrollWidget *rackScroll; RackWidget *rack; - Toolbar *toolbar; + MenuBar *menuBar; widget::Widget *moduleBrowser; // Version checking diff --git a/include/rack.hpp b/include/rack.hpp index 88e57f99..947be15a 100644 --- a/include/rack.hpp +++ b/include/rack.hpp @@ -65,7 +65,7 @@ #include "app/SvgScrew.hpp" #include "app/SvgSlider.hpp" #include "app/SvgSwitch.hpp" -#include "app/Toolbar.hpp" +#include "app/MenuBar.hpp" #include "app/CableWidget.hpp" #include "engine/Engine.hpp" diff --git a/src/app/Toolbar.cpp b/src/app/MenuBar.cpp similarity index 99% rename from src/app/Toolbar.cpp rename to src/app/MenuBar.cpp index f8afd1e6..42cda8b1 100644 --- a/src/app/Toolbar.cpp +++ b/src/app/MenuBar.cpp @@ -1,4 +1,4 @@ -#include "app/Toolbar.hpp" +#include "app/MenuBar.hpp" #include "window.hpp" #include "engine/Engine.hpp" #include "asset.hpp" @@ -680,7 +680,7 @@ struct HelpButton : MenuButton { }; -Toolbar::Toolbar() { +MenuBar::MenuBar() { const float margin = 5; box.size.y = BND_WIDGET_HEIGHT + 2*margin; @@ -714,7 +714,7 @@ Toolbar::Toolbar() { layout->addChild(helpButton); } -void Toolbar::draw(const DrawArgs &args) { +void MenuBar::draw(const DrawArgs &args) { bndMenuBackground(args.vg, 0.0, 0.0, box.size.x, box.size.y, BND_CORNER_ALL); bndBevel(args.vg, 0.0, 0.0, box.size.x, box.size.y); diff --git a/src/app/Scene.cpp b/src/app/Scene.cpp index 2d5a1a2c..b43cfcd1 100644 --- a/src/app/Scene.cpp +++ b/src/app/Scene.cpp @@ -21,9 +21,9 @@ Scene::Scene() { rack = rackScroll->rackWidget; - toolbar = new Toolbar; - addChild(toolbar); - rackScroll->box.pos.y = toolbar->box.size.y; + menuBar = new MenuBar; + addChild(menuBar); + rackScroll->box.pos.y = menuBar->box.size.y; moduleBrowser = moduleBrowserCreate(); moduleBrowser->hide(); @@ -35,7 +35,7 @@ Scene::~Scene() { void Scene::step() { // Resize owned descendants - toolbar->box.size.x = box.size.x; + menuBar->box.size.x = box.size.x; rackScroll->box.size = box.size.minus(rackScroll->box.pos); // Autosave every 15 seconds