initial: added first widget
This commit is contained in:
51
Source/LookAndFeel.h
Normal file
51
Source/LookAndFeel.h
Normal file
@@ -0,0 +1,51 @@
|
||||
//
|
||||
// LookAndFeel.h
|
||||
// lampshade
|
||||
//
|
||||
// Created by Veit Heller on 19.06.17.
|
||||
//
|
||||
//
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "../JuceLibraryCode/JuceHeader.h"
|
||||
|
||||
class LampshadeLookAndFeel : public LookAndFeel_V4 {
|
||||
public:
|
||||
void drawLinearSlider (Graphics& g,
|
||||
int x,
|
||||
int y,
|
||||
int width,
|
||||
int height,
|
||||
float sliderPos,
|
||||
float minSliderPos,
|
||||
float maxSliderPos,
|
||||
const Slider::SliderStyle s,
|
||||
Slider& slider) override
|
||||
{
|
||||
g.setColour(fillColor);
|
||||
g.fillRect((int)(x-minSliderPos), y, (int)(width+minSliderPos+maxSliderPos), height);
|
||||
drawLinearSliderThumb(g, x, y, width, height, sliderPos, minSliderPos, maxSliderPos, s, slider);
|
||||
}
|
||||
|
||||
void drawLinearSliderThumb(Graphics & g,
|
||||
int x,
|
||||
int y,
|
||||
int width,
|
||||
int height,
|
||||
float sliderPos,
|
||||
float minSliderPos,
|
||||
float maxSliderPos,
|
||||
const Slider::SliderStyle ,
|
||||
Slider& slider) override {
|
||||
g.setColour(sliderColor);
|
||||
int nwidth = width+minSliderPos+maxSliderPos;
|
||||
g.fillRect((int)(x-minSliderPos), y, (int)(nwidth*((sliderPos-minSliderPos)/width)), height);
|
||||
}
|
||||
|
||||
Label* createSliderTextBox(Slider&) override { return nullptr; }
|
||||
|
||||
private:
|
||||
Colour fillColor = Colours::yellow;
|
||||
Colour sliderColor = Colours::red;
|
||||
};
|
Reference in New Issue
Block a user