History

Remove magic numbers from RunningScriptsWidget

Ryan Huffman committed 12 years ago

Commit 2ba0c8c1 parent 98a736a1 file · +9 −5Browse files

Showing the changes to interface/src/ui/RunningScriptsWidget.cpp (1 of 1 file). Show all

Unified · Split

interface/src/ui/RunningScriptsWidget.cpp+9−5
@@ -82,19 +82,23 @@ void RunningScriptsWidget::setRunningScripts(const QStringList& list) { · 81 unmodified lines
82 _runningScriptsTable->setItem(i, 1, closeIcon);82 _runningScriptsTable->setItem(i, 1, closeIcon);
83 }83 }
84 84
85 int y = ui->runningScriptsTableWidget->y() + 12;85 const int RUNNING_SCRIPTS_TABLE_LEFT_MARGIN = 12;
86 const int RECENTLY_LOADED_TOP_MARGIN = 61;
87 const int RECENTLY_LOADED_LABEL_TOP_MARGIN = 19;
88
89 int y = ui->runningScriptsTableWidget->y() + RUNNING_SCRIPTS_TABLE_LEFT_MARGIN;
86 for (int i = 0; i < _runningScriptsTable->rowCount(); ++i) {90 for (int i = 0; i < _runningScriptsTable->rowCount(); ++i) {
87 y += _runningScriptsTable->rowHeight(i);91 y += _runningScriptsTable->rowHeight(i);
88 }92 }
89 93
90 ui->runningScriptsTableWidget->resize(ui->runningScriptsTableWidget->width(), y - 12);94 ui->runningScriptsTableWidget->resize(ui->runningScriptsTableWidget->width(), y - RUNNING_SCRIPTS_TABLE_LEFT_MARGIN);
91 _runningScriptsTable->resize(_runningScriptsTable->width(), y - 12);95 _runningScriptsTable->resize(_runningScriptsTable->width(), y - RUNNING_SCRIPTS_TABLE_LEFT_MARGIN);
92 ui->reloadAllButton->move(ui->reloadAllButton->x(), y);96 ui->reloadAllButton->move(ui->reloadAllButton->x(), y);
93 ui->stopAllButton->move(ui->stopAllButton->x(), y);97 ui->stopAllButton->move(ui->stopAllButton->x(), y);
94 ui->recentlyLoadedLabel->move(ui->recentlyLoadedLabel->x(),98 ui->recentlyLoadedLabel->move(ui->recentlyLoadedLabel->x(),
95 ui->stopAllButton->y() + ui->stopAllButton->height() + 61);99 ui->stopAllButton->y() + ui->stopAllButton->height() + RECENTLY_LOADED_TOP_MARGIN);
96 ui->recentlyLoadedScriptsTableWidget->move(ui->recentlyLoadedScriptsTableWidget->x(),100 ui->recentlyLoadedScriptsTableWidget->move(ui->recentlyLoadedScriptsTableWidget->x(),
97 ui->recentlyLoadedLabel->y() + 19);101 ui->recentlyLoadedLabel->y() + RECENTLY_LOADED_LABEL_TOP_MARGIN);
98 102
99 103
100 createRecentlyLoadedScriptsTable();104 createRecentlyLoadedScriptsTable();