mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-21 07:57:22 -06:00
BUGFIX: Limit torrent addition dialog width to fit the screen
This commit is contained in:
@@ -13,6 +13,7 @@
|
|||||||
- BUGFIX: Fix Web UI for spanish users
|
- BUGFIX: Fix Web UI for spanish users
|
||||||
- BUGFIX: Fix locale switching from Web UI
|
- BUGFIX: Fix locale switching from Web UI
|
||||||
- BUGFIX: Use AND operator for torrentdownloads.net searches
|
- BUGFIX: Use AND operator for torrentdownloads.net searches
|
||||||
|
- BUGFIX: Limit torrent addition dialog width to fit the screen
|
||||||
- COSMETIC: Fix progress bars style on Windows
|
- COSMETIC: Fix progress bars style on Windows
|
||||||
|
|
||||||
* Tue Aug 24 2010 - Christophe Dumez <chris@qbittorrent.org> - v2.4.0
|
* Tue Aug 24 2010 - Christophe Dumez <chris@qbittorrent.org> - v2.4.0
|
||||||
|
|||||||
@@ -125,6 +125,22 @@ void torrentAdditionDialog::renameTorrentNameInModel(QString file_path) {
|
|||||||
PropListModel->setData(PropListModel->index(0, 0), file_path.split("/", QString::SkipEmptyParts).last());
|
PropListModel->setData(PropListModel->index(0, 0), file_path.split("/", QString::SkipEmptyParts).last());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void torrentAdditionDialog::limitDialogWidth() {
|
||||||
|
int scrn = 0;
|
||||||
|
const QWidget *w = this->window();
|
||||||
|
|
||||||
|
if(w)
|
||||||
|
scrn = QApplication::desktop()->screenNumber(w);
|
||||||
|
else if(QApplication::desktop()->isVirtualDesktop())
|
||||||
|
scrn = QApplication::desktop()->screenNumber(QCursor::pos());
|
||||||
|
else
|
||||||
|
scrn = QApplication::desktop()->screenNumber(this);
|
||||||
|
|
||||||
|
QRect desk(QApplication::desktop()->availableGeometry(scrn));
|
||||||
|
int max_width = desk.width();
|
||||||
|
setMaximumWidth(max_width);
|
||||||
|
}
|
||||||
|
|
||||||
void torrentAdditionDialog::hideTorrentContent() {
|
void torrentAdditionDialog::hideTorrentContent() {
|
||||||
// Disable useless widgets
|
// Disable useless widgets
|
||||||
hidden_height += torrentContentList->height();
|
hidden_height += torrentContentList->height();
|
||||||
@@ -167,6 +183,8 @@ void torrentAdditionDialog::showLoadMagnetURI(QString magnet_uri) {
|
|||||||
|
|
||||||
// No need to display torrent content
|
// No need to display torrent content
|
||||||
hideTorrentContent();
|
hideTorrentContent();
|
||||||
|
// Limit dialog width
|
||||||
|
limitDialogWidth();
|
||||||
}
|
}
|
||||||
|
|
||||||
void torrentAdditionDialog::showLoad(QString filePath, QString from_url) {
|
void torrentAdditionDialog::showLoad(QString filePath, QString from_url) {
|
||||||
@@ -260,6 +278,11 @@ void torrentAdditionDialog::showLoad(QString filePath, QString from_url) {
|
|||||||
// Hide useless widgets
|
// Hide useless widgets
|
||||||
if(t->num_files() <= 1)
|
if(t->num_files() <= 1)
|
||||||
hideTorrentContent();
|
hideTorrentContent();
|
||||||
|
|
||||||
|
// No need to display torrent content
|
||||||
|
hideTorrentContent();
|
||||||
|
// Limit dialog width
|
||||||
|
limitDialogWidth();
|
||||||
}
|
}
|
||||||
|
|
||||||
void torrentAdditionDialog::displayContentListMenu(const QPoint&) {
|
void torrentAdditionDialog::displayContentListMenu(const QPoint&) {
|
||||||
|
|||||||
@@ -82,6 +82,7 @@ public slots:
|
|||||||
void on_OkButton_clicked();
|
void on_OkButton_clicked();
|
||||||
void renameTorrentNameInModel(QString file_path);
|
void renameTorrentNameInModel(QString file_path);
|
||||||
void hideTorrentContent();
|
void hideTorrentContent();
|
||||||
|
void limitDialogWidth();
|
||||||
void saveTruncatedPathHistory();
|
void saveTruncatedPathHistory();
|
||||||
void loadSavePathHistory();
|
void loadSavePathHistory();
|
||||||
void updateLabelInSavePath(QString label);
|
void updateLabelInSavePath(QString label);
|
||||||
|
|||||||
Reference in New Issue
Block a user