Gui: add parameter switch to optionally stretch 'Description' column of Tree view

This commit is contained in:
0penBrain
2022-04-14 15:17:14 +02:00
committed by wwmayer
parent 97e0d63750
commit d7c3692cdb
2 changed files with 7 additions and 1 deletions

View File

@@ -153,6 +153,11 @@ TreeParams* TreeParams::Instance() {
return instance;
}
bool TreeParams::getTreeViewStretchDescription() const
{
return handle->GetBool("TreeViewStretchDescription", false);
}
//////////////////////////////////////////////////////////////////////////////////////
struct Stats {
#define DEFINE_STATS \
@@ -526,7 +531,7 @@ TreeWidget::TreeWidget(const char* name, QWidget* parent)
// make sure to show a horizontal scrollbar if needed
this->header()->setSectionResizeMode(0, QHeaderView::ResizeToContents);
this->header()->setStretchLastSection(false);
this->header()->setStretchLastSection(TreeParams::Instance()->getTreeViewStretchDescription());
// Add the first main label
this->rootItem = new QTreeWidgetItem(this);

View File

@@ -510,6 +510,7 @@ public:
TreeParams();
void OnChange(Base::Subject<const char*> &, const char* sReason);
static TreeParams *Instance();
bool getTreeViewStretchDescription() const;
#define FC_TREEPARAM_DEFS \
FC_TREEPARAM_DEF2(SyncSelection,bool,Bool,true) \