Browse Source

Move app::MenuBar class definition from header to source file.

tags/v2.0.0
Andrew Belt 4 years ago
parent
commit
f3094a572a
4 changed files with 14 additions and 15 deletions
  1. +2
    -7
      include/app/MenuBar.hpp
  2. +1
    -2
      include/app/Scene.hpp
  3. +10
    -6
      src/app/MenuBar.cpp
  4. +1
    -0
      src/app/Scene.cpp

+ 2
- 7
include/app/MenuBar.hpp View File

@@ -1,18 +1,13 @@
#pragma once
#include <app/common.hpp>
#include <widget/OpaqueWidget.hpp>
#include <widget/Widget.hpp>


namespace rack {
namespace app {


struct MenuBar : widget::OpaqueWidget {
void draw(const DrawArgs& args) override;
};


MenuBar* createMenuBar();
widget::Widget* createMenuBar();


} // namespace app


+ 1
- 2
include/app/Scene.hpp View File

@@ -3,7 +3,6 @@
#include <widget/OpaqueWidget.hpp>
#include <app/RackScrollWidget.hpp>
#include <app/RackWidget.hpp>
#include <app/MenuBar.hpp>


namespace rack {
@@ -17,7 +16,7 @@ struct Scene : widget::OpaqueWidget {
// Convenience variables for accessing important widgets
RackScrollWidget* rackScroll;
RackWidget* rack;
MenuBar* menuBar;
widget::Widget* menuBar;
widget::Widget* moduleBrowser;
widget::Widget* frameRateWidget;



+ 10
- 6
src/app/MenuBar.cpp View File

@@ -4,6 +4,7 @@
#include <osdialog.h>

#include <app/MenuBar.hpp>
#include <widget/OpaqueWidget.hpp>
#include <window.hpp>
#include <engine/Engine.hpp>
#include <asset.hpp>
@@ -931,15 +932,18 @@ struct HelpButton : MenuButton {
// MenuBar
////////////////////

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);

Widget::draw(args);
}
struct MenuBar : widget::OpaqueWidget {
void draw(const DrawArgs& args) override {
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);

Widget::draw(args);
}
};


MenuBar* createMenuBar() {
widget::Widget* createMenuBar() {
MenuBar* menuBar = new MenuBar;

const float margin = 5;


+ 1
- 0
src/app/Scene.cpp View File

@@ -4,6 +4,7 @@

#include <app/Scene.hpp>
#include <app/ModuleBrowser.hpp>
#include <app/MenuBar.hpp>
#include <context.hpp>
#include <system.hpp>
#include <network.hpp>


Loading…
Cancel
Save