Theme updates

This commit is contained in:
Charles J. Cliffe 2015-01-15 00:59:33 -05:00
parent b641f1200e
commit 15347bd791
11 changed files with 88 additions and 22 deletions

View File

@ -55,6 +55,10 @@ DefaultColorTheme::DefaultColorTheme() {
freqLine = RGBColor(1, 1, 1);
button = RGBColor(0.65, 0.65, 0.65);
buttonHighlight = RGBColor(1, 1, 0);
scopeBackground = RGBColor(0.1, 0.1, 0.1);
fftBackground = RGBColor(0.1, 0.1, 0.1);
generalBackground = RGBColor(0.1, 0.1, 0.1);
}
BlackAndWhiteColorTheme::BlackAndWhiteColorTheme() {
@ -63,20 +67,25 @@ BlackAndWhiteColorTheme::BlackAndWhiteColorTheme() {
waterfallGradient.addColor(GradientColor(0.75, 0.75, 0.75));
waterfallGradient.addColor(GradientColor(1.0, 1.0, 1.0));
waterfallGradient.generate(256);
waterfallHighlight = RGBColor(1, 1, 1);
waterfallHighlight = RGBColor(1, 1, 0.9);
waterfallNew = RGBColor(0, 1, 0);
waterfallHover = RGBColor(1, 1, 0);
waterfallDestroy = RGBColor(1, 0, 0);
fftLine = RGBColor(0.9, 0.9, 0.9);
fftHighlight = RGBColor(1, 1, 1);
fftHighlight = RGBColor(1, 1, 0.9);
scopeLine = RGBColor(0.9, 0.9, 0.9);
tuningBar = RGBColor(0.2, 0.2, 0.9);
meterLevel = RGBColor(0, 1, 0);
meterValue = RGBColor(1, 0, 0);
tuningBar = RGBColor(0.4, 0.4, 0.4);
meterLevel = RGBColor(0.5, 0.5, 0.5);
meterValue = RGBColor(0.5, 0.5, 0.5);
text = RGBColor(1, 1, 1);
freqLine = RGBColor(1, 1, 1);
button = RGBColor(0.65, 0.65, 0.65);
buttonHighlight = RGBColor(1, 1, 0);
buttonHighlight = RGBColor(1, 1, 1);
scopeBackground = RGBColor(0.1, 0.1, 0.1);
fftBackground = RGBColor(0.1, 0.1, 0.1);
generalBackground = RGBColor(0.1, 0.1, 0.1);
}
SharpColorTheme::SharpColorTheme() {
@ -107,6 +116,10 @@ SharpColorTheme::SharpColorTheme() {
freqLine = RGBColor(0.9, 0.9, 1);
button = RGBColor(217.0/255.0,218.0/255.0,228.0/255.0);
buttonHighlight= RGBColor(208.0/255.0,249.0/255.0,255.0/255.0);
scopeBackground = RGBColor(0.05, 0.05, 0.15);
fftBackground = RGBColor(0.05, 0.05, 0.15);
generalBackground = RGBColor(0.05, 0.05, 0.15);
}
RadColorTheme::RadColorTheme() {
@ -198,15 +211,19 @@ RadarColorTheme::RadarColorTheme() {
waterfallNew = RGBColor(0, 1, 0);
waterfallHover = RGBColor(1, 1, 0);
waterfallDestroy = RGBColor(1, 0, 0);
fftLine = RGBColor(0.9, 0.9, 0.9);
fftLine = RGBColor(0.8, 1.0, 0.8);
fftHighlight = RGBColor(1, 1, 1);
scopeLine = RGBColor(0.9, 0.9, 0.9);
tuningBar = RGBColor(0.2, 0.2, 0.9);
meterLevel = RGBColor(0, 1, 0);
meterValue = RGBColor(1, 0, 0);
text = RGBColor(1, 1, 1);
scopeLine = RGBColor(0.8, 1.0, 0.8);
tuningBar = RGBColor(0.2, 0.9, 0.2);
meterLevel = RGBColor(0, 0.5, 0);
meterValue = RGBColor(0, 0.5, 0);
text = RGBColor(0.8, 1.0, 0.8);
freqLine = RGBColor(1, 1, 1);
button = RGBColor(0.65, 0.65, 0.65);
buttonHighlight = RGBColor(1, 1, 0);
button = RGBColor(0.65, 0.75, 0.65);
buttonHighlight = RGBColor(0.65, 1.0, 0.65);
scopeBackground = RGBColor(0.05, 0.1, 0.05);
fftBackground = RGBColor(0.05, 0.1, 0.05);
generalBackground = RGBColor(0.05, 0.1, 0.05);
}

View File

@ -55,6 +55,10 @@ public:
RGBColor button;
RGBColor buttonHighlight;
RGBColor scopeBackground;
RGBColor fftBackground;
RGBColor generalBackground;
Gradient waterfallGradient;
std::string name;

View File

@ -1,5 +1,6 @@
#include "MeterContext.h"
#include "MeterCanvas.h"
#include "ColorTheme.h"
MeterContext::MeterContext(MeterCanvas *canvas, wxGLContext *sharedContext) :
PrimaryGLContext(canvas, sharedContext) {
@ -11,6 +12,7 @@ MeterContext::MeterContext(MeterCanvas *canvas, wxGLContext *sharedContext) :
}
void MeterContext::DrawBegin() {
glClearColor(ThemeMgr::mgr.currentTheme->generalBackground.r, ThemeMgr::mgr.currentTheme->generalBackground.g, ThemeMgr::mgr.currentTheme->generalBackground.b, 1.0);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glMatrixMode(GL_MODELVIEW);
@ -22,12 +24,23 @@ void MeterContext::DrawBegin() {
void MeterContext::Draw(float r, float g, float b, float a, float level) {
glEnable(GL_BLEND);
glBlendFunc(GL_ONE, GL_ONE);
glColor4f(r, g, b, a);
glBegin(GL_QUADS);
glVertex2f(1.0, -1.0 + 2.0 * level);
glColor4f(r*0.65,g*0.65,b*0.65,a);
glVertex2f(-1.0, -1.0 + 2.0 * level);
glVertex2f(-1.0, -1.0);
glColor4f(r,g,b,a);
glVertex2f(0.0, -1.0);
glVertex2f(0.0, -1.0 + 2.0 * level);
glColor4f(r,g,b,a);
glVertex2f(0.0, -1.0 + 2.0 * level);
glVertex2f(0.0, -1.0);
glColor4f(r*0.65,g*0.65,b*0.65,a*0.65);
glVertex2f(1.0, -1.0);
glVertex2f(1.0, -1.0 + 2.0 * level);
glEnd();
glDisable(GL_BLEND);
}

View File

@ -1,5 +1,7 @@
#include "ModeSelectorContext.h"
#include "ModeSelectorCanvas.h"
#include "ColorTheme.h"
ModeSelectorContext::ModeSelectorContext(ModeSelectorCanvas *canvas, wxGLContext *sharedContext) :
PrimaryGLContext(canvas, sharedContext) {
@ -11,6 +13,7 @@ ModeSelectorContext::ModeSelectorContext(ModeSelectorCanvas *canvas, wxGLContext
}
void ModeSelectorContext::DrawBegin() {
glClearColor(ThemeMgr::mgr.currentTheme->generalBackground.r, ThemeMgr::mgr.currentTheme->generalBackground.g, ThemeMgr::mgr.currentTheme->generalBackground.b,1.0);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glMatrixMode(GL_MODELVIEW);

View File

@ -312,7 +312,8 @@ void PrimaryGLContext::DrawFreqSelector(float uxPos, float r, float g, float b,
}
void PrimaryGLContext::BeginDraw() {
void PrimaryGLContext::BeginDraw(float r, float g, float b) {
glClearColor(r,g,b, 1);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glMatrixMode(GL_MODELVIEW);

View File

@ -20,7 +20,7 @@ public:
static wxString glGetwxString(GLenum name);
static void CheckGLError();
void BeginDraw();
void BeginDraw(float r, float g, float b);
void EndDraw();
void DrawFreqSelector(float uxPos, float r = 1, float g = 1, float b = 1, float w = 0, long long center_freq = -1, long long srate = 0);

View File

@ -13,6 +13,7 @@ ScopeContext::ScopeContext(ScopeCanvas *canvas, wxGLContext *sharedContext) :
}
void ScopeContext::DrawBegin() {
glClearColor(ThemeMgr::mgr.currentTheme->scopeBackground.r, ThemeMgr::mgr.currentTheme->scopeBackground.g, ThemeMgr::mgr.currentTheme->scopeBackground.b, 1.0);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glMatrixMode(GL_MODELVIEW);
@ -22,6 +23,21 @@ void ScopeContext::DrawBegin() {
}
void ScopeContext::Plot(std::vector<float> &points, bool stereo) {
glBegin(GL_QUADS);
glColor3f(ThemeMgr::mgr.currentTheme->scopeBackground.r*2.0, ThemeMgr::mgr.currentTheme->scopeBackground.g*2.0, ThemeMgr::mgr.currentTheme->scopeBackground.b*2.0);
glVertex2f(1, 1);
glVertex2f(-1, 1);
glColor3f(ThemeMgr::mgr.currentTheme->scopeBackground.r, ThemeMgr::mgr.currentTheme->scopeBackground.g, ThemeMgr::mgr.currentTheme->scopeBackground.b);
glVertex2f(-1, 0);
glVertex2f(1, 0);
glVertex2f(-1, 0);
glVertex2f(1, 0);
glColor3f(ThemeMgr::mgr.currentTheme->scopeBackground.r*2.0, ThemeMgr::mgr.currentTheme->scopeBackground.g*2.0, ThemeMgr::mgr.currentTheme->scopeBackground.b*2.0);
glVertex2f(1, -1);
glVertex2f(-1, -1);
glEnd();
glColor3f(1.0, 1.0, 1.0);
if (stereo) {
@ -30,7 +46,7 @@ void ScopeContext::Plot(std::vector<float> &points, bool stereo) {
glVertex2f(-1.0, 0.0);
glVertex2f(1.0, 0.0);
glEnd();
glColor3f(0.3, 0.3, 0.3);
glColor3f(ThemeMgr::mgr.currentTheme->scopeLine.r*0.35, ThemeMgr::mgr.currentTheme->scopeLine.g*0.35, ThemeMgr::mgr.currentTheme->scopeLine.b*0.35);
glBegin(GL_LINES);
glVertex2f(-1.0, 0.5);
glVertex2f(1.0, 0.5);
@ -38,7 +54,7 @@ void ScopeContext::Plot(std::vector<float> &points, bool stereo) {
glVertex2f(1.0, -0.5);
glEnd();
} else {
glColor3f(0.3, 0.3, 0.3);
glColor3f(ThemeMgr::mgr.currentTheme->scopeLine.r*0.35, ThemeMgr::mgr.currentTheme->scopeLine.g*0.35, ThemeMgr::mgr.currentTheme->scopeLine.b*0.35);
glBegin(GL_LINES);
glVertex2f(-1.0, 0.0);
glVertex2f(1.0, 0.0);

View File

@ -72,7 +72,7 @@ void SpectrumCanvas::OnPaint(wxPaintEvent& WXUNUSED(event)) {
glContext->SetCurrent(*this);
glViewport(0, 0, ClientSize.x, ClientSize.y);
glContext->BeginDraw();
glContext->BeginDraw(ThemeMgr::mgr.currentTheme->fftBackground.r, ThemeMgr::mgr.currentTheme->fftBackground.g, ThemeMgr::mgr.currentTheme->fftBackground.b);
glContext->Draw(spectrum_points, getCenterFrequency(), getBandwidth());
std::vector<DemodulatorInstance *> &demods = wxGetApp().getDemodMgr().getDemodulators();

View File

@ -18,6 +18,16 @@ SpectrumContext::SpectrumContext(SpectrumCanvas *canvas, wxGLContext *sharedCont
void SpectrumContext::Draw(std::vector<float> &points, long long freq, int bandwidth) {
glBegin(GL_QUADS);
glColor3f(ThemeMgr::mgr.currentTheme->fftBackground.r*2.0, ThemeMgr::mgr.currentTheme->fftBackground.g*2.0, ThemeMgr::mgr.currentTheme->fftBackground.b*2.0);
glVertex2f(1, 1);
glVertex2f(-1, 1);
glColor3f(ThemeMgr::mgr.currentTheme->fftBackground.r, ThemeMgr::mgr.currentTheme->fftBackground.g, ThemeMgr::mgr.currentTheme->fftBackground.b);
glVertex2f(-1, -0.5);
glVertex2f(1, -0.5);
glEnd();
glDisable(GL_TEXTURE_2D);
glColor3f(ThemeMgr::mgr.currentTheme->fftLine.r, ThemeMgr::mgr.currentTheme->fftLine.g, ThemeMgr::mgr.currentTheme->fftLine.b);
@ -75,6 +85,7 @@ void SpectrumContext::Draw(std::vector<float> &points, long long freq, int bandw
glVertex2f(m, 1);
glEnd();
glColor4f(ThemeMgr::mgr.currentTheme->text.r, ThemeMgr::mgr.currentTheme->text.g, ThemeMgr::mgr.currentTheme->text.b,1.0);
getFont(PrimaryGLContext::GLFONT_SIZE12).drawString(label.str(), m, hPos, 12, GLFont::GLFONT_ALIGN_CENTER, GLFont::GLFONT_ALIGN_CENTER);
label.str(std::string());

View File

@ -28,6 +28,7 @@ TuningContext::TuningContext(TuningCanvas *canvas, wxGLContext *sharedContext) :
}
void TuningContext::DrawBegin() {
glClearColor(ThemeMgr::mgr.currentTheme->generalBackground.r, ThemeMgr::mgr.currentTheme->generalBackground.g, ThemeMgr::mgr.currentTheme->generalBackground.b, 1.0);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glMatrixMode(GL_MODELVIEW);

View File

@ -95,7 +95,7 @@ void WaterfallCanvas::OnPaint(wxPaintEvent& WXUNUSED(event)) {
glContext->SetCurrent(*this);
glViewport(0, 0, ClientSize.x, ClientSize.y);
glContext->BeginDraw();
glContext->BeginDraw(0,0,0);
glContext->Draw(spectrum_points);
std::vector<DemodulatorInstance *> &demods = wxGetApp().getDemodMgr().getDemodulators();