message fonts setting

This commit is contained in:
dries.k
2022-02-10 17:56:39 +01:00
parent fe6628fc4d
commit ff8f7328fa
7 changed files with 393 additions and 232 deletions

View File

@@ -39,20 +39,20 @@ class Ui_Form(object):
self.label_title.setTextInteractionFlags(QtCore.Qt.TextInteractionFlag.LinksAccessibleByMouse|QtCore.Qt.TextInteractionFlag.TextSelectableByMouse)
self.label_title.setObjectName("label_title")
self.gridLayout_frame.addWidget(self.label_title, 0, 1, 1, 1)
self.text_message = QtWidgets.QLabel(self.frame)
self.label_message = QtWidgets.QLabel(self.frame)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Preferred, QtWidgets.QSizePolicy.Policy.MinimumExpanding)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.text_message.sizePolicy().hasHeightForWidth())
self.text_message.setSizePolicy(sizePolicy)
sizePolicy.setHeightForWidth(self.label_message.sizePolicy().hasHeightForWidth())
self.label_message.setSizePolicy(sizePolicy)
font = QtGui.QFont()
font.setPointSize(11)
self.text_message.setFont(font)
self.text_message.setWordWrap(True)
self.text_message.setOpenExternalLinks(True)
self.text_message.setTextInteractionFlags(QtCore.Qt.TextInteractionFlag.LinksAccessibleByMouse|QtCore.Qt.TextInteractionFlag.TextSelectableByMouse)
self.text_message.setObjectName("text_message")
self.gridLayout_frame.addWidget(self.text_message, 3, 1, 1, 3)
self.label_message.setFont(font)
self.label_message.setWordWrap(True)
self.label_message.setOpenExternalLinks(True)
self.label_message.setTextInteractionFlags(QtCore.Qt.TextInteractionFlag.LinksAccessibleByMouse|QtCore.Qt.TextInteractionFlag.TextSelectableByMouse)
self.label_message.setObjectName("label_message")
self.gridLayout_frame.addWidget(self.label_message, 3, 1, 1, 3)
self.label_date = QtWidgets.QLabel(self.frame)
font = QtGui.QFont()
font.setPointSize(11)
@@ -80,7 +80,7 @@ class Ui_Form(object):
_translate = QtCore.QCoreApplication.translate
Form.setWindowTitle(_translate("Form", "Form"))
self.label_title.setText(_translate("Form", "Title"))
self.text_message.setText(_translate("Form", "TextLabel"))
self.label_message.setText(_translate("Form", "TextLabel"))
self.label_date.setText(_translate("Form", "Date"))

View File

@@ -71,7 +71,7 @@
</widget>
</item>
<item row="3" column="1" colspan="3">
<widget class="QLabel" name="text_message">
<widget class="QLabel" name="label_message">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>

View File

