Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,11 @@ fullscreen = true
resize = { mode = "size", width=2000, height=800 }
# try to have the window float (0.20.1). This may depend on the compositor.
floating-hack = true
# Exit directly after copy/save action. 0.20.1: Does not apply to save as
# Exit directly after copy/save action. 0.20.1: Does not apply to save as, NEXTRELEASE: Does not apply to copy
early-exit = true
# Exit directly after save as (0.20.1)
# Exit directly after copy action. (Experimental, NEXTRELEASE)
early-exit-copy = true
# Exit directly after save as (Experimental, 0.20.1)
early-exit-save-as = true
# Draw corners of rectangles round if the value is greater than 0 (0 disables rounded corners)
corner-roundness = 12
Expand Down Expand Up @@ -240,7 +242,9 @@ Options:
-o, --output-filename <OUTPUT_FILENAME>
Filename to use for saving action or '-' to print to stdout. Omit to disable saving to file. Might contain format specifiers: <https://docs.rs/chrono/latest/chrono/format/strftime/index.html>. Since 0.20.0, can contain tilde (~) for home dir
--early-exit
Exit directly after copy/save action. 0.20.1: This does not apply to "save as"
Exit directly after save action. 0.20.1: This does not apply to "save as", NEXTRELEASE: does not apply to "copy"
--early-exit-copy
Experimental (NEXTRELEASE): Exit directly after copy action
--early-exit-save-as
Experimental (0.20.1): Exit directly after save as
--corner-roundness <CORNER_ROUNDNESS>
Expand Down
7 changes: 6 additions & 1 deletion cli/src/command_line.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,15 @@ pub struct CommandLine {
#[arg(short, long)]
pub output_filename: Option<String>,

/// Exit directly after copy/save action. 0.20.1: This does not apply to "save as".
/// Exit directly after save action. 0.20.1: This does not apply to "save as", NEXTRELEASE:
/// does not apply to "copy"
#[arg(long)]
pub early_exit: bool,

/// Experimental (NEXTRELEASE): Exit directly after copy action.
#[arg(long)]
pub early_exit_copy: bool,

/// Experimental (0.20.1): Exit directly after save as
#[arg(long)]
pub early_exit_save_as: bool,
Expand Down
13 changes: 13 additions & 0 deletions src/configuration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ pub struct Configuration {
resize: Option<Resize>,
floating_hack: bool,
early_exit: bool,
early_exit_copy: bool,
early_exit_save_as: bool,
corner_roundness: f32,
initial_tool: Tools,
Expand Down Expand Up @@ -280,6 +281,9 @@ impl Configuration {
if let Some(v) = general.early_exit {
self.early_exit = v;
}
if let Some(v) = general.early_exit_copy {
self.early_exit_copy = v;
}
if let Some(v) = general.early_exit_save_as {
self.early_exit_save_as = v;
}
Expand Down Expand Up @@ -392,6 +396,9 @@ impl Configuration {
if command_line.early_exit {
self.early_exit = command_line.early_exit;
}
if command_line.early_exit_copy {
self.early_exit_copy = command_line.early_exit_copy;
}
if command_line.early_exit_save_as {
self.early_exit_save_as = command_line.early_exit_save_as;
}
Expand Down Expand Up @@ -484,6 +491,10 @@ impl Configuration {
self.early_exit
}

pub fn early_exit_copy(&self) -> bool {
self.early_exit_copy
}

pub fn early_exit_save_as(&self) -> bool {
self.early_exit_save_as
}
Expand Down Expand Up @@ -609,6 +620,7 @@ impl Default for Configuration {
resize: None,
floating_hack: false,
early_exit: false,
early_exit_copy: false,
early_exit_save_as: false,
corner_roundness: 12.0,
initial_tool: Tools::Pointer,
Expand Down Expand Up @@ -693,6 +705,7 @@ struct ConfigurationFileGeneral {
resize: Option<Resize>,
floating_hack: Option<bool>,
early_exit: Option<bool>,
early_exit_copy: Option<bool>,
early_exit_save_as: Option<bool>,
corner_roundness: Option<f32>,
initial_tool: Option<Tools>,
Expand Down
2 changes: 1 addition & 1 deletion src/sketch_board.rs
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ impl SketchBoard {
Action::SaveToClipboard => {
if let Some(ref pix_buf) = pix_buf {
self.handle_copy_clipboard(pix_buf);
early_exit = APP_CONFIG.read().early_exit();
early_exit = APP_CONFIG.read().early_exit_copy();
}
}
Action::SaveToFile => {
Expand Down