mirror of
https://github.com/noctalia-dev/noctalia-shell.git
synced 2026-05-11 17:08:27 +08:00
Settings/Fonts: Filter only once when all fonts are ready.
This commit is contained in:
@@ -86,28 +86,26 @@ ColumnLayout {
|
||||
label: I18n.tr("settings.general.fonts.default.label")
|
||||
description: I18n.tr("settings.general.fonts.default.description")
|
||||
model: FontService.availableFonts
|
||||
modelReady: FontService.fontsLoaded
|
||||
currentKey: Settings.data.ui.fontDefault
|
||||
placeholder: I18n.tr("settings.general.fonts.default.placeholder")
|
||||
searchPlaceholder: I18n.tr("settings.general.fonts.default.search-placeholder")
|
||||
popupHeight: 420
|
||||
minimumWidth: 300
|
||||
onSelected: function (key) {
|
||||
Settings.data.ui.fontDefault = key;
|
||||
}
|
||||
onSelected: key => Settings.data.ui.fontDefault = key
|
||||
}
|
||||
|
||||
NSearchableComboBox {
|
||||
label: I18n.tr("settings.general.fonts.monospace.label")
|
||||
description: I18n.tr("settings.general.fonts.monospace.description")
|
||||
model: FontService.monospaceFonts
|
||||
modelReady: FontService.fontsLoaded
|
||||
currentKey: Settings.data.ui.fontFixed
|
||||
placeholder: I18n.tr("settings.general.fonts.monospace.placeholder")
|
||||
searchPlaceholder: I18n.tr("settings.general.fonts.monospace.search-placeholder")
|
||||
popupHeight: 320
|
||||
minimumWidth: 300
|
||||
onSelected: function (key) {
|
||||
Settings.data.ui.fontFixed = key;
|
||||
}
|
||||
onSelected: key => Settings.data.ui.fontFixed = key
|
||||
}
|
||||
|
||||
ColumnLayout {
|
||||
|
||||
@@ -18,6 +18,7 @@ RowLayout {
|
||||
property string placeholder: ""
|
||||
property string searchPlaceholder: I18n.tr("placeholders.search")
|
||||
property Component delegate: null
|
||||
property bool modelReady: true
|
||||
|
||||
readonly property real preferredHeight: Style.baseWidgetSize * 1.1
|
||||
|
||||
@@ -95,6 +96,11 @@ RowLayout {
|
||||
|
||||
onSearchTextChanged: filterModel()
|
||||
onModelChanged: filterModel()
|
||||
onModelReadyChanged: {
|
||||
if (modelReady) {
|
||||
filterModel();
|
||||
}
|
||||
}
|
||||
Component.onCompleted: filterModel()
|
||||
|
||||
// Watch for model content changes (e.g., async font loading)
|
||||
|
||||
Reference in New Issue
Block a user