Rename latest_log_entries_read to autoscrolling
This commit is contained in:
parent
21badd1db4
commit
672b39b172
|
@ -27,7 +27,7 @@ static inline void settings_window(Config& config, float* config_write_timer, bo
|
|||
ImGui::End();
|
||||
}
|
||||
|
||||
static inline void logs_window(bool* latest_log_entries_read, bool* show_logs_window) {
|
||||
static inline void logs_window(bool* autoscrolling, bool* show_logs_window) {
|
||||
if (!ImGui::Begin("LogMeow Logs", show_logs_window)) {
|
||||
ImGui::End();
|
||||
return;
|
||||
|
@ -46,7 +46,7 @@ static inline void logs_window(bool* latest_log_entries_read, bool* show_logs_wi
|
|||
if (ImGui::BeginChild("ScrollingRegion", ImVec2(0, 0), false, ImGuiWindowFlags_HorizontalScrollbar)) {
|
||||
ImGui::TextUnformatted(log_entries.data(), &log_entries[log_entries.size()]);
|
||||
if (ImGui::GetScrollY() >= ImGui::GetScrollMaxY()) {
|
||||
*latest_log_entries_read = true;
|
||||
*autoscrolling = true;
|
||||
ImGui::SetScrollHereY(1.0f);
|
||||
}
|
||||
}
|
||||
|
@ -137,9 +137,9 @@ void event_loop(Config& config, float* config_write_timer, bool* run_event_loop)
|
|||
}
|
||||
|
||||
if (show_logs_window) {
|
||||
bool latest_log_entries_read = false;
|
||||
logs_window(&latest_log_entries_read, &show_logs_window);
|
||||
if (latest_log_entries_read) {
|
||||
bool autoscrolling = false;
|
||||
logs_window(&autoscrolling, &show_logs_window);
|
||||
if (autoscrolling) {
|
||||
log_entries_read = log_entries.size();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue