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
8282 _runningScriptsTable->setItem(i, 1, closeIcon);
8383 }
8484
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;
8690 for (int i = 0; i < _runningScriptsTable->rowCount(); ++i) {
8791 y += _runningScriptsTable->rowHeight(i);
8892 }
8993
90− ui->runningScriptsTableWidget->resize(ui->runningScriptsTableWidget->width(), y - 12);
91− _runningScriptsTable->resize(_runningScriptsTable->width(), y - 12);
94+ ui->runningScriptsTableWidget->resize(ui->runningScriptsTableWidget->width(), y - RUNNING_SCRIPTS_TABLE_LEFT_MARGIN);
95+ _runningScriptsTable->resize(_runningScriptsTable->width(), y - RUNNING_SCRIPTS_TABLE_LEFT_MARGIN);
9296 ui->reloadAllButton->move(ui->reloadAllButton->x(), y);
9397 ui->stopAllButton->move(ui->stopAllButton->x(), y);
9498 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);
96100 ui->recentlyLoadedScriptsTableWidget->move(ui->recentlyLoadedScriptsTableWidget->x(),
97− ui->recentlyLoadedLabel->y() + 19);
101+ ui->recentlyLoadedLabel->y() + RECENTLY_LOADED_LABEL_TOP_MARGIN);
98102
99103
100104 createRecentlyLoadedScriptsTable();