Skip to content

Commit

Permalink
Hack to enable Cmd+X/C/V on macOS
Browse files Browse the repository at this point in the history
  • Loading branch information
nazar-pc committed Jul 12, 2024
1 parent bdb4098 commit fa477a9
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -979,6 +979,15 @@ impl Cli {
app.set_global_css(GLOBAL_CSS);
relm4_icons::initialize_icons();

// TODO: Remove this hack once GTK is upgraded to 4.16.0+, see https://github.com/subspace/space-acres/issues/145#issuecomment-2206615439
#[cfg(target_os = "macos")]
{
let app = relm4::main_application();
app.set_accels_for_action("clipboard.cut", &["<Meta>x"]);
app.set_accels_for_action("clipboard.copy", &["<Meta>c"]);
app.set_accels_for_action("clipboard.paste", &["<Meta>v"]);
}

// Prefer dark theme in cross-platform way if environment is configured that way
if let Some(settings) = gtk::Settings::default() {
if matches!(dark_light::detect(), dark_light::Mode::Dark) {
Expand Down

0 comments on commit fa477a9

Please sign in to comment.