mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-11 05:07:00 -04:00
Switch (back) to our own Color type instead of using wxColour.
The reason is that wxColour's default constructor creates an invalid color (what is that even?). It is nicer to just have default be transparent.
This commit is contained in:
@@ -40,7 +40,7 @@ void AboutWindow::draw(DC& dc) {
|
||||
wxSize ws = GetClientSize();
|
||||
// draw background
|
||||
dc.SetPen (*wxTRANSPARENT_PEN);
|
||||
dc.SetBrush(Color(240,247,255));
|
||||
dc.SetBrush(wxColor(240,247,255));
|
||||
dc.DrawRectangle(0, 0, ws.GetWidth(), ws.GetHeight());
|
||||
// draw logo
|
||||
dc.DrawBitmap(logo, (ws.GetWidth() - logo.GetWidth()) / 2, 5);
|
||||
@@ -48,11 +48,11 @@ void AboutWindow::draw(DC& dc) {
|
||||
dc.DrawBitmap(logo2, ws.GetWidth() - logo2.GetWidth(), ws.GetHeight() - logo2.GetHeight());
|
||||
#endif
|
||||
// draw version box
|
||||
dc.SetPen (wxPen(Color(184,29,19), 2));
|
||||
dc.SetBrush(Color(114,197,224));
|
||||
dc.SetPen (wxPen(wxColor(184,29,19), 2));
|
||||
dc.SetBrush(wxColor(114,197,224));
|
||||
dc.DrawRectangle(28, 104, 245, 133);
|
||||
dc.SetTextBackground(Color(114,197,224));
|
||||
dc.SetTextForeground(Color(0,0,0));
|
||||
dc.SetTextBackground(wxColor(114,197,224));
|
||||
dc.SetTextForeground(wxColor(0,0,0));
|
||||
// draw version info
|
||||
dc.SetFont(wxFont(9, wxFONTFAMILY_SWISS, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL, false, _("Arial")));
|
||||
dc.DrawText(_("Version: ") + app_version.toString() + version_suffix, 34, 110);
|
||||
@@ -202,7 +202,7 @@ void HoverButton::draw(DC& dc) {
|
||||
// clear background (for transparent button images)
|
||||
wxSize ws = GetClientSize();
|
||||
dc.SetPen(*wxTRANSPARENT_PEN);
|
||||
dc.SetBrush(background != wxNullColour ? background : wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE));
|
||||
dc.SetBrush(wxBrush(background.Alpha()>0 ? wxColour(background) : wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE)));
|
||||
dc.DrawRectangle(0, 0, ws.GetWidth(), ws.GetHeight());
|
||||
// draw button
|
||||
dc.DrawBitmap(*toDraw(), 0, 0, true);
|
||||
|
||||
@@ -310,7 +310,7 @@ void GalleryList::OnDraw(DC& dc) {
|
||||
}
|
||||
#else
|
||||
Color c = selected ? ( focused
|
||||
? wxSystemSettings::GetColour(wxSYS_COLOUR_HIGHLIGHT)
|
||||
? Color(wxSystemSettings::GetColour(wxSYS_COLOUR_HIGHLIGHT))
|
||||
: lerp(wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW),
|
||||
wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT), subcolumnActivity(j))
|
||||
)
|
||||
|
||||
@@ -44,7 +44,7 @@ CardsPanel::CardsPanel(Window* parent, int id)
|
||||
card_list = new FilteredImageCardList(splitter, ID_CARD_LIST);
|
||||
nodes_panel = new wxPanel(splitter, wxID_ANY);
|
||||
notes = new TextCtrl(nodes_panel, ID_NOTES, true);
|
||||
collapse_notes = new HoverButton(nodes_panel, ID_COLLAPSE_NOTES, _("btn_collapse"), wxNullColour, false);
|
||||
collapse_notes = new HoverButton(nodes_panel, ID_COLLAPSE_NOTES, _("btn_collapse"), Color(), false);
|
||||
collapse_notes->SetExtraStyle(wxWS_EX_PROCESS_UI_UPDATES);
|
||||
filter = nullptr;
|
||||
editor->next_in_tab_order = card_list;
|
||||
|
||||
@@ -260,7 +260,7 @@ void StatDimensionList::drawItem(DC& dc, int x, int y, size_t item) {
|
||||
int cx = x + subcolumns[j].offset.x + subcolumns[j].size.x/2;
|
||||
int cy = y + subcolumns[j].offset.y + subcolumns[j].size.y/2;
|
||||
dc.SetPen(*wxTRANSPARENT_PEN);
|
||||
dc.SetBrush(prefered ? wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT)
|
||||
dc.SetBrush(prefered ? Color(wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT))
|
||||
: lerp(wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT),wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW),0.5));
|
||||
dc.DrawCircle(cx,cy,6);
|
||||
}
|
||||
|
||||
@@ -151,6 +151,6 @@ void ColorValueEditor::change(const Defaultable<Color>& c) {
|
||||
addAction(value_action(valueP(), c));
|
||||
}
|
||||
void ColorValueEditor::changeCustom() {
|
||||
Color c = wxGetColourFromUser(0, value().value());
|
||||
if (c.Ok()) change(c);
|
||||
wxColour c = wxGetColourFromUser(0, value().value());
|
||||
if (c.Ok()) change(Color(c));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user