Browse Source

Move QuantityWidget to ui

tags/v1.0.0
Andrew Belt 6 years ago
parent
commit
25779027a8
9 changed files with 16 additions and 7 deletions
  1. +1
    -0
      include/ui.hpp
  2. +1
    -0
      include/ui/ProgressBar.hpp
  3. +1
    -1
      include/ui/QuantityWidget.hpp
  4. +1
    -0
      include/ui/RadioButton.hpp
  5. +1
    -0
      include/ui/Slider.hpp
  6. +0
    -1
      include/widgets.hpp
  7. +1
    -0
      include/widgets/TransparentWidget.hpp
  8. +5
    -5
      include/widgets/ZoomWidget.hpp
  9. +5
    -0
      src/widgets/Widget.cpp

+ 1
- 0
include/ui.hpp View File

@@ -1,5 +1,6 @@
#pragma once
#include "ui/common.hpp"
#include "ui/QuantityWidget.hpp"
#include "ui/SequentialLayout.hpp"
#include "ui/Label.hpp"
#include "ui/List.hpp"


+ 1
- 0
include/ui/ProgressBar.hpp View File

@@ -1,5 +1,6 @@
#pragma once
#include "ui/common.hpp"
#include "ui/QuantityWidget.hpp"


namespace rack {


include/widgets/QuantityWidget.hpp → include/ui/QuantityWidget.hpp View File

@@ -1,5 +1,5 @@
#pragma once
#include "widgets/Widget.hpp"
#include "ui/common.hpp"


namespace rack {

+ 1
- 0
include/ui/RadioButton.hpp View File

@@ -1,5 +1,6 @@
#pragma once
#include "ui/common.hpp"
#include "ui/QuantityWidget.hpp"


namespace rack {


+ 1
- 0
include/ui/Slider.hpp View File

@@ -1,5 +1,6 @@
#pragma once
#include "ui/common.hpp"
#include "ui/QuantityWidget.hpp"


namespace rack {


+ 0
- 1
include/widgets.hpp View File

@@ -6,4 +6,3 @@
#include "widgets/ZoomWidget.hpp"
#include "widgets/SVGWidget.hpp"
#include "widgets/FramebufferWidget.hpp"
#include "widgets/QuantityWidget.hpp"

+ 1
- 0
include/widgets/TransparentWidget.hpp View File

@@ -13,6 +13,7 @@ struct TransparentWidget : virtual Widget {
void onHoverKey(event::HoverKey &e) override {}
void onHoverText(event::HoverText &e) override {}
void onHoverScroll(event::HoverScroll &e) override {}
void onDragHover(event::DragHover &e) override {}
void onPathDrop(event::PathDrop &e) override {}
};



+ 5
- 5
include/widgets/ZoomWidget.hpp View File

@@ -40,31 +40,31 @@ struct ZoomWidget : virtual Widget {
e2.pos = e.pos.div(zoom);
Widget::onHover(e2);
}

void onButton(event::Button &e) override {
event::Button e2 = e;
e2.pos = e.pos.div(zoom);
Widget::onButton(e2);
}

void onHoverKey(event::HoverKey &e) override {
event::HoverKey e2 = e;
e2.pos = e.pos.div(zoom);
Widget::onHoverKey(e2);
}

void onHoverText(event::HoverText &e) override {
event::HoverText e2 = e;
e2.pos = e.pos.div(zoom);
Widget::onHoverText(e2);
}

void onHoverScroll(event::HoverScroll &e) override {
event::HoverScroll e2 = e;
e2.pos = e.pos.div(zoom);
Widget::onHoverScroll(e2);
}

void onDragHover(event::DragHover &e) override {
event::DragHover e2 = e;
e2.pos = e.pos.div(zoom);
Widget::onDragHover(e2);
}
void onPathDrop(event::PathDrop &e) override {
event::PathDrop e2 = e;
e2.pos = e.pos.div(zoom);


+ 5
- 0
src/widgets/Widget.cpp View File

@@ -89,8 +89,13 @@ void Widget::step() {

void Widget::draw(NVGcontext *vg) {
for (Widget *child : children) {
// Don't draw if invisible
if (!child->visible)
continue;
// Don't draw if child is outside bounding box
if (!box.zeroPos().intersects(child->box))
continue;

nvgSave(vg);
nvgTranslate(vg, child->box.pos.x, child->box.pos.y);
child->draw(vg);


Loading…
Cancel
Save