2
0
Fork 0
OPL/Source/OPLLookAndFeel.cpp
2017-03-04 12:44:56 +09:00

38 lines
1.2 KiB
C++

/*
==============================================================================
OPLLookAndFeel.cpp
Created: 10 Oct 2016 9:38:20pm
Author: bruce
==============================================================================
*/
#include "OPLLookAndFeel.h"
#include "PluginGui.h"
OPLLookAndFeel::OPLLookAndFeel()
{
toggleOff = ImageCache::getFromMemory(PluginGui::toggle_off_sq_png, PluginGui::toggle_off_sq_pngSize), 1.000f, Colour(0x00000000);
toggleOn = ImageCache::getFromMemory(PluginGui::toggle_on_sq_png, PluginGui::toggle_on_sq_pngSize), 1.000f, Colour(0x00000000);
toggleRect = Rectangle<float>((float)toggleOff.getWidth(), (float)toggleOn.getHeight());
// Prevents an ugly white border from being drawn around a component with keyboard focus.
setColour(TextEditor::ColourIds::focusedOutlineColourId, Colours::black);
setColour(Slider::ColourIds::textBoxOutlineColourId, Colour(0xff007f00));
}
void OPLLookAndFeel::drawTickBox(Graphics &g,
Component &c,
float x,
float y,
float w,
float h,
bool ticked,
bool isEnabled,
bool isMouseOverButton,
bool isButtonDown
) {
g.drawImage(ticked ? toggleOn : toggleOff, toggleRect.withY(y + 2));
}