more font_size to a new config file for session data
We need config and session data. config is what the user changes. Only read by the app. session is what the app remembers. Read and written by the app.
This commit is contained in:
@@ -138,9 +138,9 @@ class InnerBigText(QWidget):
|
||||
direction = 1 if event.angleDelta().y() < 0 else -1
|
||||
if event.modifiers() == Qt.KeyboardModifier.ControlModifier:
|
||||
# self.model.settings.update_font_size(-direction)
|
||||
old_font_size = self.model.settings.getint('general', 'font_size')
|
||||
new_font_size = old_font_size - direction
|
||||
self.model.settings.set('general', 'font_size', str(new_font_size))
|
||||
old_font_size = self.model.settings.getint_session('general', 'font_size')
|
||||
new_font_size = max(4, min(50, old_font_size - direction))
|
||||
self.model.settings.set_session('general', 'font_size', str(new_font_size))
|
||||
RavenUI.update_ui()
|
||||
self.update()
|
||||
else:
|
||||
@@ -235,7 +235,7 @@ class InnerBigText(QWidget):
|
||||
# print("paintEvent")
|
||||
painter = QPainter(self)
|
||||
# painter.setFont(self.model.settings.font())
|
||||
painter.setFont(QFont("monospace", self.model.settings.getint('general', "font_size")))
|
||||
painter.setFont(QFont("monospace", self.model.settings.getint_session('general', "font_size")))
|
||||
painter.setPen(QColor(0, 0, 0))
|
||||
self.update_font_metrics(painter)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user