mirror of
https://github.com/ocornut/imgui.git
synced 2026-07-09 02:49:39 +00:00
@@ -2048,7 +2048,8 @@ struct ImGuiWindowSettings
|
||||
|
||||
struct ImGuiSettingsCleanupArgs
|
||||
{
|
||||
int DiscardOlderThanMonths = 0; // Enable to discard entries older than XX months.
|
||||
int DiscardOlderThanMonths = 0; // Enable to discard entries older than XX months.
|
||||
bool DiscardWhenMissingDate = false; // Enable to discard entries missing a date.
|
||||
bool SetCurrentSessionDateToAll = false; // Enable to write current SessionDate to all supporting entries. // Let us know in #9460 if you use this.
|
||||
bool SetCurrentSessionDateWhenMissingDate = false; // Enable to write current SessionDate to all supporting entries missing a date. // Let us know in #9460 if you use this.
|
||||
int _DiscardOlderThanDate = 0; // [Internal]
|
||||
|
||||
@@ -4134,9 +4134,12 @@ static void TableSettingsHandler_Cleanup(ImGuiContext* ctx, ImGuiSettingsHandler
|
||||
table->SettingsOffset = -1;
|
||||
for (ImGuiTableSettings* settings = g.SettingsTables.begin(); settings != NULL; settings = g.SettingsTables.next_chunk(settings))
|
||||
{
|
||||
const bool is_valid = settings->LastUsedDate.IsValid();
|
||||
if (args->_DiscardOlderThanDate != 0 && settings->LastUsedDate.Unpack() < args->_DiscardOlderThanDate)
|
||||
settings->ID = 0;
|
||||
if (args->SetCurrentSessionDateToAll || (args->SetCurrentSessionDateWhenMissingDate && settings->LastUsedDate.IsValid() == false))
|
||||
else if (args->DiscardWhenMissingDate && !is_valid)
|
||||
settings->ID = 0;
|
||||
else if (args->SetCurrentSessionDateToAll || (args->SetCurrentSessionDateWhenMissingDate && !is_valid))
|
||||
settings->LastUsedDate = g.SessionDate;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user