Browse Source

Remove indentation for category/tag filter widgets in all platforms

adaptive-webui-19844
thalieht 7 years ago
parent
commit
2da5800665
  1. 5
      src/gui/categoryfilterwidget.cpp
  2. 2
      src/gui/categoryfilterwidget.h
  3. 2
      src/gui/tagfilterwidget.cpp

5
src/gui/categoryfilterwidget.cpp

@ -73,10 +73,10 @@ CategoryFilterWidget::CategoryFilterWidget(QWidget *parent)
setIconSize(Utils::Misc::smallIconSize()); setIconSize(Utils::Misc::smallIconSize());
#ifdef Q_OS_MAC #ifdef Q_OS_MAC
setAttribute(Qt::WA_MacShowFocusRect, false); setAttribute(Qt::WA_MacShowFocusRect, false);
#endif
m_defaultIndentation = indentation(); m_defaultIndentation = indentation();
if (!BitTorrent::Session::instance()->isSubcategoriesEnabled()) if (!BitTorrent::Session::instance()->isSubcategoriesEnabled())
setIndentation(0); setIndentation(0);
#endif
setContextMenuPolicy(Qt::CustomContextMenu); setContextMenuPolicy(Qt::CustomContextMenu);
sortByColumn(0, Qt::AscendingOrder); sortByColumn(0, Qt::AscendingOrder);
setCurrentIndex(model()->index(0, 0)); setCurrentIndex(model()->index(0, 0));
@ -157,12 +157,11 @@ void CategoryFilterWidget::showMenu(QPoint)
void CategoryFilterWidget::callUpdateGeometry() void CategoryFilterWidget::callUpdateGeometry()
{ {
#ifdef Q_OS_MAC
if (!BitTorrent::Session::instance()->isSubcategoriesEnabled()) if (!BitTorrent::Session::instance()->isSubcategoriesEnabled())
setIndentation(0); setIndentation(0);
else else
setIndentation(m_defaultIndentation); setIndentation(m_defaultIndentation);
#endif
updateGeometry(); updateGeometry();
} }

2
src/gui/categoryfilterwidget.h

@ -58,7 +58,5 @@ private:
void rowsInserted(const QModelIndex &parent, int start, int end) override; void rowsInserted(const QModelIndex &parent, int start, int end) override;
QString askCategoryName(); QString askCategoryName();
#ifdef Q_OS_MAC
int m_defaultIndentation; int m_defaultIndentation;
#endif
}; };

2
src/gui/tagfilterwidget.cpp

@ -73,8 +73,8 @@ TagFilterWidget::TagFilterWidget(QWidget *parent)
setIconSize(Utils::Misc::smallIconSize()); setIconSize(Utils::Misc::smallIconSize());
#if defined(Q_OS_MAC) #if defined(Q_OS_MAC)
setAttribute(Qt::WA_MacShowFocusRect, false); setAttribute(Qt::WA_MacShowFocusRect, false);
setIndentation(0);
#endif #endif
setIndentation(0);
setContextMenuPolicy(Qt::CustomContextMenu); setContextMenuPolicy(Qt::CustomContextMenu);
sortByColumn(0, Qt::AscendingOrder); sortByColumn(0, Qt::AscendingOrder);
setCurrentIndex(model()->index(0, 0)); setCurrentIndex(model()->index(0, 0));

Loading…
Cancel
Save