@@ -12,41 +12,49 @@ from PyQt6 import QtCore, QtGui, QtWidgets
class Ui_Dialog(object):
def setupUi(self, Dialog):
Dialog.setObjectName("Dialog")
Dialog.resize(375, 292)
self.verticalLayout = QtWidgets.QVBoxLayout(Dialog)
self.verticalLayout.setObjectName("verticalLayout")
self.groupBox_5 = QtWidgets.QGroupBox(Dialog)
Dialog.resize(384, 391)
self.gridLayout = QtWidgets.QGridLayout(Dialog)
self.gridLayout.setObjectName("gridLayout")
self.buttonBox = QtWidgets.QDialogButtonBox(Dialog)
self.buttonBox.setOrientation(QtCore.Qt.Orientation.Horizontal)
self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.StandardButton.Apply|QtWidgets.QDialogButtonBox.StandardButton.Cancel|QtWidgets.QDialogButtonBox.StandardButton.Ok)
self.buttonBox.setObjectName("buttonBox")
self.gridLayout.addWidget(self.buttonBox, 1, 0, 1, 1)
self.tabWidget = QtWidgets.QTabWidget(Dialog)
self.tabWidget.setObjectName("tabWidget")
self.tab_general = QtWidgets.QWidget()
self.tab_general.setObjectName("tab_general")
self.verticalLayout_4 = QtWidgets.QVBoxLayout(self.tab_general)
self.verticalLayout_4.setObjectName("verticalLayout_4")
self.groupBox_5 = QtWidgets.QGroupBox(self.tab_general)
self.groupBox_5.setObjectName("groupBox_5")
self.gridLayout_4 = QtWidgets.QGridLayout(self.groupBox_5)
self.gridLayout_4.setObjectName("gridLayout_4")
spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Minimum)
self.gridLayout_4.addItem(spacerItem, 1, 2, 1, 1)
self.label_6 = QtWidgets.QLabel(self.groupBox_5)
self.label_6.setObjectName("label_6")
self.gridLayout_4.addWidget(self.label_6, 2, 2, 1, 1)
self.label_5 = QtWidgets.QLabel(self.groupBox_5)
self.label_5.setObjectName("label_5")
self.gridLayout_4.addWidget(self.label_5, 2, 0, 1, 1)
self.spin_duration = QtWidgets.QSpinBox(self.groupBox_5)
self.spin_duration.setMinimum(500)
self.spin_duration.setMaximum(30000)
self.spin_duration.setSingleStep(100)
self.spin_duration.setObjectName("spin_duration")
self.gridLayout_4.addWidget(self.spin_duration, 2, 1, 1, 1)
self.gridLayout_4.addWidget(self.spin_duration, 1, 1, 1, 1)
self.label_6 = QtWidgets.QLabel(self.groupBox_5)
self.label_6.setObjectName("label_6")
self.gridLayout_4.addWidget(self.label_6, 1, 2, 1, 1)
self.label_5 = QtWidgets.QLabel(self.groupBox_5)
self.label_5.setObjectName("label_5")
self.gridLayout_4.addWidget(self.label_5, 1, 0, 1, 1)
spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Minimum)
self.gridLayout_4.addItem(spacerItem, 0, 2, 1, 1)
self.label_4 = QtWidgets.QLabel(self.groupBox_5)
self.label_4.setObjectName("label_4")
self.gridLayout_4.addWidget(self.label_4, 0, 0, 1, 1)
self.spin_priority = QtWidgets.QSpinBox(self.groupBox_5)
self.spin_priority.setMinimum(1)
self.spin_priority.setMaximum(10)
self.spin_priority.setProperty("value", 5)
self.spin_priority.setObjectName("spin_priority")
self.gridLayout_4.addWidget(self.spin_priority, 1, 1, 1, 1)
self.label_4 = QtWidgets.QLabel(self.groupBox_5)
self.label_4.setObjectName("label_4")
self.gridLayout_4.addWidget(self.label_4, 1, 0, 1, 1)
self.cb_icons_notification = QtWidgets.QCheckBox(self.groupBox_5)
self.cb_icons_notification.setObjectName("cb_icons_notification")
self.gridLayout_4.addWidget(self.cb_icons_notification, 0, 0, 1, 3)
self.verticalLayout.addWidget(self.groupBox_5)
self.groupBox_4 = QtWidgets.QGroupBox(Dialog)
self.gridLayout_4.addWidget(self.spin_priority, 0, 1, 1, 1)
self.verticalLayout_4.addWidget(self.groupBox_5)
self.groupBox_4 = QtWidgets.QGroupBox(self.tab_general)
self.groupBox_4.setObjectName("groupBox_4")
self.gridLayout_3 = QtWidgets.QGridLayout(self.groupBox_4)
self.gridLayout_3.setObjectName("gridLayout_3")
@@ -55,8 +63,8 @@ class Ui_Dialog(object):
self.gridLayout_3.addWidget(self.pb_change_server_info, 0, 0, 1, 1)
spacerItem1 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Minimum)
self.gridLayout_3.addItem(spacerItem1, 0, 1, 1, 1)
self.verticalLayout.addWidget(self.groupBox_4)
self.groupBox_7 = QtWidgets.QGroupBox(Dialog)
self.verticalLayout_4.addWidget(self.groupBox_4)
self.groupBox_7 = QtWidgets.QGroupBox(self.tab_general)
self.groupBox_7.setObjectName("groupBox_7")
self.gridLayout_6 = QtWidgets.QGridLayout(self.groupBox_7)
self.gridLayout_6.setObjectName("gridLayout_6")
@@ -72,22 +80,51 @@ class Ui_Dialog(object):
self.gridLayout_6.addWidget(self.pb_open_log, 0, 2, 1, 1)
spacerItem2 = QtWidgets.QSpacerItem(190, 20, QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Minimum)
self.gridLayout_6.addItem(spacerItem2, 0, 3, 1, 1)
self.verticalLayout.addWidget(self.groupBox_7)
self.buttonBox = QtWidgets.QDialogButtonBox(Dialog)
self.buttonBox.setOrientation(QtCore.Qt.Orientation.Horizontal)
self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.StandardButton.Apply|QtWidgets.QDialogButtonBox.StandardButton.Cancel|QtWidgets.QDialogButtonBox.StandardButton.Ok)
self.buttonBox.setObjectName("buttonBox")
self.verticalLayout.addWidget(self.buttonBox)
self.verticalLayout_4.addWidget(self.groupBox_7)
spacerItem3 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Policy.Minimum, QtWidgets.QSizePolicy.Policy.Expanding)
self.verticalLayout_4.addItem(spacerItem3)
self.tabWidget.addTab(self.tab_general, "")
self.tab_fonts = QtWidgets.QWidget()
self.tab_fonts.setObjectName("tab_fonts")
self.verticalLayout_5 = QtWidgets.QVBoxLayout(self.tab_fonts)
self.verticalLayout_5.setObjectName("verticalLayout_5")
self.groupBox_2 = QtWidgets.QGroupBox(self.tab_fonts)
self.groupBox_2.setObjectName("groupBox_2")
self.layout_fonts_message = QtWidgets.QVBoxLayout(self.groupBox_2)
self.layout_fonts_message.setContentsMargins(4, 4, 4, 4)
self.layout_fonts_message.setSpacing(6)
self.layout_fonts_message.setObjectName("layout_fonts_message")
self.horizontalLayout = QtWidgets.QHBoxLayout()
self.horizontalLayout.setObjectName("horizontalLayout")
self.pb_font_message_title = QtWidgets.QPushButton(self.groupBox_2)
self.pb_font_message_title.setObjectName("pb_font_message_title")
self.horizontalLayout.addWidget(self.pb_font_message_title)
self.pb_font_message_date = QtWidgets.QPushButton(self.groupBox_2)
self.pb_font_message_date.setObjectName("pb_font_message_date")
self.horizontalLayout.addWidget(self.pb_font_message_date)
self.pb_font_message_content = QtWidgets.QPushButton(self.groupBox_2)
self.pb_font_message_content.setObjectName("pb_font_message_content")
self.horizontalLayout.addWidget(self.pb_font_message_content)
self.layout_fonts_message.addLayout(self.horizontalLayout)
self.verticalLayout_5.addWidget(self.groupBox_2)
spacerItem4 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Policy.Minimum, QtWidgets.QSizePolicy.Policy.Expanding)
self.verticalLayout_5.addItem(spacerItem4)
self.tabWidget.addTab(self.tab_fonts, "")
self.gridLayout.addWidget(self.tabWidget, 0, 0, 1, 1)
self.retranslateUi(Dialog)
self.tabWidget.setCurrentIndex(0)
self.buttonBox.accepted.connect(Dialog.accept)
self.buttonBox.rejected.connect(Dialog.reject)
QtCore.QMetaObject.connectSlotsByName(Dialog)
Dialog.setTabOrder(self.cb_icons_notification, self.spin_priority)
Dialog.setTabOrder(self.tabWidget, self.spin_priority)
Dialog.setTabOrder(self.spin_priority, self.spin_duration)
Dialog.setTabOrder(self.spin_duration, self.pb_change_server_info)
Dialog.setTabOrder(self.pb_change_server_info, self.combo_logging)
Dialog.setTabOrder(self.combo_logging, self.pb_open_log)
Dialog.setTabOrder(self.pb_open_log, self.pb_font_message_title)
Dialog.setTabOrder(self.pb_font_message_title, self.pb_font_message_date)
Dialog.setTabOrder(self.pb_font_message_date, self.pb_font_message_content)
def retranslateUi(self, Dialog):
_translate = QtCore.QCoreApplication.translate
@@ -96,13 +133,18 @@ class Ui_Dialog(object):
self.label_6.setText(_translate("Dialog", "ms"))
self.label_5.setText(_translate("Dialog", "Notification duration"))
self.label_4.setText(_translate("Dialog", "Minimum priority to show notifications:"))
self.cb_icons_notification.setText(_translate("Dialog", "Show notification icons"))
self.groupBox_4.setTitle(_translate("Dialog", "Server info"))
self.pb_change_server_info.setText(_translate("Dialog", "Change server info"))
self.groupBox_7.setTitle(_translate("Dialog", "Logging"))
self.label_7.setText(_translate("Dialog", "Level"))
self.pb_open_log.setToolTip(_translate("Dialog", "Open logfile"))
self.pb_open_log.setText(_translate("Dialog", "..."))
self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_general), _translate("Dialog", "General"))
self.groupBox_2.setTitle(_translate("Dialog", "Message"))
self.pb_font_message_title.setText(_translate("Dialog", "Title"))
self.pb_font_message_date.setText(_translate("Dialog", "Date"))
self.pb_font_message_content.setText(_translate("Dialog", "Message"))
self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_fonts), _translate("Dialog", "Fonts"))
if __name__ == "__main__":

