Flip the boolean for scrollable combo boxes

This commit is contained in:
Veronica Berglyd Olsen
2025-10-26 02:07:55 +01:00
parent 8b02c95f51
commit e0bd7d82fb
3 changed files with 9 additions and 9 deletions
+5 -5
View File
@@ -158,7 +158,7 @@ class GuiPreferences(NDialog):
self.mainForm.addGroupLabel(title, section)
# Display Language
self.guiLocale = NComboBox(self, scrollable=False)
self.guiLocale = NComboBox(self, scrollable=True)
self.guiLocale.setMinimumWidth(200)
for lang, name in CONFIG.listLanguages(CONFIG.LANG_NW):
self.guiLocale.addItem(name, lang)
@@ -170,9 +170,9 @@ class GuiPreferences(NDialog):
)
# Colour Theme
self.lightTheme = NComboBox(self, scrollable=False)
self.lightTheme = NComboBox(self, scrollable=True)
self.lightTheme.setMinimumWidth(200)
self.darkTheme = NComboBox(self, scrollable=False)
self.darkTheme = NComboBox(self, scrollable=True)
self.darkTheme.setMinimumWidth(200)
for key, theme in SHARED.theme.colourThemes.items():
if theme.dark:
@@ -193,7 +193,7 @@ class GuiPreferences(NDialog):
)
# Icon Theme
self.iconTheme = NComboBox(self, scrollable=False)
self.iconTheme = NComboBox(self, scrollable=True)
self.iconTheme.setMinimumWidth(200)
for key, theme in SHARED.theme.iconCache.iconThemes.items():
self.iconTheme.addItem(theme.name, key)
@@ -511,7 +511,7 @@ class GuiPreferences(NDialog):
self.mainForm.addGroupLabel(title, section)
# Spell Checking
self.spellLanguage = NComboBox(self, scrollable=False)
self.spellLanguage = NComboBox(self, scrollable=True)
self.spellLanguage.setMinimumWidth(200)
if CONFIG.hasEnchant:
+2 -2
View File
@@ -257,7 +257,7 @@ class _SettingsPage(NScrollableForm):
# Project Language
projLang = data.language or CONFIG.guiLocale
self.projLang = NComboBox(self, scrollable=False)
self.projLang = NComboBox(self, scrollable=True)
self.projLang.setMinimumWidth(200)
for tag, language in CONFIG.listLanguages(CONFIG.LANG_PROJ):
self.projLang.addItem(language, tag)
@@ -269,7 +269,7 @@ class _SettingsPage(NScrollableForm):
)
# Spell Check Language
self.spellLang = NComboBox(self, scrollable=False)
self.spellLang = NComboBox(self, scrollable=True)
self.spellLang.setMinimumWidth(200)
self.spellLang.addItem(self.tr("Default"), "None")
if CONFIG.hasEnchant:
+2 -2
View File
@@ -126,12 +126,12 @@ class NComboBox(QComboBox):
"""
def __init__(
self, parent: QWidget | None = None, maxItems: int = 15, scrollable: bool = True
self, parent: QWidget | None = None, maxItems: int = 15, scrollable: bool = False
) -> None:
super().__init__(parent=parent)
self.setFocusPolicy(Qt.FocusPolicy.StrongFocus)
self.setMaxVisibleItems(maxItems)
if not scrollable:
if scrollable:
# The style sheet disables Fusion style pop-up mode on some
# platforms and allows for scrolling of long lists of items
self.setStyleSheet("QComboBox {combobox-popup: 0;}")