respect system font sizes by default
This commit is contained in:
@@ -26,9 +26,11 @@ class ApplicationModelItem(QtGui.QStandardItem):
|
||||
self.setDropEnabled(False)
|
||||
self.setData(application, ApplicationItemDataRole.ApplicationRole)
|
||||
self.setData(icon, ApplicationItemDataRole.IconRole)
|
||||
font = QtGui.QFont()
|
||||
font.fromString(settings.value("ApplicationItem/font", type=str))
|
||||
self.setFont(font)
|
||||
|
||||
if s := settings.value("ApplicationItem/font", type=str):
|
||||
font = QtGui.QFont()
|
||||
font.fromString(s)
|
||||
self.setFont(font)
|
||||
if icon:
|
||||
self.setIcon(icon)
|
||||
|
||||
@@ -44,9 +46,10 @@ class ApplicationAllMessagesItem(QtGui.QStandardItem):
|
||||
super(ApplicationAllMessagesItem, self).__init__("ALL MESSAGES")
|
||||
self.setDropEnabled(False)
|
||||
self.setDragEnabled(False)
|
||||
font = QtGui.QFont()
|
||||
font.fromString(settings.value("ApplicationItem/font", type=str))
|
||||
self.setFont(font)
|
||||
if s := settings.value("ApplicationItem/font", type=str):
|
||||
font = QtGui.QFont()
|
||||
font.fromString(s)
|
||||
self.setFont(font)
|
||||
|
||||
|
||||
class ApplicationModel(QtGui.QStandardItemModel):
|
||||
|
||||
@@ -68,7 +68,10 @@ class MainWindow(QtWidgets.QMainWindow, Ui_MainWindow):
|
||||
self.listView_applications.setIconSize(QtCore.QSize(size, size))
|
||||
|
||||
font_title = QtGui.QFont()
|
||||
font_title.fromString(settings.value("MainWindow/font/application", type=str))
|
||||
if s := settings.value("MainWindow/font/application", type=str):
|
||||
font_title.fromString(s)
|
||||
else:
|
||||
font_title.setBold(True)
|
||||
self.label_application.setFont(font_title)
|
||||
|
||||
# Set tooltips
|
||||
|
||||
@@ -21,17 +21,7 @@ class MessageWidget(QtWidgets.QWidget, Ui_Form):
|
||||
message = message_item.data(MessageItemDataRole.MessageRole)
|
||||
|
||||
# Fonts
|
||||
font_title = QtGui.QFont()
|
||||
font_date = QtGui.QFont()
|
||||
font_content = QtGui.QFont()
|
||||
|
||||
font_title.fromString(settings.value("MessageWidget/font/title", type=str))
|
||||
font_date.fromString(settings.value("MessageWidget/font/date", type=str))
|
||||
font_content.fromString(settings.value("MessageWidget/font/message", type=str))
|
||||
|
||||
self.label_title.setFont(font_title)
|
||||
self.label_date.setFont(font_date)
|
||||
self.label_message.setFont(font_content)
|
||||
self.set_fonts()
|
||||
|
||||
# Display message contents
|
||||
self.label_title.setText(message.title)
|
||||
@@ -74,6 +64,28 @@ class MessageWidget(QtWidgets.QWidget, Ui_Form):
|
||||
|
||||
self.link_callbacks()
|
||||
|
||||
def set_fonts(self):
|
||||
font_title = QtGui.QFont()
|
||||
font_date = QtGui.QFont()
|
||||
font_content = QtGui.QFont()
|
||||
|
||||
if s := settings.value("MessageWidget/font/title", type=str):
|
||||
font_title.fromString(s)
|
||||
else:
|
||||
font_title.setBold(True)
|
||||
|
||||
if s := settings.value("MessageWidget/font/date", type=str):
|
||||
font_date.fromString(s)
|
||||
else:
|
||||
font_date.setItalic(True)
|
||||
|
||||
if s := settings.value("MessageWidget/font/message", type=str):
|
||||
font_content.fromString(s)
|
||||
|
||||
self.label_title.setFont(font_title)
|
||||
self.label_date.setFont(font_date)
|
||||
self.label_message.setFont(font_content)
|
||||
|
||||
def link_callbacks(self):
|
||||
self.pb_delete.clicked.connect(
|
||||
lambda: self.deletion_requested.emit(self.message_item)
|
||||
|
||||
Reference in New Issue
Block a user