[bugui] wip on color

This commit is contained in:
thibaud keller 2024-10-16 23:25:53 +01:00
parent 2d1d8ab1b0
commit 39f11ea247
3 changed files with 69 additions and 68 deletions

@ -1 +1 @@
Subproject commit bb211f5b66f1775a1c2abd12b650fbaf486b8c86
Subproject commit 6e18b2d897e89ced5eb420aafe7c50f29026bfb6

View file

@ -8,24 +8,24 @@
namespace Hardware
{
Controller::Controller(const score::DocumentContext& doc)
: bugui::controller{[&doc, this]
(commands com, const bool& shift)
: bugui::painter{[&doc, this]
(bugui::commands com, const bool& shift)
{
switch (com)
{
case Play:
case bugui::Play:
if (shift)
doc.app.actions.action<Actions::PlayGlobal>().action()->trigger();
else
doc.app.actions.action<Actions::Play>().action()->trigger();
break;
case Stop:
case bugui::Stop:
if (shift)
doc.app.actions.action<Actions::Reinitialize>().action()->trigger();
else
doc.app.actions.action<Actions::Stop>().action()->trigger();
break;
case Up:
case bugui::Up:
if (shift)
{
v_zoom += .2;
@ -37,7 +37,7 @@ Controller::Controller(const score::DocumentContext& doc)
draw_intervals();
}
break;
case Down:
case bugui::Down:
if (shift)
{
if (v_zoom > .2)
@ -52,7 +52,7 @@ Controller::Controller(const score::DocumentContext& doc)
draw_intervals();
}
break;
case Left:
case bugui::Left:
if (shift)
{
if (h_zoom > .02)
@ -70,7 +70,7 @@ Controller::Controller(const score::DocumentContext& doc)
}
}
break;
case Right:
case bugui::Right:
if (shift)
{
h_zoom += .02;
@ -120,7 +120,8 @@ void Controller::draw_intervals()
// Copied from MiniscenarioView
auto& skin = Process::Style::instance();
// set_stroke_color();
const auto col = skin.IntervalBase().color();
set_color(col.redF(), col.greenF(), col.blackF(), col.alphaF());
for(const Scenario::IntervalModel& c : scenar->intervals)
{

View file

@ -5,12 +5,12 @@
#include <Scenario/Document/Interval/IntervalModel.hpp>
#include <Scenario/Process/ScenarioModel.hpp>
#include <controller.hpp>
#include <painter.hpp>
namespace Hardware
{
class SCORE_ADDON_HARDWARE_EXPORT Controller
: public bugui::controller
: public bugui::painter
, public QObject
{
W_OBJECT(Controller)