Ref T154, resize rows height for overlay messages

* for smaller container sizes switch to row content resizing
* row content resizing is slow -> only for small container sizes
* user still can switch manually (context menu) to row resizing
* default is interactive row resizing
This commit is contained in:
Klaus Basan
2017-09-17 04:22:47 +02:00
committed by Mathew Sutcliffe
parent d2b364c291
commit f8e672b04f
3 changed files with 40 additions and 11 deletions

View File

@@ -141,6 +141,10 @@ namespace BlackGui
//! When to use pre-sizing with random elements
static constexpr int ResizeSubsetThreshold = 250;
//! When to use rows resizing (which is slow)
//! \see rowsResizeModeToContent
static constexpr int ResizeRowsToContentThreshold = 20;
//! Clear data
virtual void clear() = 0;
@@ -269,7 +273,7 @@ namespace BlackGui
//! Force that columns are extended to full viewport width.
//! Workaround as of https://stackoverflow.com/q/3433664/356726
void setForceColumnsToMaxSize (bool force) { m_forceColumnsToMaxSize = force; }
void setForceColumnsToMaxSize(bool force) { m_forceColumnsToMaxSize = force; }
signals:
//! Ask for new data from currently loaded data
@@ -322,8 +326,12 @@ namespace BlackGui
void rowsResizeModeToInteractive();
//! Resize mode to content
//! \remark extremely slow for larger views (means views with many rows)
void rowsResizeModeToContent();
//! Set content/interactive mode based on ResizeRowsToContentThreshold
void rowsResizeModeBasedOnThreshold(int elements);
//! Show loading indicator
//! \param containerSizeDependent check against resize threshold if indicator makes sense
//! \param timeoutMs timeout the loading indicator