Improve how tool buttons are generated

This commit is contained in:
Veronica Berglyd Olsen
2024-04-01 20:21:34 +02:00
parent c3467d89c2
commit 24e45fb661
36 changed files with 278 additions and 285 deletions
+5 -5
View File
@@ -36,8 +36,9 @@ from PyQt5.QtWidgets import (
)
from novelwriter import CONFIG, SHARED
from novelwriter.error import formatException
from novelwriter.common import formatFileFilter, openExternalPath, formatInt, getFileSize
from novelwriter.error import formatException
from novelwriter.extensions.modified import NIconToolButton
logger = logging.getLogger(__name__)
@@ -54,6 +55,7 @@ class GuiDictionaries(QDialog):
self._installPath = None
self._currDicts = set()
iSz = SHARED.theme.baseIconSize
iPx = CONFIG.pxInt(4)
mPx = CONFIG.pxInt(8)
sPx = CONFIG.pxInt(16)
@@ -72,8 +74,7 @@ class GuiDictionaries(QDialog):
self.huInfo.setOpenExternalLinks(True)
self.huInfo.setWordWrap(True)
self.huInput = QLineEdit(self)
self.huBrowse = QPushButton(self)
self.huBrowse.setIcon(SHARED.theme.getIcon("browse"))
self.huBrowse = NIconToolButton(self, iSz, "browse")
self.huBrowse.clicked.connect(self._doBrowseHunspell)
self.huImport = QPushButton(self.tr("Add Dictionary"), self)
self.huImport.setIcon(SHARED.theme.getIcon("add"))
@@ -91,8 +92,7 @@ class GuiDictionaries(QDialog):
self.inInfo = QLabel(self.tr("Dictionary install location"))
self.inPath = QLineEdit(self)
self.inPath.setReadOnly(True)
self.inBrowse = QPushButton(self)
self.inBrowse.setIcon(SHARED.theme.getIcon("browse"))
self.inBrowse = NIconToolButton(self, iSz, "browse")
self.inBrowse.clicked.connect(self._doOpenInstallLocation)
self.inBox = QHBoxLayout()