Browse Source

Alignment cleanup

adaptive-webui-19844
Chocobo1 10 years ago
parent
commit
0e1eaa518b
  1. 11
      src/gui/transferlistfilterswidget.cpp

11
src/gui/transferlistfilterswidget.cpp

@ -81,7 +81,7 @@ QSize FiltersBase::sizeHint() const
QSize size; QSize size;
// Height should be exactly the height of the content // Height should be exactly the height of the content
size.setHeight((sizeHintForRow(0) * count()) + (2 * frameWidth()) + 6); size.setHeight((sizeHintForRow(0) * count()) + (2 * frameWidth()) + 6);
// Width should be exactly the height of the content // Width should be exactly the width of the content
size.setWidth(sizeHintForColumn(0) + (2 * frameWidth())); size.setWidth(sizeHintForColumn(0) + (2 * frameWidth()));
return size; return size;
} }
@ -108,7 +108,7 @@ StatusFiltersWidget::StatusFiltersWidget(QWidget *parent, TransferListWidget *tr
setUniformItemSizes(true); setUniformItemSizes(true);
setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff); setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
// Height is fixed (sizeHint().height() is used) // Height is fixed (sizeHint().height() is used)
setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed); setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
setSpacing(0); setSpacing(0);
connect(BitTorrent::Session::instance(), SIGNAL(torrentsUpdated(const BitTorrent::TorrentStatusReport &)), SLOT(updateTorrentNumbers(const BitTorrent::TorrentStatusReport &))); connect(BitTorrent::Session::instance(), SIGNAL(torrentsUpdated(const BitTorrent::TorrentStatusReport &)), SLOT(updateTorrentNumbers(const BitTorrent::TorrentStatusReport &)));
@ -176,7 +176,7 @@ LabelFiltersList::LabelFiltersList(QWidget *parent, TransferListWidget *transfer
, m_totalTorrents(0) , m_totalTorrents(0)
, m_totalLabeled(0) , m_totalLabeled(0)
{ {
setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred); setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
connect(BitTorrent::Session::instance(), SIGNAL(torrentLabelChanged(BitTorrent::TorrentHandle *const, QString)), SLOT(torrentChangedLabel(BitTorrent::TorrentHandle *const, QString))); connect(BitTorrent::Session::instance(), SIGNAL(torrentLabelChanged(BitTorrent::TorrentHandle *const, QString)), SLOT(torrentChangedLabel(BitTorrent::TorrentHandle *const, QString)));
@ -420,7 +420,7 @@ TrackerFiltersList::TrackerFiltersList(QWidget *parent, TransferListWidget *tran
: FiltersBase(parent, transferList) : FiltersBase(parent, transferList)
, m_totalTorrents(0) , m_totalTorrents(0)
{ {
setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Expanding); setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
QListWidgetItem *allTrackers = new QListWidgetItem(this); QListWidgetItem *allTrackers = new QListWidgetItem(this);
allTrackers->setData(Qt::DisplayRole, QVariant(tr("All (0)", "this is for the label filter"))); allTrackers->setData(Qt::DisplayRole, QVariant(tr("All (0)", "this is for the label filter")));
@ -778,6 +778,7 @@ TransferListFiltersWidget::TransferListFiltersWidget(QWidget *parent, TransferLi
vLayout->setContentsMargins(0, 4, 0, 0); vLayout->setContentsMargins(0, 4, 0, 0);
frameLayout->setContentsMargins(0, 4, 0, 0); frameLayout->setContentsMargins(0, 4, 0, 0);
frameLayout->setSpacing(2); frameLayout->setSpacing(2);
frameLayout->setAlignment(Qt::AlignLeft | Qt::AlignTop);
frame->setLayout(frameLayout); frame->setLayout(frameLayout);
scroll->setWidget(frame); scroll->setWidget(frame);
@ -809,8 +810,6 @@ TransferListFiltersWidget::TransferListFiltersWidget(QWidget *parent, TransferLi
trackerFilters = new TrackerFiltersList(this, transferList); trackerFilters = new TrackerFiltersList(this, transferList);
frameLayout->addWidget(trackerFilters); frameLayout->addWidget(trackerFilters);
frameLayout->addStretch();
connect(statusLabel, SIGNAL(toggled(bool)), statusFilters, SLOT(toggleFilter(bool))); connect(statusLabel, SIGNAL(toggled(bool)), statusFilters, SLOT(toggleFilter(bool)));
connect(statusLabel, SIGNAL(toggled(bool)), pref, SLOT(setStatusFilterState(const bool))); connect(statusLabel, SIGNAL(toggled(bool)), pref, SLOT(setStatusFilterState(const bool)));
connect(labelLabel, SIGNAL(toggled(bool)), labelFilters, SLOT(toggleFilter(bool))); connect(labelLabel, SIGNAL(toggled(bool)), labelFilters, SLOT(toggleFilter(bool)));

Loading…
Cancel
Save