diff options
| author | Jeremy Rimpo <jrim@rimpo.org> | 2019-07-09 00:05:53 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-07-09 00:05:53 -0500 |
| commit | 0b2f12f90ef8bbe853b962dfa945fa63e4cedc23 (patch) | |
| tree | 2dd5ad76deab41fd263bcdc04292f5789bceb5e4 /src | |
| parent | 4bfb1a0d7666cbde7b10f59feaccde0af723a9e1 (diff) | |
| parent | f0c5f6f67298f4009bfb0b1804c6c620d42577e1 (diff) | |
Merge pull request #792 from isanae/small-fixes
Small fixes
Diffstat (limited to 'src')
| -rw-r--r-- | src/filedialogmemory.cpp | 4 | ||||
| -rw-r--r-- | src/mainwindow.ui | 2 | ||||
| -rw-r--r-- | src/overwriteinfodialog.cpp | 3 | ||||
| -rw-r--r-- | src/statusbar.cpp | 27 |
4 files changed, 21 insertions, 15 deletions
diff --git a/src/filedialogmemory.cpp b/src/filedialogmemory.cpp index 554a6235..0e3e9793 100644 --- a/src/filedialogmemory.cpp +++ b/src/filedialogmemory.cpp @@ -66,7 +66,7 @@ QString FileDialogMemory::getOpenFileName( if (currentDir.isEmpty()) {
auto itor = instance().m_Cache.find(dirID);
if (itor != instance().m_Cache.end()) {
- currentDir = itor->first;
+ currentDir = itor->second;
}
}
@@ -90,7 +90,7 @@ QString FileDialogMemory::getExistingDirectory( if (currentDir.isEmpty()) {
auto itor = instance().m_Cache.find(dirID);
if (itor != instance().m_Cache.end()) {
- currentDir = itor->first;
+ currentDir = itor->second;
}
}
diff --git a/src/mainwindow.ui b/src/mainwindow.ui index 6a816262..70d1cf39 100644 --- a/src/mainwindow.ui +++ b/src/mainwindow.ui @@ -1733,7 +1733,7 @@ p, li { white-space: pre-wrap; } <bool>true</bool> </property> <property name="text"> - <string>St&atus bar</string> + <string>Status &bar</string> </property> </action> </widget> diff --git a/src/overwriteinfodialog.cpp b/src/overwriteinfodialog.cpp index 0a884ac9..5ee8d76c 100644 --- a/src/overwriteinfodialog.cpp +++ b/src/overwriteinfodialog.cpp @@ -290,5 +290,6 @@ void OverwriteInfoDialog::on_filesView_customContextMenuRequested(const QPoint & m_FileSelection.clear();
m_FileSelection.append(m_FileSystemModel->index(m_FileSystemModel->rootPath(), 0));
}
- menu.exec(ui->filesView->mapToGlobal(pos));
+
+ menu.exec(ui->filesView->viewport()->mapToGlobal(pos));
}
diff --git a/src/statusbar.cpp b/src/statusbar.cpp index 8ad5bea1..e9a6e658 100644 --- a/src/statusbar.cpp +++ b/src/statusbar.cpp @@ -23,7 +23,7 @@ StatusBar::StatusBar(QStatusBar* bar, Ui::MainWindow* ui) : m_bar->addPermanentWidget(m_notifications); m_bar->addPermanentWidget(m_update); m_bar->addPermanentWidget(m_api); - + m_progress->setTextVisible(true); m_progress->setRange(0, 100); @@ -72,8 +72,8 @@ void StatusBar::setAPI(const APIStats& stats, const APIUserAccount& user) if (user.type() == APIUserAccountTypes::None) { text = "API: not logged in"; - textColor = "initial"; - backgroundColor = "transparent"; + textColor = ""; + backgroundColor = ""; } else { text = QString("API: Queued: %1 | Daily: %2 | Hourly: %3") .arg(stats.requestsQueued) @@ -94,20 +94,25 @@ void StatusBar::setAPI(const APIStats& stats, const APIUserAccount& user) m_api->setText(text); - m_api->setStyleSheet(QString(R"( + QString ss(R"( QLabel { padding-left: 0.1em; padding-right: 0.1em; padding-top: 0; - padding-bottom: 0; - color: %1; - background-color: %2; - } - )") - .arg(textColor) - .arg(backgroundColor)); + padding-bottom: 0;)"); + + if (!textColor.isEmpty()) { + ss += QString("\ncolor: %1;").arg(textColor); + } + + if (!backgroundColor.isEmpty()) { + ss += QString("\nbackground-color: %2;").arg(backgroundColor); + } + + ss += "\n}"; + m_api->setStyleSheet(ss); m_api->setAutoFillBackground(true); } |
