Skip to content

Commit

Permalink
feat: add cli option for opening with picker
Browse files Browse the repository at this point in the history
Temporary workaround for #19
  • Loading branch information
FineFindus committed Sep 18, 2023
1 parent 7883864 commit 6a0ae6e
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/application.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,14 @@ mod imp {
app.main_window().present();
}

fn command_line(&self, command_line: &gio::ApplicationCommandLine) -> ExitCode {
self.activate();
if command_line.arguments().contains(&"--pick-color".into()) {
self.window.get().unwrap().upgrade().unwrap().pick_color();
}
glib::ExitCode::SUCCESS
}

fn startup(&self) {
debug!("GtkApplication<App>::startup");
self.parent_startup();
Expand Down Expand Up @@ -107,7 +115,7 @@ impl App {
pub fn new() -> Self {
glib::Object::builder::<Self>()
.property("application-id", Some(APP_ID))
.property("flags", gio::ApplicationFlags::empty())
.property("flags", gio::ApplicationFlags::HANDLES_COMMAND_LINE)
.property(
"resource-base-path",
Some("/com/github/finefindus/eyedropper/"),
Expand Down

0 comments on commit 6a0ae6e

Please sign in to comment.