Implement unique IDs and card linking

This commit is contained in:
GenevensiS
2025-08-11 16:17:13 +02:00
committed by GitHub
parent 13406b946c
commit 3bf9de18b1
100 changed files with 2432 additions and 1219 deletions
+14 -14
View File
@@ -35,20 +35,20 @@ void StylePanel::initControls() {
list = new PackageList (this, wxID_ANY);
use_for_all = new wxButton (this, ID_STYLE_USE_FOR_ALL, _BUTTON_("use for all cards"));
use_custom_options = new wxCheckBox(this, ID_STYLE_USE_CUSTOM, _BUTTON_("use custom styling options"));
editor = new StylingEditor(this, ID_EDITOR, wxNO_BORDER);
stylesheet_filter = new FilterCtrl(this, ID_STYLESHEET_FILTER, _LABEL_("search stylesheet list"), _HELP_("search stylesheet list control"));
stylesheet_filter->setFilter(stylesheet_filter_value);
editor = new StylingEditor(this, ID_EDITOR, wxNO_BORDER);
stylesheet_filter = new FilterCtrl(this, ID_STYLESHEET_FILTER, _LABEL_("search stylesheet list"), _HELP_("search stylesheet list control"));
stylesheet_filter->setFilter(stylesheet_filter_value);
// init sizer
wxSizer* s = new wxBoxSizer(wxHORIZONTAL);
s->Add(preview, 0, wxRIGHT, 2);
wxSizer* s2 = new wxBoxSizer(wxVERTICAL);
s2->Add(list, 0, wxEXPAND | wxBOTTOM, 4);
wxSizer* s3 = new wxBoxSizer(wxHORIZONTAL);
s3->Add(stylesheet_filter, 0, wxBOTTOM | wxLEFT, 4);
s2->Add(list, 0, wxEXPAND | wxBOTTOM, 4);
wxSizer* s3 = new wxBoxSizer(wxHORIZONTAL);
s3->Add(stylesheet_filter, 0, wxBOTTOM | wxLEFT, 4);
s3->AddStretchSpacer();
s3->Add(use_for_all, 0, wxBOTTOM | wxRIGHT, 4);
s3->Add(use_for_all, 0, wxBOTTOM | wxRIGHT, 4);
s2->Add(s3, wxSizerFlags().Expand().Border(wxALL, 6));
wxSizer* s4 = new wxStaticBoxSizer(wxVERTICAL, this, _LABEL_("styling options"));
s4->Add(use_custom_options, 0, wxEXPAND | wxALL, 4);
@@ -81,10 +81,10 @@ void StylePanel::updateListSize() {
if (column_count != list->column_count) {
list->column_count = column_count;
static_cast<SetWindow*>(GetParent())->fixMinWindowSize();
}
}
list_size_already_initialized = true;
}
}
bool StylePanel::Layout() {
updateListSize();
@@ -136,8 +136,8 @@ void StylePanel::onAction(const Action& action, bool undone) {
use_for_all->Enable(card && card->stylesheet);
use_custom_options->Enable((bool)card);
use_custom_options->SetValue(card ? card->has_styling : false);
}
}
void StylePanel::onStylesheetFilterUpdate(wxCommandEvent&) {
if (list->hasSelection()) {
StyleSheetP existingStylesheetSelection = list->getSelection<StyleSheet>(false);
@@ -208,7 +208,7 @@ void StylePanel::onUseCustom(wxCommandEvent&) {
}
BEGIN_EVENT_TABLE(StylePanel, wxPanel)
EVT_GALLERY_SELECT(wxID_ANY, StylePanel::onStyleSelect)
EVT_GALLERY_SELECT(wxID_ANY, StylePanel::onStyleSelect)
EVT_COMMAND_RANGE(ID_STYLESHEET_FILTER, ID_STYLESHEET_FILTER, wxEVT_COMMAND_TEXT_UPDATED, StylePanel::onStylesheetFilterUpdate)
EVT_BUTTON (ID_STYLE_USE_FOR_ALL, StylePanel::onUseForAll)
EVT_CHECKBOX (ID_STYLE_USE_CUSTOM, StylePanel::onUseCustom)