Add icons to preferences buttons

This commit is contained in:
Veronica Berglyd Olsen
2024-01-11 09:17:46 +01:00
parent 944e2455d5
commit 4afbd98d6f
7 changed files with 32 additions and 20 deletions
@@ -61,6 +61,7 @@ forward = typ_chevron-right.svg
maximise = typ_arrow-maximise.svg
menu = typ_th-dot-menu.svg
minimise = typ_arrow-minimise.svg
more = typ_th-dot-more.svg
noncheckable = mixed_input-none.svg
panel = nw_panel.svg
proj_chapter = mixed_document-chapter.svg
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="24" height="24" version="1.2" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
<path d="M 22,12 A 2.6315,2.6315 0 0 0 19.3686,9.3686 2.6315,2.6315 0 0 0 16.7372,12 2.6315,2.6315 0 0 0 19.3686,14.6314 2.6315,2.6315 0 0 0 22,12 Z m -7.3686,0 A 2.6315,2.6315 0 0 0 12,9.3686 2.6315,2.6315 0 0 0 9.3686,12 2.6315,2.6315 0 0 0 12,14.6314 2.6315,2.6315 0 0 0 14.6314,12 Z M 7.2628,12 A 2.6315,2.6315 0 0 0 4.6314,9.3686 2.6315,2.6315 0 0 0 2,12 2.6315,2.6315 0 0 0 4.6314,14.6314 2.6315,2.6315 0 0 0 7.2628,12 Z" fill="#aeaeae" stroke-width=".90909"/>
</svg>

After

Width:  |  Height:  |  Size: 612 B

@@ -61,6 +61,7 @@ forward = typ_chevron-right.svg
maximise = typ_arrow-maximise.svg
menu = typ_th-dot-menu.svg
minimise = typ_arrow-minimise.svg
more = typ_th-dot-more.svg
noncheckable = mixed_input-none.svg
panel = nw_panel.svg
proj_chapter = mixed_document-chapter.svg
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="24" height="24" version="1.2" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
<path d="M 22,12 A 2.6315,2.6315 0 0 0 19.3686,9.3686 2.6315,2.6315 0 0 0 16.7372,12 2.6315,2.6315 0 0 0 19.3686,14.6314 2.6315,2.6315 0 0 0 22,12 Z m -7.3686,0 A 2.6315,2.6315 0 0 0 12,9.3686 2.6315,2.6315 0 0 0 9.3686,12 2.6315,2.6315 0 0 0 12,14.6314 2.6315,2.6315 0 0 0 14.6314,12 Z M 7.2628,12 A 2.6315,2.6315 0 0 0 4.6314,9.3686 2.6315,2.6315 0 0 0 2,12 2.6315,2.6315 0 0 0 4.6314,14.6314 2.6315,2.6315 0 0 0 7.2628,12 Z" fill-opacity=".78039" stroke-width=".90909"/>
</svg>

After

Width:  |  Height:  |  Size: 619 B

