Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion docs/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,18 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
- **Impact**: Split check interface now provides clean, simple, and functional experience with clear visual feedback, proper pricing display, and intuitive manual item selection

### Fixed
- **Split Check Interface: Enhanced Button Display and Usability (2026-01-20)**
- **Removed Automatic Creation of System Page -94 (2026-01-23)**
- Eliminated the automatic creation of page -94 (Index with Tabs template) that was causing "Can't delete page -94" errors
- **Changes Made**:
- Removed the code that creates page -94 for all screen resolutions during ZoneDB initialization
- Simplified page 60 creation to use a default template instead of copying from page -94
- **Root Cause**: System was automatically creating page -94 as a template for Index with Tabs pages, but this page couldn't be deleted, causing user confusion and errors
- **Solution**:
- Removed the template creation loop in ZoneDB::Init()
- Modified page 60 creation to always use a basic default configuration
- **Files modified**:
- `zone/zone.cc` (removed page -94 creation code and simplified page 60 creation)
- **Impact**: Prevents "Can't delete page -94" errors and reduces system complexity by removing unnecessary template pages
- Improved the split check zone interface for better readability and user experience
- **Changes Made**:
- Added dynamic font responsiveness - buttons now properly inherit font sizes from zone settings
Expand Down
77 changes: 10 additions & 67 deletions zone/zone.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1260,33 +1260,7 @@ int ZoneDB::Init()
p = p->next;
}

// Ensure template page -94 exists for Index with Tabs (create first so it can be used as template)
int sizes[] = {SIZE_640x480, SIZE_800x600, SIZE_1024x600, SIZE_1024x768,
SIZE_1280x800, SIZE_1280x1024, SIZE_1366x768, SIZE_1440x900,
SIZE_1600x900, SIZE_1680x1050, SIZE_1920x1080, SIZE_1920x1200, -1};
for (int i = 0; sizes[i] != -1; ++i)
{
Page *page94 = FindByID(-94, sizes[i]);
if (page94 == nullptr)
{
// Create template page -94 for Index with Tabs
Page *newPage = NewPosPage();
if (newPage)
{
newPage->id = -94;
newPage->type = PAGE_INDEX_WITH_TABS;
newPage->size = static_cast<short>(sizes[i]);
newPage->name.Set("Index with Tabs Template");
newPage->index = INDEX_GENERAL;
newPage->Init(this);
Add(newPage);
}
}
}

// Ensure default Index page (page 60) exists for 1920x1080 only
// Use page -94 as template if available
// Check for exact size match, not just max_size
Page *page60 = nullptr;
Page *currPage = page_list.Head();
while (currPage != nullptr)
Expand All @@ -1301,48 +1275,17 @@ int ZoneDB::Init()

if (page60 == nullptr)
{
// Try to use page -94 as template (check for exact size match)
Page *templatePage = nullptr;
currPage = page_list.Head();
while (currPage != nullptr)
// Create default Index page on page 60
Page *newPage = NewPosPage();
if (newPage)
{
if (currPage->id == -94 && currPage->size == SIZE_1920x1080)
{
templatePage = currPage;
break;
}
currPage = currPage->next;
}

if (templatePage != nullptr)
{
// Copy from template page -94
auto pageCopy = templatePage->Copy();
if (pageCopy)
{
pageCopy->id = 60;
pageCopy->type = PAGE_INDEX; // Ensure it's PAGE_INDEX, not PAGE_INDEX_WITH_TABS
pageCopy->size = SIZE_1920x1080; // Ensure exact size
pageCopy->name.Set("Index");
pageCopy->index = INDEX_GENERAL;
pageCopy->Init(this);
Add(pageCopy.release());
}
}
else
{
// Create default Index page on page 60 if no template exists
Page *newPage = NewPosPage();
if (newPage)
{
newPage->id = 60;
newPage->type = PAGE_INDEX;
newPage->size = SIZE_1920x1080;
newPage->name.Set("Index");
newPage->index = INDEX_GENERAL;
newPage->Init(this);
Add(newPage);
}
newPage->id = 60;
newPage->type = PAGE_INDEX;
newPage->size = SIZE_1920x1080;
newPage->name.Set("Index");
newPage->index = INDEX_GENERAL;
newPage->Init(this);
Add(newPage);
}
}

Expand Down