mirror of https://github.com/odrling/Aegisub
Added options to change colors of grid
Originally committed to SVN as r95.
This commit is contained in:
parent
c42d2b4a4c
commit
cbc7b57669
|
@ -266,12 +266,12 @@ void BaseGrid::DrawImage(wxDC &dc) {
|
||||||
dc.SetFont(font);
|
dc.SetFont(font);
|
||||||
|
|
||||||
// Clear background
|
// Clear background
|
||||||
dc.SetBackground(wxBrush(wxColour(255,255,255)));
|
dc.SetBackground(wxBrush(Options.AsColour(_T("Grid Background"))));
|
||||||
dc.Clear();
|
dc.Clear();
|
||||||
|
|
||||||
// Draw labels
|
// Draw labels
|
||||||
dc.SetPen(*wxTRANSPARENT_PEN);
|
dc.SetPen(*wxTRANSPARENT_PEN);
|
||||||
dc.SetBrush(wxBrush(wxColour(196,236,201)));
|
dc.SetBrush(wxBrush(Options.AsColour(_T("Grid left column"))));
|
||||||
dc.DrawRectangle(0,lineHeight,colWidth[0],h-lineHeight);
|
dc.DrawRectangle(0,lineHeight,colWidth[0],h-lineHeight);
|
||||||
|
|
||||||
// Visible lines
|
// Visible lines
|
||||||
|
@ -282,10 +282,10 @@ void BaseGrid::DrawImage(wxDC &dc) {
|
||||||
// Row colors
|
// Row colors
|
||||||
std::vector<wxBrush> rowColors;
|
std::vector<wxBrush> rowColors;
|
||||||
std::vector<wxColor> foreColors;
|
std::vector<wxColor> foreColors;
|
||||||
rowColors.push_back(wxBrush(wxColour(255,255,255))); // 0 = Standard
|
rowColors.push_back(wxBrush(Options.AsColour(_T("Grid Background")))); // 0 = Standard
|
||||||
foreColors.push_back(wxColour(0,0,0));
|
foreColors.push_back(Options.AsColour(_T("Grid standard foreground")));
|
||||||
rowColors.push_back(wxBrush(wxColour(165,207,231))); // 1 = Header
|
rowColors.push_back(wxBrush(Options.AsColour(_T("Grid Header")))); // 1 = Header
|
||||||
foreColors.push_back(wxColour(0,0,0));
|
foreColors.push_back(Options.AsColour(_T("Grid standard foreground")));
|
||||||
rowColors.push_back(wxBrush(Options.AsColour(_T("Grid selection background")))); // 2 = Selected
|
rowColors.push_back(wxBrush(Options.AsColour(_T("Grid selection background")))); // 2 = Selected
|
||||||
foreColors.push_back(Options.AsColour(_T("Grid selection foreground")));
|
foreColors.push_back(Options.AsColour(_T("Grid selection foreground")));
|
||||||
rowColors.push_back(wxBrush(Options.AsColour(_T("Grid comment background")))); // 3 = Commented
|
rowColors.push_back(wxBrush(Options.AsColour(_T("Grid comment background")))); // 3 = Commented
|
||||||
|
@ -298,7 +298,7 @@ void BaseGrid::DrawImage(wxDC &dc) {
|
||||||
// First grid row
|
// First grid row
|
||||||
bool drawGrid = true;
|
bool drawGrid = true;
|
||||||
if (drawGrid) {
|
if (drawGrid) {
|
||||||
dc.SetPen(wxPen(wxColour(128,128,128)));
|
dc.SetPen(wxPen(Options.AsColour(_T("Grid lines"))));
|
||||||
dc.DrawLine(0,0,w,0);
|
dc.DrawLine(0,0,w,0);
|
||||||
dc.SetPen(*wxTRANSPARENT_PEN);
|
dc.SetPen(*wxTRANSPARENT_PEN);
|
||||||
}
|
}
|
||||||
|
@ -414,7 +414,7 @@ void BaseGrid::DrawImage(wxDC &dc) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set text color
|
// Set text color
|
||||||
if (collides) dc.SetTextForeground(wxColour(255,0,0));
|
if (collides) dc.SetTextForeground(Options.AsColour(_T("Grid collision foreground")));
|
||||||
else {
|
else {
|
||||||
dc.SetTextForeground(foreColors[curColor]);
|
dc.SetTextForeground(foreColors[curColor]);
|
||||||
}
|
}
|
||||||
|
@ -442,7 +442,7 @@ void BaseGrid::DrawImage(wxDC &dc) {
|
||||||
// Draw grid
|
// Draw grid
|
||||||
dc.DestroyClippingRegion();
|
dc.DestroyClippingRegion();
|
||||||
if (drawGrid) {
|
if (drawGrid) {
|
||||||
dc.SetPen(wxPen(wxColour(128,128,128)));
|
dc.SetPen(wxPen(Options.AsColour(_T("Grid lines"))));
|
||||||
dc.DrawLine(0,dy+lineHeight,w,dy+lineHeight);
|
dc.DrawLine(0,dy+lineHeight,w,dy+lineHeight);
|
||||||
dc.SetPen(*wxTRANSPARENT_PEN);
|
dc.SetPen(*wxTRANSPARENT_PEN);
|
||||||
}
|
}
|
||||||
|
@ -451,7 +451,7 @@ void BaseGrid::DrawImage(wxDC &dc) {
|
||||||
// Draw grid columns
|
// Draw grid columns
|
||||||
dx = 0;
|
dx = 0;
|
||||||
if (drawGrid) {
|
if (drawGrid) {
|
||||||
dc.SetPen(wxPen(wxColour(128,128,128)));
|
dc.SetPen(wxPen(Options.AsColour(_T("Grid lines"))));
|
||||||
for (int i=0;i<10;i++) {
|
for (int i=0;i<10;i++) {
|
||||||
dx += colWidth[i];
|
dx += colWidth[i];
|
||||||
dc.DrawLine(dx,0,dx,maxH);
|
dc.DrawLine(dx,0,dx,maxH);
|
||||||
|
@ -461,7 +461,7 @@ void BaseGrid::DrawImage(wxDC &dc) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Draw currently active line border
|
// Draw currently active line border
|
||||||
dc.SetPen(wxPen(wxColour(255,91,239)));
|
dc.SetPen(wxPen(Options.AsColour(_T("Grid Active border"))));
|
||||||
dc.SetBrush(*wxTRANSPARENT_BRUSH);
|
dc.SetBrush(*wxTRANSPARENT_BRUSH);
|
||||||
dy = (editBox->linen+1-yPos) * lineHeight;
|
dy = (editBox->linen+1-yPos) * lineHeight;
|
||||||
dc.DrawRectangle(0,dy,w,lineHeight+1);
|
dc.DrawRectangle(0,dy,w,lineHeight+1);
|
||||||
|
|
|
@ -40,6 +40,7 @@
|
||||||
#include <wx/filename.h>
|
#include <wx/filename.h>
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
#include <wx/intl.h>
|
#include <wx/intl.h>
|
||||||
|
#include <wx/settings.h>
|
||||||
#include "options.h"
|
#include "options.h"
|
||||||
#include "main.h"
|
#include "main.h"
|
||||||
#include "text_file_reader.h"
|
#include "text_file_reader.h"
|
||||||
|
@ -107,11 +108,19 @@ void OptionsManager::LoadDefaults() {
|
||||||
SetInt(_T("Find Affect"),0);
|
SetInt(_T("Find Affect"),0);
|
||||||
SetInt(_T("Find Field"),0);
|
SetInt(_T("Find Field"),0);
|
||||||
|
|
||||||
|
SetColour(_T("Grid standard foreground"),wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT));
|
||||||
SetColour(_T("Grid selection background"),wxColour(206,255,231));
|
SetColour(_T("Grid selection background"),wxColour(206,255,231));
|
||||||
SetColour(_T("Grid selection foreground"),wxColour(0,0,0));
|
SetColour(_T("Grid selection foreground"),wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT));
|
||||||
SetColour(_T("Grid comment background"),wxColour(216,222,245));
|
SetColour(_T("Grid comment background"),wxColour(216,222,245));
|
||||||
|
SetColour(_T("Grid collision foreground"),wxColour(255,0,0));
|
||||||
SetColour(_T("Grid selected comment background"),wxColour(211,238,238));
|
SetColour(_T("Grid selected comment background"),wxColour(211,238,238));
|
||||||
SetColour(_T("Grid inframe background"),wxColour(255,253,234));
|
SetColour(_T("Grid inframe background"),wxColour(255,253,234));
|
||||||
|
SetColour(_T("Grid background"),wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW));
|
||||||
|
SetColour(_T("Grid header"),wxColour(165,207,231));
|
||||||
|
SetColour(_T("Grid left column"),wxColour(196,236,201));
|
||||||
|
SetColour(_T("Grid active border"),wxColour(255,91,239));
|
||||||
|
SetColour(_T("Grid lines"),wxColour(128,128,128));
|
||||||
|
|
||||||
SetInt(_T("Grid hide overrides"),1);
|
SetInt(_T("Grid hide overrides"),1);
|
||||||
wchar_t temp = 0x2600;
|
wchar_t temp = 0x2600;
|
||||||
SetText(_T("Grid hide overrides char"),temp);
|
SetText(_T("Grid hide overrides char"),temp);
|
||||||
|
|
Loading…
Reference in New Issue