mirror of
https://github.com/olivierkes/manuskript.git
synced 2024-05-14 01:42:28 +12:00
Adds: settings for applicatoin font size
This commit is contained in:
parent
270d5544b8
commit
e62b473c47
|
@ -57,6 +57,12 @@ def prepare(tests=False):
|
|||
QIcon.setThemeSearchPaths(QIcon.themeSearchPaths() + [appPath("icons")])
|
||||
QIcon.setThemeName("NumixMsk")
|
||||
|
||||
# Font siue
|
||||
if settings.contains("appFontSize"):
|
||||
f = qApp.font()
|
||||
f.setPointSize(settings.value("appFontSize", type=int))
|
||||
app.setFont(f)
|
||||
|
||||
# Main window
|
||||
from manuskript.mainWindow import MainWindow
|
||||
|
||||
|
|
|
@ -92,6 +92,10 @@ class settingsWindow(QWidget, Ui_Settings):
|
|||
|
||||
self.cmbTranslation.currentIndexChanged.connect(self.setTranslation)
|
||||
|
||||
f = qApp.font()
|
||||
self.spnGeneralFontSize.setValue(f.pointSize())
|
||||
self.spnGeneralFontSize.valueChanged.connect(self.setAppFontSize)
|
||||
|
||||
self.txtAutoSave.setValidator(QIntValidator(0, 999, self))
|
||||
self.txtAutoSaveNoChanges.setValidator(QIntValidator(0, 999, self))
|
||||
self.chkAutoSave.setChecked(settings.autoSave)
|
||||
|
@ -302,6 +306,17 @@ class settingsWindow(QWidget, Ui_Settings):
|
|||
|
||||
# QMessageBox.information(self, "Warning", "You'll have to restart manuskript.")
|
||||
|
||||
def setAppFontSize(self, val):
|
||||
"""
|
||||
Set application default font point size.
|
||||
"""
|
||||
f = qApp.font()
|
||||
f.setPointSize(val)
|
||||
qApp.setFont(f)
|
||||
mainWindow().setFont(f)
|
||||
sttgs = QSettings(qApp.organizationName(), qApp.applicationName())
|
||||
sttgs.setValue("appFontSize", val)
|
||||
|
||||
def saveSettingsChanged(self):
|
||||
if self.txtAutoSave.text() in ["", "0"]:
|
||||
self.txtAutoSave.setText("1")
|
||||
|
|
|
@ -11,7 +11,7 @@ from PyQt5 import QtCore, QtGui, QtWidgets
|
|||
class Ui_Settings(object):
|
||||
def setupUi(self, Settings):
|
||||
Settings.setObjectName("Settings")
|
||||
Settings.resize(658, 632)
|
||||
Settings.resize(658, 598)
|
||||
self.horizontalLayout_8 = QtWidgets.QHBoxLayout(Settings)
|
||||
self.horizontalLayout_8.setObjectName("horizontalLayout_8")
|
||||
self.lstMenu = QtWidgets.QListWidget(Settings)
|
||||
|
@ -52,8 +52,51 @@ class Ui_Settings(object):
|
|||
font.setWeight(75)
|
||||
self.groupBox_2.setFont(font)
|
||||
self.groupBox_2.setObjectName("groupBox_2")
|
||||
self.verticalLayout_5 = QtWidgets.QVBoxLayout(self.groupBox_2)
|
||||
self.verticalLayout_5.setObjectName("verticalLayout_5")
|
||||
self.formLayout_13 = QtWidgets.QFormLayout(self.groupBox_2)
|
||||
self.formLayout_13.setFieldGrowthPolicy(QtWidgets.QFormLayout.FieldsStayAtSizeHint)
|
||||
self.formLayout_13.setObjectName("formLayout_13")
|
||||
self.label_56 = QtWidgets.QLabel(self.groupBox_2)
|
||||
font = QtGui.QFont()
|
||||
font.setBold(False)
|
||||
font.setWeight(50)
|
||||
self.label_56.setFont(font)
|
||||
self.label_56.setObjectName("label_56")
|
||||
self.formLayout_13.setWidget(3, QtWidgets.QFormLayout.LabelRole, self.label_56)
|
||||
self.cmbStyle = QtWidgets.QComboBox(self.groupBox_2)
|
||||
font = QtGui.QFont()
|
||||
font.setBold(False)
|
||||
font.setWeight(50)
|
||||
self.cmbStyle.setFont(font)
|
||||
self.cmbStyle.setObjectName("cmbStyle")
|
||||
self.formLayout_13.setWidget(3, QtWidgets.QFormLayout.FieldRole, self.cmbStyle)
|
||||
self.label_57 = QtWidgets.QLabel(self.groupBox_2)
|
||||
font = QtGui.QFont()
|
||||
font.setBold(False)
|
||||
font.setWeight(50)
|
||||
self.label_57.setFont(font)
|
||||
self.label_57.setObjectName("label_57")
|
||||
self.formLayout_13.setWidget(6, QtWidgets.QFormLayout.LabelRole, self.label_57)
|
||||
self.cmbTranslation = QtWidgets.QComboBox(self.groupBox_2)
|
||||
font = QtGui.QFont()
|
||||
font.setBold(False)
|
||||
font.setWeight(50)
|
||||
self.cmbTranslation.setFont(font)
|
||||
self.cmbTranslation.setObjectName("cmbTranslation")
|
||||
self.formLayout_13.setWidget(6, QtWidgets.QFormLayout.FieldRole, self.cmbTranslation)
|
||||
self.label_58 = QtWidgets.QLabel(self.groupBox_2)
|
||||
font = QtGui.QFont()
|
||||
font.setBold(False)
|
||||
font.setWeight(50)
|
||||
self.label_58.setFont(font)
|
||||
self.label_58.setObjectName("label_58")
|
||||
self.formLayout_13.setWidget(7, QtWidgets.QFormLayout.LabelRole, self.label_58)
|
||||
self.spnGeneralFontSize = QtWidgets.QSpinBox(self.groupBox_2)
|
||||
font = QtGui.QFont()
|
||||
font.setBold(False)
|
||||
font.setWeight(50)
|
||||
self.spnGeneralFontSize.setFont(font)
|
||||
self.spnGeneralFontSize.setObjectName("spnGeneralFontSize")
|
||||
self.formLayout_13.setWidget(7, QtWidgets.QFormLayout.FieldRole, self.spnGeneralFontSize)
|
||||
self.label_2 = QtWidgets.QLabel(self.groupBox_2)
|
||||
font = QtGui.QFont()
|
||||
font.setBold(False)
|
||||
|
@ -61,39 +104,8 @@ class Ui_Settings(object):
|
|||
self.label_2.setFont(font)
|
||||
self.label_2.setWordWrap(True)
|
||||
self.label_2.setObjectName("label_2")
|
||||
self.verticalLayout_5.addWidget(self.label_2)
|
||||
self.cmbStyle = QtWidgets.QComboBox(self.groupBox_2)
|
||||
font = QtGui.QFont()
|
||||
font.setBold(False)
|
||||
font.setWeight(50)
|
||||
self.cmbStyle.setFont(font)
|
||||
self.cmbStyle.setObjectName("cmbStyle")
|
||||
self.verticalLayout_5.addWidget(self.cmbStyle)
|
||||
self.formLayout_13.setWidget(2, QtWidgets.QFormLayout.SpanningRole, self.label_2)
|
||||
self.verticalLayout_7.addWidget(self.groupBox_2)
|
||||
self.groupBox_14 = QtWidgets.QGroupBox(self.stackedWidgetPage1)
|
||||
font = QtGui.QFont()
|
||||
font.setBold(True)
|
||||
font.setWeight(75)
|
||||
self.groupBox_14.setFont(font)
|
||||
self.groupBox_14.setObjectName("groupBox_14")
|
||||
self.verticalLayout_20 = QtWidgets.QVBoxLayout(self.groupBox_14)
|
||||
self.verticalLayout_20.setObjectName("verticalLayout_20")
|
||||
self.label_52 = QtWidgets.QLabel(self.groupBox_14)
|
||||
font = QtGui.QFont()
|
||||
font.setBold(False)
|
||||
font.setWeight(50)
|
||||
self.label_52.setFont(font)
|
||||
self.label_52.setWordWrap(True)
|
||||
self.label_52.setObjectName("label_52")
|
||||
self.verticalLayout_20.addWidget(self.label_52)
|
||||
self.cmbTranslation = QtWidgets.QComboBox(self.groupBox_14)
|
||||
font = QtGui.QFont()
|
||||
font.setBold(False)
|
||||
font.setWeight(50)
|
||||
self.cmbTranslation.setFont(font)
|
||||
self.cmbTranslation.setObjectName("cmbTranslation")
|
||||
self.verticalLayout_20.addWidget(self.cmbTranslation)
|
||||
self.verticalLayout_7.addWidget(self.groupBox_14)
|
||||
self.groupBox_10 = QtWidgets.QGroupBox(self.stackedWidgetPage1)
|
||||
font = QtGui.QFont()
|
||||
font.setBold(True)
|
||||
|
@ -1780,7 +1792,7 @@ class Ui_Settings(object):
|
|||
self.horizontalLayout_8.addWidget(self.stack)
|
||||
|
||||
self.retranslateUi(Settings)
|
||||
self.stack.setCurrentIndex(2)
|
||||
self.stack.setCurrentIndex(0)
|
||||
self.tabViews.setCurrentIndex(3)
|
||||
self.themeStack.setCurrentIndex(1)
|
||||
self.themeEditStack.setCurrentIndex(3)
|
||||
|
@ -1807,10 +1819,11 @@ class Ui_Settings(object):
|
|||
item.setText(_translate("Settings", "Fullscreen"))
|
||||
self.lstMenu.setSortingEnabled(__sortingEnabled)
|
||||
self.lblTitleGeneral.setText(_translate("Settings", "General settings"))
|
||||
self.groupBox_2.setTitle(_translate("Settings", "Application style"))
|
||||
self.label_2.setText(_translate("Settings", "You might need to restart manuskript in order to avoid some visual issues."))
|
||||
self.groupBox_14.setTitle(_translate("Settings", "Application language"))
|
||||
self.label_52.setText(_translate("Settings", "You will need to restart manuskript for the translation to take effect."))
|
||||
self.groupBox_2.setTitle(_translate("Settings", "Application settings"))
|
||||
self.label_56.setText(_translate("Settings", "Style:"))
|
||||
self.label_57.setText(_translate("Settings", "Language:"))
|
||||
self.label_58.setText(_translate("Settings", "Font size:"))
|
||||
self.label_2.setText(_translate("Settings", "You might need to restart manuskript in order for those settings to take effect properly and entirely."))
|
||||
self.groupBox_10.setTitle(_translate("Settings", "Loading"))
|
||||
self.chkAutoLoad.setText(_translate("Settings", "Automatically load last project on startup"))
|
||||
self.groupBox.setTitle(_translate("Settings", "Saving"))
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>658</width>
|
||||
<height>632</height>
|
||||
<height>598</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
|
@ -54,7 +54,7 @@
|
|||
<item>
|
||||
<widget class="QStackedWidget" name="stack">
|
||||
<property name="currentIndex">
|
||||
<number>2</number>
|
||||
<number>0</number>
|
||||
</property>
|
||||
<widget class="QWidget" name="stackedWidgetPage1">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_7">
|
||||
|
@ -95,11 +95,14 @@
|
|||
</font>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>Application style</string>
|
||||
<string>Application settings</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_5">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_2">
|
||||
<layout class="QFormLayout" name="formLayout_13">
|
||||
<property name="fieldGrowthPolicy">
|
||||
<enum>QFormLayout::FieldsStayAtSizeHint</enum>
|
||||
</property>
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="label_56">
|
||||
<property name="font">
|
||||
<font>
|
||||
<weight>50</weight>
|
||||
|
@ -107,14 +110,11 @@
|
|||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>You might need to restart manuskript in order to avoid some visual issues.</string>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>true</bool>
|
||||
<string>Style:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<item row="3" column="1">
|
||||
<widget class="QComboBox" name="cmbStyle">
|
||||
<property name="font">
|
||||
<font>
|
||||
|
@ -124,23 +124,8 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBox_14">
|
||||
<property name="font">
|
||||
<font>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>Application language</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_20">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_52">
|
||||
<item row="6" column="0">
|
||||
<widget class="QLabel" name="label_57">
|
||||
<property name="font">
|
||||
<font>
|
||||
<weight>50</weight>
|
||||
|
@ -148,14 +133,11 @@
|
|||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>You will need to restart manuskript for the translation to take effect.</string>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>true</bool>
|
||||
<string>Language:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<item row="6" column="1">
|
||||
<widget class="QComboBox" name="cmbTranslation">
|
||||
<property name="font">
|
||||
<font>
|
||||
|
@ -165,6 +147,45 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" column="0">
|
||||
<widget class="QLabel" name="label_58">
|
||||
<property name="font">
|
||||
<font>
|
||||
<weight>50</weight>
|
||||
<bold>false</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Font size:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" column="1">
|
||||
<widget class="QSpinBox" name="spnGeneralFontSize">
|
||||
<property name="font">
|
||||
<font>
|
||||
<weight>50</weight>
|
||||
<bold>false</bold>
|
||||
</font>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0" colspan="2">
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="font">
|
||||
<font>
|
||||
<weight>50</weight>
|
||||
<bold>false</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>You might need to restart manuskript in order for those settings to take effect properly and entirely.</string>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
|
|
Loading…
Reference in a new issue