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
13 changes: 11 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ Default single-key shortcuts:
- <kbd>t</kbd>: Text tool
- <kbd>m</kbd>: Numbered Marker tool
- <kbd>u</kbd>: Blur tool
- <kbd>x</kbd>: Pixelate tool
- <kbd>g</kbd>: Highlight tool

### Tool Modifiers and Keys
Expand All @@ -79,6 +80,7 @@ Default single-key shortcuts:
- Highlight: Hold <kbd>Ctrl</kbd> to switch between block and freehand mode (default configurable, see below), hold <kbd>Shift</kbd> for a square (if the default mode is block) or a straight line (if the default mode is freehand)
- Line: Hold <kbd>Shift</kbd> to make line snap to 15° steps
- Rectangle: Hold <kbd>Alt</kbd> to center the rectangle around origin, hold <kbd>Shift</kbd> for a square
- Pixelate: Hold <kbd>Alt</kbd> to use pixelation that takes data from outside the selection as a source. <sup>NEXTRELEASE</sup>
- Text:
- Press <kbd>Shift+Enter</kbd> to insert line break.
- Combine <kbd>Ctrl</kbd> with <kbd>Left</kbd> or <kbd>Right</kbd> for word jump or <kbd>Ctrl</kbd> with <kbd>Backspace</kbd> or <kbd>Delete</kbd> for word delete.
Expand Down Expand Up @@ -120,7 +122,7 @@ early-exit = true
early-exit-save-as = true
# Draw corners of rectangles round if the value is greater than 0 (0 disables rounded corners)
corner-roundness = 12
# Select the tool on startup [possible values: pointer, crop, line, arrow, rectangle, text, marker, blur, brush]
# Select the tool on startup [possible values: pointer, crop, line, arrow, rectangle, text, marker, blur, pixelate, brush]
initial-tool = "brush"
# Configure the command to be called on copy, for example `wl-copy`
copy-command = "wl-copy"
Expand Down Expand Up @@ -189,6 +191,8 @@ ellipse = "e"
text = "t"
marker = "m"
blur = "u"
# NEXTRELEASE
pixelate = "x"
highlight = "g"

# Font to use for text annotations
Expand Down Expand Up @@ -266,7 +270,7 @@ Options:
--corner-roundness <CORNER_ROUNDNESS>
Draw corners of rectangles round if the value is greater than 0 (Defaults to 12) (0 disables rounded corners)
--initial-tool <TOOL>
Select the tool on startup [aliases: --init-tool] [possible values: pointer, crop, line, arrow, rectangle, ellipse, text, marker, blur, highlight, brush]
Select the tool on startup [aliases: --init-tool] [possible values: pointer, crop, line, arrow, rectangle, ellipse, text, marker, blur, pixelate, highlight, brush]
--copy-command <COPY_COMMAND>
Configure the command to be called on copy, for example `wl-copy`
--annotation-size-factor <ANNOTATION_SIZE_FACTOR>
Expand Down Expand Up @@ -444,3 +448,8 @@ Made with [contrib.rocks](https://contrib.rocks).
The source code is released under the MPL-2.0 license.

The Font 'Roboto Regular' from Google is released under Apache-2.0 license.

## Credits

- Pixelate "independent mode" was inspired by https://github.com/flameshot-org/flameshot/pull/3765/changes

1 change: 1 addition & 0 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ fn main() -> Result<(), io::Error> {
"paint-bucket-regular",
"page-fit-regular",
"resize-large-regular",
"tetris-app-regular",
],
);

Expand Down
2 changes: 2 additions & 0 deletions cli/src/command_line.rs
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,7 @@ pub enum Tools {
Text,
Marker,
Blur,
Pixelate,
Highlight,
Brush,
}
Expand Down Expand Up @@ -254,6 +255,7 @@ impl std::fmt::Display for Tools {
Text => "text",
Marker => "marker",
Blur => "blur",
Pixelate => "pixelate",
Highlight => "highlight",
Brush => "brush",
};
Expand Down
3 changes: 3 additions & 0 deletions src/configuration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ impl Keybinds {
self.update_keybind(file_keybinds.text, Tools::Text);
self.update_keybind(file_keybinds.marker, Tools::Marker);
self.update_keybind(file_keybinds.blur, Tools::Blur);
self.update_keybind(file_keybinds.pixelate, Tools::Pixelate);
self.update_keybind(file_keybinds.highlight, Tools::Highlight);
}
}
Expand All @@ -141,6 +142,7 @@ impl Default for Keybinds {
shortcuts.insert('t', Tools::Text);
shortcuts.insert('m', Tools::Marker);
shortcuts.insert('u', Tools::Blur);
shortcuts.insert('x', Tools::Pixelate);
shortcuts.insert('g', Tools::Highlight);

Self { shortcuts }
Expand Down Expand Up @@ -735,6 +737,7 @@ struct KeybindsFile {
text: Option<String>,
marker: Option<String>,
blur: Option<String>,
pixelate: Option<String>,
highlight: Option<String>,
}

Expand Down
11 changes: 11 additions & 0 deletions src/tools/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ mod ellipse;
mod highlight;
mod line;
mod marker;
mod pixelate;
mod pointer;
mod rectangle;
mod text;
Expand Down Expand Up @@ -167,6 +168,7 @@ pub use crop::CropTool;
pub use ellipse::EllipseTool;
pub use highlight::{HighlightTool, Highlighters};
pub use line::LineTool;
pub use pixelate::PixelateTool;
pub use rectangle::RectangleTool;
pub use text::TextTool;

Expand All @@ -186,6 +188,7 @@ pub enum Tools {
Blur = 8,
Highlight = 9,
Brush = 10,
Pixelate = 11,
}

impl Tools {
Expand All @@ -202,6 +205,7 @@ impl Tools {
Tools::Marker => "Numbered Marker",
Tools::Blur => "Blur",
Tools::Highlight => "Highlight",
Tools::Pixelate => "Pixelate",
}
}
}
Expand All @@ -221,6 +225,7 @@ impl Display for Tools {
Self::Blur => write!(f, "blur"),
Self::Highlight => write!(f, "highlight"),
Self::Brush => write!(f, "brush"),
Self::Pixelate => write!(f, "pixelate"),
}
}
}
Expand Down Expand Up @@ -250,6 +255,10 @@ impl ToolsManager {
);
tools.insert(Tools::Text, Rc::new(RefCell::new(TextTool::default())));
tools.insert(Tools::Blur, Rc::new(RefCell::new(BlurTool::default())));
tools.insert(
Tools::Pixelate,
Rc::new(RefCell::new(PixelateTool::default())),
);
tools.insert(
Tools::Highlight,
Rc::new(RefCell::new(HighlightTool::default())),
Expand Down Expand Up @@ -305,6 +314,7 @@ impl FromVariant for Tools {
8 => Some(Tools::Blur),
9 => Some(Tools::Highlight),
10 => Some(Tools::Brush),
11 => Some(Tools::Pixelate),
_ => None,
})
}
Expand All @@ -322,6 +332,7 @@ impl From<command_line::Tools> for Tools {
command_line::Tools::Text => Self::Text,
command_line::Tools::Marker => Self::Marker,
command_line::Tools::Blur => Self::Blur,
command_line::Tools::Pixelate => Self::Pixelate,
command_line::Tools::Highlight => Self::Highlight,
command_line::Tools::Brush => Self::Brush,
}
Expand Down
Loading
Loading