Skip to content
Snippets Groups Projects
Verified Commit aa5d2098 authored by Nicolas Werner's avatar Nicolas Werner
Browse files

Don't waste space for non existing subspaces

parent fee2f5c7
No related branches found
No related tags found
No related merge requests found
Pipeline #2210 passed
......@@ -131,7 +131,7 @@ Page {
Item {
Layout.preferredWidth: fontMetrics.lineSpacing
visible: !communitySidebar.collapsed && !model.collapsible
visible: !communitySidebar.collapsed && !model.collapsible && Communities.containsSubspaces
}
Avatar {
......
......@@ -280,6 +280,7 @@ CommunitiesModel::initializeSidebar()
emit tagsChanged();
emit hiddenTagsChanged();
emit containsSubspacesChanged();
}
void
......
......@@ -33,6 +33,7 @@ class CommunitiesModel : public QAbstractListModel
currentTagIdChanged RESET resetCurrentTagId)
Q_PROPERTY(QStringList tags READ tags NOTIFY tagsChanged)
Q_PROPERTY(QStringList tagsWithDefault READ tagsWithDefault NOTIFY tagsChanged)
Q_PROPERTY(bool containsSubspaces READ containsSubspaces NOTIFY containsSubspacesChanged)
public:
enum Roles
......@@ -103,6 +104,14 @@ public:
QVariant data(const QModelIndex &index, int role) const override;
bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole) override;
bool containsSubspaces() const
{
for (const auto &e : spaceOrder_.tree)
if (e.depth > 0)
return true;
return false;
}
public slots:
void initializeSidebar();
void sync(const mtx::responses::Sync &sync_);
......@@ -131,6 +140,7 @@ signals:
void currentTagIdChanged(QString tagId);
void hiddenTagsChanged();
void tagsChanged();
void containsSubspacesChanged();
private:
QStringList tags_;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment