Sort themes by light/dark first and then alphabetically
This commit is contained in:
parent
d8eb749640
commit
bf27edfdee
1 changed files with 6 additions and 1 deletions
|
@ -36,7 +36,12 @@ impl ThemeSelector {
|
||||||
let handle = cx.weak_handle();
|
let handle = cx.weak_handle();
|
||||||
let picker = cx.add_view(|cx| Picker::new(handle, cx));
|
let picker = cx.add_view(|cx| Picker::new(handle, cx));
|
||||||
let original_theme = cx.global::<Settings>().theme.clone();
|
let original_theme = cx.global::<Settings>().theme.clone();
|
||||||
let theme_names = registry.list().collect::<Vec<_>>();
|
let mut theme_names = registry.list().collect::<Vec<_>>();
|
||||||
|
theme_names.sort_unstable_by(|a, b| {
|
||||||
|
a.ends_with("dark")
|
||||||
|
.cmp(&b.ends_with("dark"))
|
||||||
|
.then_with(|| a.cmp(&b))
|
||||||
|
});
|
||||||
let matches = theme_names
|
let matches = theme_names
|
||||||
.iter()
|
.iter()
|
||||||
.map(|name| StringMatch {
|
.map(|name| StringMatch {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue