MCPcopy Create free account
hub / github.com/KDAB/GammaRay / setupLayout

Method setupLayout

ui/tools/resourcebrowser/resourcebrowserwidget.cpp:90–110  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

88}
89
90void ResourceBrowserWidget::setupLayout()
91{
92 // now the view was setup properly and we can mess with the splitter to resize
93 // the widgets for nicer display
94
95 int viewWidth = ui->treeView->columnWidth(0)
96 + ui->treeView->columnWidth(1)
97 + ui->treeView->columnWidth(2)
98 + ui->treeView->contentsMargins().left()
99 + ui->treeView->contentsMargins().right()
100 + ui->treeView->verticalScrollBar()->width();
101 const int totalWidth = ui->mainSplitter->width();
102 const int minPreviewWidth = 150;
103 if (totalWidth > viewWidth + minPreviewWidth) {
104 m_stateManager.setDefaultSizes(ui->mainSplitter,
105 UISizeVector() << viewWidth
106 << (totalWidth - viewWidth
107 - ui->mainSplitter->handleWidth()));
108 m_stateManager.restoreState();
109 }
110}
111
112void ResourceBrowserWidget::resourceDeselected()
113{

Callers

nothing calls this directly

Calls 5

columnWidthMethod · 0.80
leftMethod · 0.80
rightMethod · 0.80
setDefaultSizesMethod · 0.80
restoreStateMethod · 0.45

Tested by

no test coverage detected