summaryrefslogtreecommitdiffstats
path: root/ui/article_detail.py
diff options
context:
space:
mode:
authorDanilo M. <danix@danix.xyz>2026-05-03 10:37:59 +0200
committerDanilo M. <danix@danix.xyz>2026-05-03 10:37:59 +0200
commitd4e151f6782dc7a66313eb92bf6e05fa2d343823 (patch)
tree2d454705e8fd6a0df52c3d189c817e6c8717b4c3 /ui/article_detail.py
parentccbefa7b40f883e85c2b16e48519bece2b909c0c (diff)
downloadpublisher-d4e151f6782dc7a66313eb92bf6e05fa2d343823.tar.gz
publisher-d4e151f6782dc7a66313eb92bf6e05fa2d343823.zip
fix: remove dead code/imports, wrap fm column in QScrollArea, fix path display, simplify _save
Diffstat (limited to 'ui/article_detail.py')
-rw-r--r--ui/article_detail.py15
1 files changed, 9 insertions, 6 deletions
diff --git a/ui/article_detail.py b/ui/article_detail.py
index 77dadb7..1fe1643 100644
--- a/ui/article_detail.py
+++ b/ui/article_detail.py
@@ -1,9 +1,8 @@
from __future__ import annotations
-import subprocess
import re
from PyQt6.QtWidgets import (
QWidget, QVBoxLayout, QHBoxLayout, QLabel,
- QPushButton, QTextBrowser, QScrollArea, QSizePolicy, QFrame,
+ QPushButton, QTextBrowser, QScrollArea, QFrame,
)
from PyQt6.QtCore import pyqtSignal, Qt
from core.models import Article
@@ -64,9 +63,12 @@ class ArticleDetailView(QWidget):
body.setContentsMargins(0, 0, 0, 0)
body.setSpacing(0)
- # Frontmatter column
+ # Frontmatter column (scrollable)
+ fm_scroll = QScrollArea()
+ fm_scroll.setFixedWidth(230)
+ fm_scroll.setWidgetResizable(True)
+ fm_scroll.setStyleSheet("QScrollArea { background:#0a0a12; border:none; }")
self._fm_widget = QWidget()
- self._fm_widget.setFixedWidth(230)
self._fm_widget.setStyleSheet("background:#0a0a12;")
self._fm_layout = QVBoxLayout(self._fm_widget)
self._fm_layout.setContentsMargins(10, 10, 10, 10)
@@ -76,7 +78,8 @@ class ArticleDetailView(QWidget):
self._fm_content = QVBoxLayout()
self._fm_layout.addLayout(self._fm_content)
self._fm_layout.addStretch()
- body.addWidget(self._fm_widget)
+ fm_scroll.setWidget(self._fm_widget)
+ body.addWidget(fm_scroll)
divider = QFrame()
divider.setFrameShape(QFrame.Shape.VLine)
@@ -101,7 +104,7 @@ class ArticleDetailView(QWidget):
def set_article(self, article: Article):
self._article = article
self._title_label.setText(article.slug)
- rel = str(article.path).replace(str(article.path.parent.parent.parent.parent), "")
+ rel = "/".join(article.path.parts[-5:])
self._path_label.setText(rel)
# Populate frontmatter