lmi-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lmi-commits] [lmi] master 342b9f5 27/46: Always resize columns in Censu


From: Greg Chicares
Subject: [lmi-commits] [lmi] master 342b9f5 27/46: Always resize columns in CensusGridView::update_visible_columns()
Date: Wed, 22 Jul 2020 11:05:14 -0400 (EDT)

branch: master
commit 342b9f5e1c60ccd7f3350089648b2410cc9aa944
Author: Vadim Zeitlin <vadim@tt-solutions.com>
Commit: Vadim Zeitlin <vadim@tt-solutions.com>

    Always resize columns in CensusGridView::update_visible_columns()
    
    If auto-sizing is turned on, always call AutoSize() instead of doing
    only if the columns have changed, as their contents could have changed
    even if the columns remain the same.
    
    This ensures that the columns adjust to the width of a field in a newly
    added cell, for example.
---
 census_view.cpp | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/census_view.cpp b/census_view.cpp
index 453d4b3..42dda09 100644
--- a/census_view.cpp
+++ b/census_view.cpp
@@ -2264,16 +2264,18 @@ void CensusGridView::update_visible_columns()
             grid_table_->make_cell_number_column_read_only();
             }
 
-        if(autosize_columns_)
-            {
-            grid_window_->AutoSize();
-            }
-
         grid_window_->SetGridCursor
             (cursor_row
             ,std::min(cursor_col, new_columns_count - 1)
             );
         }
+
+    // Even if the visible columns are the same as before, their contents could
+    // have changed, so always auto-size them if we're configured to do so.
+    if(autosize_columns_)
+        {
+        grid_window_->AutoSize();
+        }
 }
 
 char const* CensusView::icon_xrc_resource() const



reply via email to

[Prev in Thread] Current Thread [Next in Thread]