+16 -16
View File
@@ -31,7 +31,7 @@ from PyQt5.QtCore import Qt, pyqtSignal, pyqtSlot
from PyQt5.QtWidgets import (
QAbstractButton, QComboBox, QCompleter, QDialog, QDialogButtonBox,
QDoubleSpinBox, QFileDialog, QFontDialog, QHBoxLayout, QLabel, QLineEdit,
QPushButton, QSpinBox, QVBoxLayout, QWidget, qApp
QPushButton, QSpinBox, QToolButton, QVBoxLayout, QWidget, qApp
)
from novelwriter import CONFIG, SHARED
@@ -54,7 +54,7 @@ class GuiPreferences(QDialog):
logger.debug("Create: GuiPreferences")
self.setObjectName("GuiPreferences")
self.setWindowTitle(CONFIG.appName)
self.setWindowTitle(self.tr("Preferences"))
self.setMinimumSize(CONFIG.pxInt(600), CONFIG.pxInt(500))
self.resize(*CONFIG.preferencesWinSize)
@@ -139,6 +139,7 @@ class GuiPreferences(QDialog):
"""Build the settings form."""
section = 0
minWidth = CONFIG.pxInt(200)
mIcon = SHARED.theme.getIcon("more")
# Appearance
# ==========
@@ -181,8 +182,8 @@ class GuiPreferences(QDialog):
self.guiFont.setReadOnly(True)
self.guiFont.setFixedWidth(CONFIG.pxInt(162))
self.guiFont.setText(CONFIG.guiFont)
self.guiFontButton = QPushButton("...", self)
self.guiFontButton.setMaximumWidth(int(2.5*SHARED.theme.getTextWidth("...")))
self.guiFontButton = QToolButton(self)
self.guiFontButton.setIcon(mIcon)
self.guiFontButton.clicked.connect(self._selectGuiFont)
self.mainForm.addRow(
self.tr("Application font family"),
@@ -249,8 +250,8 @@ class GuiPreferences(QDialog):
self.textFont.setReadOnly(True)
self.textFont.setFixedWidth(CONFIG.pxInt(162))
self.textFont.setText(CONFIG.textFont)
self.textFontButton = QPushButton("...", self)
self.textFontButton.setMaximumWidth(int(2.5*SHARED.theme.getTextWidth("...")))
self.textFontButton = QToolButton(self)
self.textFontButton.setIcon(mIcon)
self.textFontButton.clicked.connect(self._selectTextFont)
self.mainForm.addRow(
self.tr("Document font family"),
@@ -722,9 +723,8 @@ class GuiPreferences(QDialog):
self.sidebar.addButton(title, section)
self.mainForm.addGroupLabel(title, section)
qWidth = CONFIG.pxInt(40)
bWidth = int(2.5*SHARED.theme.getTextWidth("..."))
self.quoteSym = {}
qWidth = CONFIG.pxInt(40)
# Single Quote Style
self.quoteSym["SO"] = QLineEdit(self)
@@ -733,8 +733,8 @@ class GuiPreferences(QDialog):
self.quoteSym["SO"].setFixedWidth(qWidth)
self.quoteSym["SO"].setAlignment(Qt.AlignCenter)
self.quoteSym["SO"].setText(CONFIG.fmtSQuoteOpen)
self.btnSingleStyleO = QPushButton("...", self)
self.btnSingleStyleO.setMaximumWidth(bWidth)
self.btnSingleStyleO = QToolButton(self)
self.btnSingleStyleO.setIcon(mIcon)
self.btnSingleStyleO.clicked.connect(lambda: self._getQuote("SO"))
self.mainForm.addRow(
self.tr("Single quote open style"),
@@ -749,8 +749,8 @@ class GuiPreferences(QDialog):
self.quoteSym["SC"].setFixedWidth(qWidth)
self.quoteSym["SC"].setAlignment(Qt.AlignCenter)
self.quoteSym["SC"].setText(CONFIG.fmtSQuoteClose)
self.btnSingleStyleC = QPushButton("...", self)
self.btnSingleStyleC.setMaximumWidth(bWidth)
self.btnSingleStyleC = QToolButton(self)
self.btnSingleStyleC.setIcon(mIcon)
self.btnSingleStyleC.clicked.connect(lambda: self._getQuote("SC"))
self.mainForm.addRow(
self.tr("Single quote close style"),
@@ -766,8 +766,8 @@ class GuiPreferences(QDialog):
self.quoteSym["DO"].setFixedWidth(qWidth)
self.quoteSym["DO"].setAlignment(Qt.AlignCenter)
self.quoteSym["DO"].setText(CONFIG.fmtDQuoteOpen)
self.btnDoubleStyleO = QPushButton("...", self)
self.btnDoubleStyleO.setMaximumWidth(bWidth)
self.btnDoubleStyleO = QToolButton(self)
self.btnDoubleStyleO.setIcon(mIcon)
self.btnDoubleStyleO.clicked.connect(lambda: self._getQuote("DO"))
self.mainForm.addRow(
self.tr("Double quote open style"),
@@ -782,8 +782,8 @@ class GuiPreferences(QDialog):
self.quoteSym["DC"].setFixedWidth(qWidth)
self.quoteSym["DC"].setAlignment(Qt.AlignCenter)
self.quoteSym["DC"].setText(CONFIG.fmtDQuoteClose)
self.btnDoubleStyleC = QPushButton("...", self)
self.btnDoubleStyleC.setMaximumWidth(bWidth)
self.btnDoubleStyleC = QToolButton(self)
self.btnDoubleStyleC.setIcon(mIcon)
self.btnDoubleStyleC.clicked.connect(lambda: self._getQuote("DC"))
self.mainForm.addRow(
self.tr("Double quote close style"),
+5 -3
View File
@@ -122,15 +122,16 @@ class NScrollableForm(QScrollArea):
button: QWidget | None = None, editable: str | None = None) -> None:
"""Add a label and a widget as a new row of the form."""
row = QHBoxLayout()
row.setSpacing(CONFIG.pxInt(4))
wSp = CONFIG.pxInt(12)
mPx = CONFIG.pxInt(12)
qLabel = QLabel(label, self)
qLabel.setIndent(wSp)
qLabel.setIndent(mPx)
qLabel.setBuddy(widget)
if helpText:
qHelp = NHelpLabel(str(helpText), self._helpCol, self._fontScale)
qHelp.setIndent(wSp)
qHelp.setIndent(mPx)
labelBox = QVBoxLayout()
labelBox.addWidget(qLabel)
labelBox.addWidget(qHelp)
@@ -142,6 +143,7 @@ class NScrollableForm(QScrollArea):
else:
row.addWidget(qLabel)
row.addSpacing(mPx)
row.addWidget(widget)
if isinstance(unit, str):
+1 -1
View File
@@ -466,7 +466,7 @@ class GuiIcons:
# General Button Icons
"add", "add_document", "backward", "bookmark", "browse", "checked", "close", "cross",
"document", "down", "edit", "export", "forward", "maximise", "menu", "minimise",
"document", "down", "edit", "export", "forward", "maximise", "menu", "minimise", "more",
"noncheckable", "panel", "refresh", "remove", "revert", "search_replace", "search",
"settings", "star", "unchecked", "up", "view",