mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
code cleanup: replace lring with file local function
And simplify the code. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
77d7e550fe
commit
7319b50a5d
1 changed files with 9 additions and 16 deletions
|
@ -81,6 +81,10 @@ namespace {
|
||||||
QProgressDialog *progressDialog = nullptr;
|
QProgressDialog *progressDialog = nullptr;
|
||||||
bool progressDialogCanceled = false;
|
bool progressDialogCanceled = false;
|
||||||
int progressCounter = 0;
|
int progressCounter = 0;
|
||||||
|
|
||||||
|
int round_int (double value) {
|
||||||
|
return static_cast<int>(lrint(value));
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1141,24 +1145,13 @@ void MainWindow::on_actionViewAll_triggered()
|
||||||
{
|
{
|
||||||
toggleCollapsible(false);
|
toggleCollapsible(false);
|
||||||
beginChangeState(VIEWALL);
|
beginChangeState(VIEWALL);
|
||||||
static QList<int> mainSizes;
|
|
||||||
const int appH = qApp->desktop()->size().height();
|
const int appH = qApp->desktop()->size().height();
|
||||||
const int appW = qApp->desktop()->size().width();
|
const int appW = qApp->desktop()->size().width();
|
||||||
if (mainSizes.empty()) {
|
|
||||||
mainSizes.append(lrint(appH * 0.7));
|
|
||||||
mainSizes.append(lrint(appH * 0.3));
|
|
||||||
}
|
|
||||||
static QList<int> infoProfileSizes;
|
|
||||||
if (infoProfileSizes.empty()) {
|
|
||||||
infoProfileSizes.append(lrint(appW * 0.3));
|
|
||||||
infoProfileSizes.append(lrint(appW * 0.7));
|
|
||||||
}
|
|
||||||
|
|
||||||
static QList<int> listGlobeSizes;
|
QList<int> mainSizes = { round_int(appH * 0.7), round_int(appH * 0.3) };
|
||||||
if (listGlobeSizes.empty()) {
|
QList<int> infoProfileSizes = { round_int(appW * 0.3), round_int(appW * 0.7) };
|
||||||
listGlobeSizes.append(lrint(appW * 0.7));
|
QList<int> listGlobeSizes = { round_int(appW * 0.7), round_int(appW * 0.3) };
|
||||||
listGlobeSizes.append(lrint(appW * 0.3));
|
|
||||||
}
|
|
||||||
|
|
||||||
QSettings settings;
|
QSettings settings;
|
||||||
settings.beginGroup("MainWindow");
|
settings.beginGroup("MainWindow");
|
||||||
|
@ -1196,7 +1189,7 @@ void MainWindow::enterEditState()
|
||||||
ui.topSplitter->setSizes({ EXPANDED, EXPANDED });
|
ui.topSplitter->setSizes({ EXPANDED, EXPANDED });
|
||||||
ui.mainSplitter->setSizes({ EXPANDED, COLLAPSED });
|
ui.mainSplitter->setSizes({ EXPANDED, COLLAPSED });
|
||||||
int appW = qApp->desktop()->size().width();
|
int appW = qApp->desktop()->size().width();
|
||||||
QList<int> infoProfileSizes { (int)lrint(appW * 0.3), (int)lrint(appW * 0.7) };
|
QList<int> infoProfileSizes { round_int(appW * 0.3), round_int(appW * 0.7) };
|
||||||
|
|
||||||
QSettings settings;
|
QSettings settings;
|
||||||
settings.beginGroup("MainWindow");
|
settings.beginGroup("MainWindow");
|
||||||
|
|
Loading…
Add table
Reference in a new issue