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

Leaves can't collapse

parent fe49beb6
No related branches found
No related tags found
No related merge requests found
Pipeline #2208 passed
...@@ -112,7 +112,7 @@ Page { ...@@ -112,7 +112,7 @@ Page {
spacing: Nheko.paddingMedium spacing: Nheko.paddingMedium
anchors.fill: parent anchors.fill: parent
anchors.margins: Nheko.paddingMedium anchors.margins: Nheko.paddingMedium
anchors.leftMargin: communitySidebar.collapsed ? Nheko.paddingMedium : (Nheko.paddingMedium * (model.depth + 1)) anchors.leftMargin: Nheko.paddingMedium + (communitySidebar.collapsed ? 0 : (fontMetrics.lineSpacing * model.depth))
ImageButton { ImageButton {
visible: !communitySidebar.collapsed && model.collapsible visible: !communitySidebar.collapsed && model.collapsible
...@@ -156,7 +156,7 @@ Page { ...@@ -156,7 +156,7 @@ Page {
visible: !communitySidebar.collapsed visible: !communitySidebar.collapsed
Layout.alignment: Qt.AlignVCenter Layout.alignment: Qt.AlignVCenter
color: communityItem.importantText color: communityItem.importantText
elideWidth: parent.width - avatar.width - r.anchors.leftMargin - Nheko.paddingMedium - fontMetrics.lineSpacing elideWidth: parent.width - avatar.width - r.anchors.leftMargin/2 - Nheko.paddingMedium - fontMetrics.lineSpacing
fullText: model.displayName fullText: model.displayName
textFormat: Text.PlainText textFormat: Text.PlainText
} }
......
...@@ -438,7 +438,6 @@ tagIdToCat(QString tagId) ...@@ -438,7 +438,6 @@ tagIdToCat(QString tagId)
bool bool
FilteredCommunitiesModel::lessThan(const QModelIndex &left, const QModelIndex &right) const FilteredCommunitiesModel::lessThan(const QModelIndex &left, const QModelIndex &right) const
{ {
nhlog::ui()->debug("lessThan");
QModelIndex const left_idx = sourceModel()->index(left.row(), 0, QModelIndex()); QModelIndex const left_idx = sourceModel()->index(left.row(), 0, QModelIndex());
QModelIndex const right_idx = sourceModel()->index(right.row(), 0, QModelIndex()); QModelIndex const right_idx = sourceModel()->index(right.row(), 0, QModelIndex());
......
...@@ -74,7 +74,7 @@ public: ...@@ -74,7 +74,7 @@ public:
const auto depth = tree[index].depth; const auto depth = tree[index].depth;
int i = index + 1; int i = index + 1;
for (; i < size(); i++) for (; i < size(); i++)
if (tree[i].depth == depth) if (tree[i].depth <= depth)
break; break;
return i - 1; return i - 1;
} }
......
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