Dark mode

This commit is contained in:
GenevensiS
2025-10-09 17:57:20 +02:00
committed by GitHub
parent 78b93e5701
commit 513612cd0e
76 changed files with 323 additions and 144 deletions
+3 -3
View File
@@ -15,8 +15,8 @@
// ----------------------------------------------------------------------------- : About window
AboutWindow::AboutWindow(Window* parent)
: wxDialog(parent, wxID_ANY, _TITLE_("about"), wxDefaultPosition, wxSize(510,460), wxCLIP_CHILDREN | wxDEFAULT_DIALOG_STYLE | wxTAB_TRAVERSAL)
, logo(load_resource_image(_("about")))
: wxDialog(parent, wxID_ANY, _TITLE_("about"), wxDefaultPosition, wxSize(510,340), wxCLIP_CHILDREN | wxDEFAULT_DIALOG_STYLE | wxTAB_TRAVERSAL)
, logo(load_resource_image(settings.darkModePrefix() + _("about")))
{
// init controls
wxControl* ok_button = new HoverButton(this, wxID_OK, _("btn_ok"));
@@ -47,7 +47,7 @@ void AboutWindow::draw(DC& dc) {
wxSize ws = GetClientSize();
// draw background
dc.SetPen (*wxTRANSPARENT_PEN);
dc.SetBrush(wxColor(240,247,255));
dc.SetBrush(settings.darkModeColor());
dc.DrawRectangle(0, 0, ws.GetWidth(), ws.GetHeight());
// draw logo
dc.DrawBitmap(logo, (ws.GetWidth() - logo.GetWidth()) / 2, 5);
+2 -1
View File
@@ -9,6 +9,7 @@
// ----------------------------------------------------------------------------- : Includes
#include <util/prec.hpp>
#include <data/settings.hpp>
// ----------------------------------------------------------------------------- : About window
@@ -79,7 +80,7 @@ public:
/** name+"_normal", name+"_hover", name+"_focus", name+"_down"
* are the resource names of the images used.
*/
HoverButton(Window* parent, int id, const String& name, const Color& background = Color(240,247,255), bool accepts_focus = true);
HoverButton(Window* parent, int id, const String& name, const Color& background = settings.darkModeColor(), bool accepts_focus = true);
/// Load different bitmaps for this button
void loadBitmaps(const String& name);
+1 -1
View File
@@ -487,7 +487,7 @@ void DataEditor::onChar(wxKeyEvent& ev) {
void DataEditor::onContextMenu(wxContextMenuEvent& ev) {
if (current_editor) {
wxMenu m;
add_menu_item_tr(&m, ID_EDIT_CUT, "cut", "cut");
add_menu_item_tr(&m, ID_EDIT_CUT, settings.darkModePrefix() + "cut", "cut");
add_menu_item_tr(&m, ID_EDIT_COPY, "copy", "copy");
add_menu_item_tr(&m, ID_EDIT_PASTE, "paste", "paste");
m.Enable(ID_EDIT_CUT, canCut());
+1 -1
View File
@@ -456,7 +456,7 @@ void CardListBase::onDrag(wxMouseEvent& ev) {
void CardListBase::onContextMenu(wxContextMenuEvent&) {
if (allowModify()) {
wxMenu m;
add_menu_item_tr(&m, wxID_CUT, "cut", "cut_card");
add_menu_item_tr(&m, wxID_CUT, settings.darkModePrefix() + "cut", "cut_card");
add_menu_item_tr(&m, wxID_COPY, "copy", "copy_card");
add_menu_item_tr(&m, ID_CARD_AND_LINK_COPY, "card_copy", "copy card and links");
add_menu_item_tr(&m, wxID_PASTE, "paste", "paste_card");
+1 -1
View File
@@ -242,7 +242,7 @@ wxListItemAttr* KeywordList::OnGetItemAttr(long pos) const {
void KeywordList::onContextMenu(wxContextMenuEvent&) {
wxMenu m;
add_menu_item_tr(&m, ID_EDIT_CUT, "cut", "cut_keyword");
add_menu_item_tr(&m, ID_EDIT_CUT, settings.darkModePrefix() + "cut", "cut_keyword");
add_menu_item_tr(&m, ID_EDIT_COPY, "copy", "copy_keyword");
add_menu_item_tr(&m, ID_EDIT_PASTE, "paste", "paste_keyword");
m.AppendSeparator();
+2 -2
View File
@@ -21,8 +21,8 @@ SelectCardList::SelectCardList(Window* parent, int id, long additional_style)
wxImageList* il = new wxImageList(15,15);
il->Add(load_resource_image(_("sort_asc")), Color(255,0,255));
il->Add(load_resource_image(_("sort_desc")), Color(255,0,255));
il->Add(load_resource_image(_("deselected")));
il->Add(load_resource_image(_("selected")));
il->Add(load_resource_image(settings.darkModePrefix() + _("deselected")));
il->Add(load_resource_image(settings.darkModePrefix() + _("selected")));
AssignImageList(il, wxIMAGE_LIST_SMALL);
}
SelectCardList::~SelectCardList() {}
+15 -4
View File
@@ -39,7 +39,7 @@ public:
void store() override;
private:
wxComboBox* language;
wxComboBox* language, *dark_mode;
wxCheckBox* open_sets_in_new_window;
};
@@ -166,6 +166,7 @@ GlobalPreferencesPage::GlobalPreferencesPage(Window* parent)
// init controls
language = new wxComboBox(this, wxID_ANY, _(""), wxDefaultPosition, wxDefaultSize, 0, nullptr, wxCB_READONLY);
open_sets_in_new_window = new wxCheckBox(this, wxID_ANY, _BUTTON_("open sets in new window"));
dark_mode = new wxComboBox(this, wxID_ANY, _(""), wxDefaultPosition, wxDefaultSize, 0, nullptr, wxCB_READONLY);
// set values
vector<PackagedP> locales;
package_manager.findMatching(_("*.mse-locale"), locales);
@@ -178,18 +179,26 @@ GlobalPreferencesPage::GlobalPreferencesPage(Window* parent)
}
n++;
}
open_sets_in_new_window->SetValue(settings.open_sets_in_new_window);
open_sets_in_new_window->SetValue(settings.open_sets_in_new_window);
dark_mode->Append(_LABEL_("dark mode system"));
dark_mode->Append(_LABEL_("dark mode no"));
dark_mode->Append(_LABEL_("dark mode yes"));
dark_mode->SetSelection((int)settings.dark_mode_type);
// init sizer
wxSizer* s = new wxBoxSizer(wxVERTICAL);
s->SetSizeHints(this);
wxSizer* s2 = new wxStaticBoxSizer(wxVERTICAL, this, _LABEL_("language"));
s2->Add(new wxStaticText(this, wxID_ANY, _LABEL_("app language")), 0, wxALL, 4);
s2->Add(new wxStaticText(this, wxID_ANY, _LABEL_("app language")), 0, wxALL, 4);
s2->Add(language, 0, wxEXPAND | (wxALL & ~wxTOP), 4);
s2->Add(new wxStaticText(this, wxID_ANY, _HELP_( "app language")), 0, wxALL, 4);
s2->Add(new wxStaticText(this, wxID_ANY, _HELP_( "app language")), 0, wxALL, 4);
s->Add(s2, 0, wxEXPAND | wxALL, 8);
wxSizer* s3 = new wxStaticBoxSizer(wxVERTICAL, this, _LABEL_("windows"));
s3->Add(open_sets_in_new_window, 0, wxALL, 4);
s->Add(s3, 0, wxEXPAND | (wxALL & ~wxTOP), 8);
wxSizer* s4 = new wxStaticBoxSizer(wxVERTICAL, this, _LABEL_("dark mode"));
s4->Add(dark_mode, 0, wxEXPAND | (wxALL & ~wxTOP), 4);
s4->Add(new wxStaticText(this, wxID_ANY, _HELP_( "app language")), 0, wxALL, 4);
s->Add(s4, 0, wxEXPAND | wxALL, 8);
SetSizer(s);
}
@@ -202,6 +211,8 @@ void GlobalPreferencesPage::store() {
// set the_locale?
// open_sets_in_new_window
settings.open_sets_in_new_window = open_sets_in_new_window->GetValue();
// dark mode
settings.dark_mode_type = (DarkModeType)dark_mode->GetSelection();
}
// ----------------------------------------------------------------------------- : Preferences page : display
+11 -11
View File
@@ -149,11 +149,11 @@ CardsPanel::CardsPanel(Window* parent, int id)
add_menu_item_tr(menuCard, ID_SELECT_COLUMNS, nullptr, "card_list_columns");
menuFormat = new wxMenu();
add_menu_item_tr(menuFormat, ID_FORMAT_BOLD, "bold", "bold", wxITEM_CHECK);
add_menu_item_tr(menuFormat, ID_FORMAT_ITALIC, "italic", "italic", wxITEM_CHECK);
add_menu_item_tr(menuFormat, ID_FORMAT_UNDERLINE, "underline", "underline", wxITEM_CHECK);
add_menu_item_tr(menuFormat, ID_FORMAT_SYMBOL, "symbol", "symbols", wxITEM_CHECK);
add_menu_item_tr(menuFormat, ID_FORMAT_REMINDER, "reminder", "reminder_text", wxITEM_CHECK);
add_menu_item_tr(menuFormat, ID_FORMAT_BOLD, settings.darkModePrefix() + "bold", "bold", wxITEM_CHECK);
add_menu_item_tr(menuFormat, ID_FORMAT_ITALIC, settings.darkModePrefix() + "italic", "italic", wxITEM_CHECK);
add_menu_item_tr(menuFormat, ID_FORMAT_UNDERLINE, settings.darkModePrefix() + "underline", "underline", wxITEM_CHECK);
add_menu_item_tr(menuFormat, ID_FORMAT_SYMBOL, settings.darkModePrefix() + "symbol", "symbols", wxITEM_CHECK);
add_menu_item_tr(menuFormat, ID_FORMAT_REMINDER, settings.darkModePrefix() + "reminder", "reminder_text", wxITEM_CHECK);
menuFormat->AppendSeparator();
insertSymbolMenu = new wxMenuItem(menuFormat, ID_INSERT_SYMBOL, _MENU_("insert symbol"));
menuFormat->Append(insertSymbolMenu);
@@ -282,11 +282,11 @@ wxMenu* CardsPanel::makeAddCardsSubmenu(bool add_single_card_option) {
void CardsPanel::initUI(wxToolBar* tb, wxMenuBar* mb) {
// Toolbar
add_tool_tr(tb, ID_FORMAT_BOLD, "bold", "bold", false, wxITEM_CHECK);
add_tool_tr(tb, ID_FORMAT_ITALIC, "italic", "italic", false, wxITEM_CHECK);
add_tool_tr(tb, ID_FORMAT_UNDERLINE, "underline", "underline", false, wxITEM_CHECK);
add_tool_tr(tb, ID_FORMAT_SYMBOL, "symbol", "symbols", false, wxITEM_CHECK);
add_tool_tr(tb, ID_FORMAT_REMINDER, "reminder", "reminder_text", false, wxITEM_CHECK);
add_tool_tr(tb, ID_FORMAT_BOLD, settings.darkModePrefix() + "bold", "bold", false, wxITEM_CHECK);
add_tool_tr(tb, ID_FORMAT_ITALIC, settings.darkModePrefix() + "italic", "italic", false, wxITEM_CHECK);
add_tool_tr(tb, ID_FORMAT_UNDERLINE, settings.darkModePrefix() + "underline", "underline", false, wxITEM_CHECK);
add_tool_tr(tb, ID_FORMAT_SYMBOL, settings.darkModePrefix() + "symbol", "symbols", false, wxITEM_CHECK);
add_tool_tr(tb, ID_FORMAT_REMINDER, settings.darkModePrefix() + "reminder", "reminder_text", false, wxITEM_CHECK);
tb->AddSeparator();
toolAddCard = add_tool_tr(tb, ID_CARD_ADD, "card_add", "add_card", false, wxITEM_DROPDOWN);
tb->SetDropdownMenu(ID_CARD_ADD, makeAddCardsSubmenu(true));
@@ -377,7 +377,7 @@ void CardsPanel::onUpdateUI(wxUpdateUIEvent& ev) {
}
case ID_COLLAPSE_NOTES: {
bool collapse = notes->GetSize().y > 0;
collapse_notes->loadBitmaps(collapse ? _("btn_collapse") : _("btn_expand"));
collapse_notes->loadBitmaps(settings.darkModePrefix() + (collapse ? _("btn_collapse") : _("btn_expand")));
collapse_notes->SetHelpText(collapse ? _HELP_("collapse notes") : _HELP_("expand notes"));
break;
}
+10 -10
View File
@@ -34,19 +34,19 @@ void SetInfoPanel::onChangeSet() {
void SetInfoPanel::initUI(wxToolBar* tb, wxMenuBar* mb) {
// Toolbar
add_tool_tr(tb, ID_FORMAT_BOLD, "bold", "bold", false, wxITEM_CHECK);
add_tool_tr(tb, ID_FORMAT_ITALIC, "italic", "italic", false, wxITEM_CHECK);
add_tool_tr(tb, ID_FORMAT_UNDERLINE, "underline", "underline", false, wxITEM_CHECK);
add_tool_tr(tb, ID_FORMAT_SYMBOL, "symbol", "symbols", false, wxITEM_CHECK);
add_tool_tr(tb, ID_FORMAT_REMINDER, "reminder", "reminder_text", false, wxITEM_CHECK);
add_tool_tr(tb, ID_FORMAT_BOLD, settings.darkModePrefix() + "bold", "bold", false, wxITEM_CHECK);
add_tool_tr(tb, ID_FORMAT_ITALIC, settings.darkModePrefix() + "italic", "italic", false, wxITEM_CHECK);
add_tool_tr(tb, ID_FORMAT_UNDERLINE, settings.darkModePrefix() + "underline", "underline", false, wxITEM_CHECK);
add_tool_tr(tb, ID_FORMAT_SYMBOL, settings.darkModePrefix() + "symbol", "symbols", false, wxITEM_CHECK);
add_tool_tr(tb, ID_FORMAT_REMINDER, settings.darkModePrefix() + "reminder", "reminder_text", false, wxITEM_CHECK);
tb->Realize();
// Menus
auto menuFormat = new wxMenu();
add_menu_item_tr(menuFormat, ID_FORMAT_BOLD, "bold", "bold", wxITEM_CHECK);
add_menu_item_tr(menuFormat, ID_FORMAT_ITALIC, "italic", "italic", wxITEM_CHECK);
add_menu_item_tr(menuFormat, ID_FORMAT_UNDERLINE, "underline", "underline", wxITEM_CHECK);
add_menu_item_tr(menuFormat, ID_FORMAT_SYMBOL, "symbol", "symbols", wxITEM_CHECK);
add_menu_item_tr(menuFormat, ID_FORMAT_REMINDER, "reminder", "reminder_text", wxITEM_CHECK);
add_menu_item_tr(menuFormat, ID_FORMAT_BOLD, settings.darkModePrefix() + "bold", "bold", wxITEM_CHECK);
add_menu_item_tr(menuFormat, ID_FORMAT_ITALIC, settings.darkModePrefix() + "italic", "italic", wxITEM_CHECK);
add_menu_item_tr(menuFormat, ID_FORMAT_UNDERLINE, settings.darkModePrefix() + "underline", "underline", wxITEM_CHECK);
add_menu_item_tr(menuFormat, ID_FORMAT_SYMBOL, settings.darkModePrefix() + "symbol", "symbols", wxITEM_CHECK);
add_menu_item_tr(menuFormat, ID_FORMAT_REMINDER, settings.darkModePrefix() + "reminder", "reminder_text", wxITEM_CHECK);
mb->Insert(2, menuFormat, _MENU_("format"));
// focus on editor
editor->SetFocus();
+15 -15
View File
@@ -79,17 +79,17 @@ SetWindow::SetWindow(Window* parent, const SetP& set)
menuBar->Append(menuFile, _MENU_("file"));
auto menuEdit = new wxMenu();
add_menu_item(menuEdit, ID_EDIT_UNDO, "undo", _MENU_1_("undo",wxEmptyString), _HELP_("undo"));
add_menu_item(menuEdit, ID_EDIT_REDO, "redo", _MENU_1_("redo",wxEmptyString), _HELP_("redo"));
add_menu_item(menuEdit, ID_EDIT_UNDO, settings.darkModePrefix() + "undo", _MENU_1_("undo",wxEmptyString), _HELP_("undo"));
add_menu_item(menuEdit, ID_EDIT_REDO, settings.darkModePrefix() + "redo", _MENU_1_("redo",wxEmptyString), _HELP_("redo"));
menuEdit->AppendSeparator();
add_menu_item_tr(menuEdit, ID_EDIT_CUT, "cut", "cut");
add_menu_item_tr(menuEdit, ID_EDIT_CUT, settings.darkModePrefix() + "cut", "cut");
add_menu_item_tr(menuEdit, ID_EDIT_COPY, "copy", "copy");
add_menu_item_tr(menuEdit, ID_EDIT_PASTE, "paste", "paste");
menuEdit->AppendSeparator();
add_menu_item_tr(menuEdit, ID_EDIT_SELECT_ALL, nullptr, "select_all");
menuEdit->AppendSeparator();
add_menu_item_tr(menuEdit, ID_EDIT_FIND, "find", "find");
add_menu_item_tr(menuEdit, ID_EDIT_FIND_NEXT, nullptr, "find_next");
add_menu_item_tr(menuEdit, ID_EDIT_FIND, settings.darkModePrefix() + "find", "find");
add_menu_item_tr(menuEdit, ID_EDIT_FIND_NEXT, settings.darkModePrefix() + "find", "find_next");
add_menu_item_tr(menuEdit, ID_EDIT_REPLACE, nullptr, "replace");
add_menu_item_tr(menuEdit, ID_EDIT_AUTO_REPLACE, nullptr, "auto_replace");
menuEdit->AppendSeparator();
@@ -122,12 +122,12 @@ SetWindow::SetWindow(Window* parent, const SetP& set)
tb->AddSeparator();
add_tool_tr(tb, ID_FILE_EXPORT, "export", "export");
tb->AddSeparator();
add_tool_tr(tb, ID_EDIT_CUT, "cut", "cut");
add_tool_tr(tb, ID_EDIT_CUT, settings.darkModePrefix() + "cut", "cut");
add_tool_tr(tb, ID_EDIT_COPY, "copy", "copy");
add_tool_tr(tb, ID_EDIT_PASTE, "paste", "paste");
tb->AddSeparator();
add_tool(tb, ID_EDIT_UNDO, "undo", {}, _TOOLTIP_1_("undo", {}), _HELP_("undo"));
add_tool(tb, ID_EDIT_REDO, "redo", {}, _TOOLTIP_1_("redo", {}), _HELP_("redo"));
add_tool(tb, ID_EDIT_UNDO, settings.darkModePrefix() + "undo", {}, _TOOLTIP_1_("undo", {}), _HELP_("undo"));
add_tool(tb, ID_EDIT_REDO, settings.darkModePrefix() + "redo", {}, _TOOLTIP_1_("redo", {}), _HELP_("redo"));
tb->AddSeparator();
tb->Realize();
@@ -145,13 +145,13 @@ SetWindow::SetWindow(Window* parent, const SetP& set)
#endif
// panels
addPanel(menuWindow, tabBar, new CardsPanel (this, wxID_ANY), 0, _("window_cards"), _("cards tab"));
addPanel(menuWindow, tabBar, new StylePanel (this, wxID_ANY), 1, _("window_style"), _("style tab"));
addPanel(menuWindow, tabBar, new SetInfoPanel (this, wxID_ANY), 2, _("window_set_info"), _("set info tab"));
addPanel(menuWindow, tabBar, new KeywordsPanel (this, wxID_ANY), 3, _("window_keywords"), _("keywords tab"));
addPanel(menuWindow, tabBar, new StatsPanel (this, wxID_ANY), 4, _("window_statistics"), _("stats tab"));
addPanel(menuWindow, tabBar, new RandomPackPanel(this, wxID_ANY), 5, _("window_random_pack"),_("random pack tab"));
addPanel(menuWindow, tabBar, new ConsolePanel (this, wxID_ANY), 6, _("window_console"), _("console tab"));
addPanel(menuWindow, tabBar, new CardsPanel (this, wxID_ANY), 0, _("window_cards"), _("cards tab"));
addPanel(menuWindow, tabBar, new StylePanel (this, wxID_ANY), 1, _("window_style"), _("style tab"));
addPanel(menuWindow, tabBar, new SetInfoPanel (this, wxID_ANY), 2, settings.darkModePrefix() + _("window_set_info"), _("set info tab"));
addPanel(menuWindow, tabBar, new KeywordsPanel (this, wxID_ANY), 3, settings.darkModePrefix() + _("window_keywords"), _("keywords tab"));
addPanel(menuWindow, tabBar, new StatsPanel (this, wxID_ANY), 4, _("window_statistics"), _("stats tab"));
addPanel(menuWindow, tabBar, new RandomPackPanel(this, wxID_ANY), 5, _("window_random_pack"),_("random pack tab"));
addPanel(menuWindow, tabBar, new ConsolePanel (this, wxID_ANY), 6, _("window_console"), _("console tab"));
selectPanel(ID_WINDOW_CARDS); // select cards panel
// loose ends
+4 -4
View File
@@ -42,10 +42,10 @@ void SymbolBasicShapeEditor::initUI(wxToolBar* tb, wxMenuBar* mb) {
sides->SetHelpText(_HELP_("sides"));
sides->SetSize(50, -1);
tb->AddSeparator();
add_tool_tr(tb, ID_SHAPE_CIRCLE, "circle", "ellipse", true, wxITEM_CHECK);
add_tool_tr(tb, ID_SHAPE_RECTANGLE, "rectangle", "rectangle",true, wxITEM_CHECK);
add_tool_tr(tb, ID_SHAPE_POLYGON, "triangle", "polygon", true, wxITEM_CHECK);
add_tool_tr(tb, ID_SHAPE_STAR, "star", "star", true, wxITEM_CHECK);
add_tool_tr(tb, ID_SHAPE_CIRCLE, settings.darkModePrefix() + "circle", "ellipse", true, wxITEM_CHECK);
add_tool_tr(tb, ID_SHAPE_RECTANGLE, settings.darkModePrefix() + "rectangle", "rectangle",true, wxITEM_CHECK);
add_tool_tr(tb, ID_SHAPE_POLYGON, settings.darkModePrefix() + "triangle", "polygon", true, wxITEM_CHECK);
add_tool_tr(tb, ID_SHAPE_STAR, settings.darkModePrefix() + "star", "star", true, wxITEM_CHECK);
// tb->AddControl(sidesL);
tb->AddControl(sides);
tb->Realize();
+15 -15
View File
@@ -83,8 +83,8 @@ void SymbolWindow::init(Window* parent, SymbolP symbol) {
menuBar->Append(menuFile, _MENU_("file"));
auto menuEdit = new wxMenu();
add_menu_item(menuEdit, ID_EDIT_UNDO, "undo", _MENU_1_("undo",wxEmptyString), _HELP_("undo"));
add_menu_item(menuEdit, ID_EDIT_REDO, "redo", _MENU_1_("redo",wxEmptyString), _HELP_("redo"));
add_menu_item(menuEdit, ID_EDIT_UNDO, settings.darkModePrefix() + "undo", _MENU_1_("undo",wxEmptyString), _HELP_("undo"));
add_menu_item(menuEdit, ID_EDIT_REDO, settings.darkModePrefix() + "redo", _MENU_1_("redo",wxEmptyString), _HELP_("redo"));
menuEdit->AppendSeparator();
add_menu_item_tr(menuEdit, ID_EDIT_GROUP, "group", "group");
add_menu_item_tr(menuEdit, ID_EDIT_UNGROUP, "ungroup", "ungroup");
@@ -94,11 +94,11 @@ void SymbolWindow::init(Window* parent, SymbolP symbol) {
auto menuTool = new wxMenu();
add_menu_item_tr(menuTool, ID_MODE_SELECT, "mode_select", "select", wxITEM_CHECK);
add_menu_item_tr(menuTool, ID_MODE_ROTATE, "mode_rotate", "rotate", wxITEM_CHECK);
add_menu_item_tr(menuTool, ID_MODE_ROTATE, settings.darkModePrefix() + "mode_rotate", "rotate", wxITEM_CHECK);
add_menu_item_tr(menuTool, ID_MODE_POINTS, "mode_curve", "points", wxITEM_CHECK);
add_menu_item_tr(menuTool, ID_MODE_SHAPES, "circle", "basic_shapes", wxITEM_CHECK);
add_menu_item_tr(menuTool, ID_MODE_SHAPES, settings.darkModePrefix() + "circle", "basic_shapes", wxITEM_CHECK);
add_menu_item_tr(menuTool, ID_MODE_SYMMETRY, "mode_symmetry", "symmetry", wxITEM_CHECK);
add_menu_item_tr(menuTool, ID_MODE_PAINT, "mode_paint", "paint", wxITEM_CHECK);
add_menu_item_tr(menuTool, ID_MODE_PAINT, settings.darkModePrefix() + "mode_paint", "paint", wxITEM_CHECK);
menuBar->Append(menuTool, _MENU_("tool"));
SetMenuBar(menuBar);
@@ -111,8 +111,8 @@ void SymbolWindow::init(Window* parent, SymbolP symbol) {
wxToolBar* tb = CreateToolBar(wxTB_FLAT | wxNO_BORDER | wxTB_HORIZONTAL | wxTB_TEXT);
add_tool_tr(tb, ID_FILE_STORE, "apply", "store_symbol", true);
tb->AddSeparator();
add_tool(tb, ID_EDIT_UNDO, "undo", _TOOL_("undo"), _TOOLTIP_1_("undo",wxEmptyString), _HELP_("undo"));
add_tool(tb, ID_EDIT_REDO, "redo", _TOOL_("redo"), _TOOLTIP_1_("redo",wxEmptyString), _HELP_("redo"));
add_tool(tb, ID_EDIT_UNDO, settings.darkModePrefix() + "undo", _TOOL_("undo"), _TOOLTIP_1_("undo",wxEmptyString), _HELP_("undo"));
add_tool(tb, ID_EDIT_REDO, settings.darkModePrefix() + "redo", _TOOL_("redo"), _TOOLTIP_1_("redo",wxEmptyString), _HELP_("redo"));
tb->AddSeparator();
add_tool_tr(tb, ID_VIEW_GRID, "grid", "grid", true, wxITEM_CHECK);
add_tool_tr(tb, ID_VIEW_GRID_SNAP, "grid_snap", "snap", true, wxITEM_CHECK);
@@ -123,13 +123,13 @@ void SymbolWindow::init(Window* parent, SymbolP symbol) {
wxToolBar* em = new wxToolBar(emp, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTB_FLAT | wxTB_VERTICAL | wxTB_HORZ_TEXT);
em->SetToolBitmapSize(wxSize(17,17));
add_tool_tr(em, ID_MODE_SELECT, "mode_select", "select", true, wxITEM_CHECK);
add_tool_tr(em, ID_MODE_ROTATE, "mode_rotate", "rotate", true, wxITEM_CHECK);
add_tool_tr(em, ID_MODE_ROTATE, settings.darkModePrefix() + "mode_rotate", "rotate", true, wxITEM_CHECK);
em->AddSeparator();
add_tool_tr(em, ID_MODE_POINTS, "mode_curve", "points", true, wxITEM_CHECK);
em->AddSeparator();
add_tool_tr(em, ID_MODE_SHAPES, "circle", "basic shapes", true, wxITEM_CHECK);
add_tool_tr(em, ID_MODE_SHAPES, settings.darkModePrefix() + "circle", "basic shapes", true, wxITEM_CHECK);
add_tool_tr(em, ID_MODE_SYMMETRY, "mode_symmetry", "symmetry", true, wxITEM_CHECK);
//add_tool_tr(em, ID_MODE_PAINT, "mode_paint", "paint", true, wxITEM_CHECK);
//add_tool_tr(em, ID_MODE_PAINT, settings.darkModePrefix() + "mode_paint", "paint", true, wxITEM_CHECK);
em->Realize();
// Lay out
@@ -176,13 +176,13 @@ void SymbolWindow::init(Window* parent, SymbolP symbol) {
em = new wxToolBar(emp, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTB_FLAT | wxTB_VERTICAL | wxTB_HORZ_TEXT);
em->SetToolBitmapSize(wxSize(17,17));
String spaces(max(0,n-1), _(' '));
add_tool(em, ID_MODE_SELECT, "mode_select", _TOOL_("select") + spaces, _TOOLTIP_("select"), _HELP_("select"), wxITEM_CHECK);
add_tool(em, ID_MODE_ROTATE, "mode_rotate", _TOOL_("rotate") + spaces, _TOOLTIP_("rotate"), _HELP_("rotate"), wxITEM_CHECK);
add_tool(em, ID_MODE_SELECT, "mode_select", _TOOL_("select") + spaces, _TOOLTIP_("select"), _HELP_("select"), wxITEM_CHECK);
add_tool(em, ID_MODE_ROTATE, settings.darkModePrefix() + "mode_rotate", _TOOL_("rotate") + spaces, _TOOLTIP_("rotate"), _HELP_("rotate"), wxITEM_CHECK);
em->AddSeparator();
add_tool(em, ID_MODE_POINTS, "mode_curve", _TOOL_("points") + spaces, _TOOLTIP_("points"), _HELP_("points"), wxITEM_CHECK);
add_tool(em, ID_MODE_POINTS, "mode_curve", _TOOL_("points") + spaces, _TOOLTIP_("points"), _HELP_("points"), wxITEM_CHECK);
em->AddSeparator();
add_tool(em, ID_MODE_SHAPES, "circle", _TOOL_("basic shapes") + spaces, _TOOLTIP_("basic shapes"),_HELP_("basic shapes"), wxITEM_CHECK);
add_tool(em, ID_MODE_SYMMETRY, "mode_symmetry", _TOOL_("symmetry") + spaces, _TOOLTIP_("symmetry"), _HELP_("symmetry"), wxITEM_CHECK);
add_tool(em, ID_MODE_SHAPES, settings.darkModePrefix() + "circle", _TOOL_("basic shapes") + spaces, _TOOLTIP_("basic shapes"), _HELP_("basic shapes"), wxITEM_CHECK);
add_tool(em, ID_MODE_SYMMETRY, "mode_symmetry", _TOOL_("symmetry") + spaces, _TOOLTIP_("symmetry"), _HELP_("symmetry"), wxITEM_CHECK);
em->Realize();
es = new wxBoxSizer(wxVERTICAL);
+2 -1
View File
@@ -44,7 +44,8 @@ void SymbolValueEditor::drawButton(RotatedDC& dc, int button, const String& text
double y = 0;
// draw button
draw_button(&editor(), dc.getDC(), dc.trRectToBB(RealRect(x,y,width,height)), false, down, true);
// draw text
// draw text
dc.SetTextForeground(wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT));
RealSize text_size = dc.GetTextExtent(text);
dc.DrawText(text, align_in_rect((Alignment)(ALIGN_BOTTOM | ALIGN_CENTER), text_size, RealRect(x, y, width,height*0.9)));
// draw image
+2 -2
View File
@@ -31,7 +31,7 @@ bool __compare_package_name(const PackagedP& a, const PackagedP& b) {
}
WelcomeWindow::WelcomeWindow()
: wxFrame(nullptr, wxID_ANY, _TITLE_("magic set editor"), wxDefaultPosition, wxSize(520,380), wxDEFAULT_DIALOG_STYLE | wxTAB_TRAVERSAL | wxCLIP_CHILDREN )
, logo (load_resource_image(_("about")))
, logo (load_resource_image(settings.darkModePrefix() + _("about")))
{
SetIcon(load_resource_icon(_("app")));
@@ -96,7 +96,7 @@ void WelcomeWindow::draw(DC& dc) {
wxSize ws = GetClientSize();
// draw background
dc.SetPen (*wxTRANSPARENT_PEN);
dc.SetBrush(Color(240,247,255));
dc.SetBrush(settings.darkModeColor());
dc.DrawRectangle(0, 0, ws.GetWidth(), ws.GetHeight());
// draw logo
dc.DrawBitmap(logo, (ws.GetWidth() - logo.GetWidth()) / 2, 5);