Skip to content
Snippets Groups Projects
Commit fa8e3589 authored by Thomas Holene Løkkeborg's avatar Thomas Holene Løkkeborg
Browse files

Merge branch 'modul-fritekst' of...

Merge branch 'modul-fritekst' of https://gitlab.stud.idi.ntnu.no/bachelor-paa-bittet/soitool into modul-fritekst
parents 3a72ec4f e4114ff4
No related branches found
No related tags found
1 merge request!51Modul fritekst
Pipeline #77884 passed
"""Base/interface of each module."""
from abc import ABC
from PySide2.QtGui import QFont
from PySide2 import QtGui
HEADER_FONT = QFont()
HEADER_FONT.setFamily("Arial")
HEADER_FONT.setPointSize(12)
HEADER_FONT.setWeight(100)
HEADLINE_FONT = QtGui.QFont()
HEADLINE_FONT.setFamily("Arial")
HEADLINE_FONT.setPointSize(12)
HEADLINE_FONT.setWeight(100)
class ModuleBase(ABC):
......
......@@ -11,10 +11,9 @@ from PySide2.QtWidgets import (
QTextEdit,
QSizePolicy,
)
from PySide2 import QtGui
from PySide2.QtCore import QSize, Qt
from PySide2.QtGui import QIcon, QFontMetricsF
from soitool.modules.module_base import ModuleBase, HEADER_FONT
from soitool.modules.module_base import ModuleBase, HEADLINE_FONT
class TextEditWithSizeOfContent(QTextEdit):
......@@ -112,7 +111,7 @@ class FreeTextModule(ModuleBase, QWidget, metaclass=Meta):
ModuleBase.__init__(self)
self.line_edit_header = LineEditWithSizeOfContent()
self.line_edit_header.setFont(HEADER_FONT)
self.line_edit_header.setFont(HEADLINE_FONT)
self.text_edit_body = TextEditWithSizeOfContent()
# When the contents of these widget changes we need to manually trigger
......
......@@ -2,7 +2,7 @@
from PySide2.QtWidgets import QTableWidget, QTableWidgetItem
from PySide2 import QtGui, QtCore
from PySide2.QtGui import QIcon
from soitool.modules.module_base import ModuleBase, HEADER_FONT
from soitool.modules.module_base import ModuleBase, HEADLINE_FONT
START_ROWS = 2
START_COLUMNS = 2
......@@ -120,7 +120,7 @@ class TableModule(ModuleBase, QTableWidget, metaclass=Meta):
"""
item = QTableWidgetItem(text)
item.setBackground(QtGui.QBrush(QtGui.QColor(220, 220, 220)))
item.setFont(HEADER_FONT)
item.setFont(HEADLINE_FONT)
self.setItem(0, column, item)
def add_column(self):
......
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