From 53a1bfccdbadf81de06300efd799b231cfbfeea4 Mon Sep 17 00:00:00 2001 From: Kubat <mael.martin31@gmail.com> Date: Fri, 16 Jul 2021 13:33:48 +0200 Subject: [PATCH] FONT: Set custom font and style for the AssLinesView --- src/UI/DocumentViews/AssLinesView.cc | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/src/UI/DocumentViews/AssLinesView.cc b/src/UI/DocumentViews/AssLinesView.cc index a29245be..319e3b06 100644 --- a/src/UI/DocumentViews/AssLinesView.cc +++ b/src/UI/DocumentViews/AssLinesView.cc @@ -9,13 +9,6 @@ AssLinesView::AssLinesView(QAbstractItemModel *model, QWidget *parent) noexcept : QTableView(parent) , delegate(new Delegate(this)) { - // Force the 9pt font size for now - { - QFont f = font(); - f.setPointSize(9); - setFont(f); - } - setMouseTracking(true); setItemDelegate(delegate); connect(this, &AssLinesView::hoverIndexChanged, delegate, @@ -30,23 +23,19 @@ AssLinesView::AssLinesView(QAbstractItemModel *model, QWidget *parent) noexcept setSelectionBehavior(QAbstractItemView::SelectRows); setShowGrid(false); - // Also set the 9pt font size for the headers - { - QFont f = horizontalHeader()->font(); - f.setPointSize(9); - horizontalHeader()->setFont(f); - verticalHeader()->setFont(f); - } - - static const QString style = "QTableView::item:selected {" + static const QString style = "* { font-family: \"FiraCode\"; font-size: 8pt; }" + "QTableView::item:selected {" " border-top:1px solid #1394B4;" " border-bottom:1px solid #1394B4;" " border-right:1px solid #1394B4;" " border-left:1px solid #1394B4;" " background-color: #002B36;" + " color: white;" "}" "QTableView::item {" " border: 1px solid #474747;" + " background-color: #232629;" + " color: white;" "};" "QTableView::item:last:selected {" " border-top:1px solid #1394B4;" @@ -54,6 +43,7 @@ AssLinesView::AssLinesView(QAbstractItemModel *model, QWidget *parent) noexcept " border-right:1px solid #1394B4;" " border-left:1px solid #1394B4;" " background-color: #002B36;" + " color: white;" "}"; setStyleSheet(style); setModel(model); -- GitLab