View File

@@ -6,168 +6,15 @@
<rect>
<x>0</x>
<y>0</y>
<width>375</width>
<height>292</height>
<width>384</width>
<height>391</height>
</rect>
</property>
<property name="windowTitle">
<string>Dialog</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QGroupBox" name="groupBox_5">
<property name="title">
<string>Notifications</string>
</property>
<layout class="QGridLayout" name="gridLayout_4">
<item row="1" column="2">
<spacer name="horizontalSpacer_3">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="2" column="2">
<widget class="QLabel" name="label_6">
<property name="text">
<string>ms</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_5">
<property name="text">
<string>Notification duration</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QSpinBox" name="spin_duration">
<property name="minimum">
<number>500</number>
</property>
<property name="maximum">
<number>30000</number>
</property>
<property name="singleStep">
<number>100</number>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QSpinBox" name="spin_priority">
<property name="minimum">
<number>1</number>
</property>
<property name="maximum">
<number>10</number>
</property>
<property name="value">
<number>5</number>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_4">
<property name="text">
<string>Minimum priority to show notifications:</string>
</property>
</widget>
</item>
<item row="0" column="0" colspan="3">
<widget class="QCheckBox" name="cb_icons_notification">
<property name="text">
<string>Show notification icons</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="groupBox_4">
<property name="title">
<string>Server info</string>
</property>
<layout class="QGridLayout" name="gridLayout_3">
<item row="0" column="0">
<widget class="QPushButton" name="pb_change_server_info">
<property name="text">
<string>Change server info</string>
</property>
</widget>
</item>
<item row="0" column="1">
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="groupBox_7">
<property name="title">
<string>Logging</string>
</property>
<layout class="QGridLayout" name="gridLayout_6">
<item row="0" column="0">
<widget class="QLabel" name="label_7">
<property name="text">
<string>Level</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QComboBox" name="combo_logging"/>
</item>
<item row="0" column="2">
<widget class="QPushButton" name="pb_open_log">
<property name="maximumSize">
<size>
<width>30</width>
<height>16777215</height>
</size>
</property>
<property name="toolTip">
<string>Open logfile</string>
</property>
<property name="text">
<string>...</string>
</property>
</widget>
</item>
<item row="0" column="3">
<spacer name="horizontalSpacer_5">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>190</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>
<item>
<layout class="QGridLayout" name="gridLayout">
<item row="1" column="0">
<widget class="QDialogButtonBox" name="buttonBox">
<property name="orientation">
<enum>Qt::Horizontal</enum>
@@ -177,15 +24,260 @@
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QTabWidget" name="tabWidget">
<property name="currentIndex">
<number>0</number>
</property>
<widget class="QWidget" name="tab_general">
<attribute name="title">
<string>General</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_4">
<item>
<widget class="QGroupBox" name="groupBox_5">
<property name="title">
<string>Notifications</string>
</property>
<layout class="QGridLayout" name="gridLayout_4">
<item row="1" column="1">
<widget class="QSpinBox" name="spin_duration">
<property name="minimum">
<number>500</number>
</property>
<property name="maximum">
<number>30000</number>
</property>
<property name="singleStep">
<number>100</number>
</property>
</widget>
</item>
<item row="1" column="2">
<widget class="QLabel" name="label_6">
<property name="text">
<string>ms</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_5">
<property name="text">
<string>Notification duration</string>
</property>
</widget>
</item>
<item row="0" column="2">
<spacer name="horizontalSpacer_3">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="0">
<widget class="QLabel" name="label_4">
<property name="text">
<string>Minimum priority to show notifications:</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QSpinBox" name="spin_priority">
<property name="minimum">
<number>1</number>
</property>
<property name="maximum">
<number>10</number>
</property>
<property name="value">
<number>5</number>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="groupBox_4">
<property name="title">
<string>Server info</string>
</property>
<layout class="QGridLayout" name="gridLayout_3">
<item row="0" column="0">
<widget class="QPushButton" name="pb_change_server_info">
<property name="text">
<string>Change server info</string>
</property>
</widget>
</item>
<item row="0" column="1">
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="groupBox_7">
<property name="title">
<string>Logging</string>
</property>
<layout class="QGridLayout" name="gridLayout_6">
<item row="0" column="0">
<widget class="QLabel" name="label_7">
<property name="text">
<string>Level</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QComboBox" name="combo_logging"/>
</item>
<item row="0" column="2">
<widget class="QPushButton" name="pb_open_log">
<property name="maximumSize">
<size>
<width>30</width>
<height>16777215</height>
</size>
</property>
<property name="toolTip">
<string>Open logfile</string>
</property>
<property name="text">
<string>...</string>
</property>
</widget>
</item>
<item row="0" column="3">
<spacer name="horizontalSpacer_5">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>190</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<widget class="QWidget" name="tab_fonts">
<attribute name="title">
<string>Fonts</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_5">
<item>
<widget class="QGroupBox" name="groupBox_2">
<property name="title">
<string>Message</string>
</property>
<layout class="QVBoxLayout" name="layout_fonts_message">
<property name="spacing">
<number>6</number>
</property>
<property name="leftMargin">
<number>4</number>
</property>
<property name="topMargin">
<number>4</number>
</property>
<property name="rightMargin">
<number>4</number>
</property>
<property name="bottomMargin">
<number>4</number>
</property>
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QPushButton" name="pb_font_message_title">
<property name="text">
<string>Title</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pb_font_message_date">
<property name="text">
<string>Date</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pb_font_message_content">
<property name="text">
<string>Message</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
</item>
<item>
<spacer name="verticalSpacer_3">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</widget>
</item>
</layout>
</widget>
<tabstops>
<tabstop>cb_icons_notification</tabstop>
<tabstop>tabWidget</tabstop>
<tabstop>spin_priority</tabstop>
<tabstop>spin_duration</tabstop>
<tabstop>pb_change_server_info</tabstop>
<tabstop>combo_logging</tabstop>
<tabstop>pb_open_log</tabstop>
<tabstop>pb_font_message_title</tabstop>
<tabstop>pb_font_message_date</tabstop>
<tabstop>pb_font_message_content</tabstop>
</tabstops>
<resources/>
<connections>
@@ -196,8 +288,8 @@
<slot>accept()</slot>
<hints>
<hint type="sourcelabel">
<x>248</x>
<y>254</y>
<x>257</x>
<y>330</y>
</hint>
<hint type="destinationlabel">
<x>157</x>
@@ -212,8 +304,8 @@
<slot>reject()</slot>
<hints>
<hint type="sourcelabel">
<x>316</x>
<y>260</y>
<x>325</x>
<y>330</y>
</hint>
<hint type="destinationlabel">
<x>286</x>