Gui: add parameter switch to optionally stretch 'Description' column of Tree view
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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) \
|
||||
|
||||
Reference in New Issue
Block a user