Skip to content

Commit

Permalink
Merge pull request #703 from squidowl/default-custom-theme-name
Browse files Browse the repository at this point in the history
Append file-name when saving theme on macos
  • Loading branch information
casperstorm authored Jan 13, 2025
2 parents fcd98f2 + 39ed9a8 commit 64a1402
Show file tree
Hide file tree
Showing 4 changed files with 144 additions and 41 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ Fixed:
- Long username & password combinations could cause SASL authentication to fail
- `nick_password_command` is now working as intended
- Don't add suffix (`: `) to prompt if there is no valid nick to autocomplete
- Append .toml filename when saving themes on macOS

Changed:
- Changed focus buffer shortcuts to include `Ctrl` (`` on macOS) to avoid interfering with default text input shortcuts for word navigation (`⌥ + ←`, `⌥ + →`)
Expand Down
168 changes: 139 additions & 29 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ version = "1.0"
features = ["v4"]

[dependencies.rfd]
version = "0.14.1"
version = "0.15.2"
default-features = false
features = ["xdg-portal", "tokio"]

Expand Down
14 changes: 3 additions & 11 deletions src/screen/dashboard/theme_editor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,17 +115,9 @@ impl ThemeEditor {
}
Message::Save => {
let task = async move {
// TODO: rfd `set_directory` can't be used in combination with `set_file_name` on macOS.
// https://github.com/PolyMeilex/rfd/issues/214

let mut dialog =
rfd::AsyncFileDialog::new().set_directory(Config::themes_dir());

if !cfg!(target_os = "macos") {
dialog = dialog.set_file_name("custom-theme.toml");
}

dialog
rfd::AsyncFileDialog::new()
.set_directory(Config::themes_dir())
.set_file_name("custom-theme.toml")
.save_file()
.await
.map(|handle| handle.path().to_path_buf())
Expand Down

0 comments on commit 64a1402

Please sign in to comment.