-
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8ec929a
commit 088fa3b
Showing
28 changed files
with
831 additions
and
606 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
use iced::{widget::canvas, Point}; | ||
use shape::{Shape, ShapeColor, ShapeStroke, ShapeType}; | ||
use xcap::image::RgbaImage; | ||
|
||
pub mod shape; | ||
|
||
pub struct CaptureWindow { | ||
pub cursor_position: Point, | ||
pub image: RgbaImage, | ||
pub scale_factor: f32, | ||
pub mode: Mode, | ||
pub shape: Shape, | ||
pub endpoints: Endpoints, | ||
pub shapes: Vec<Shape>, | ||
pub cache: canvas::Cache, | ||
} | ||
|
||
#[derive(Debug, Clone)] | ||
pub enum CaptureEvent { | ||
Cancel, | ||
Done, | ||
ChooseShapeType(ShapeType, bool), | ||
ChangeStroke(ShapeStroke), | ||
ChangeColor(ShapeColor), | ||
SetInitialPoint, | ||
UpdateCurrentPosition(Point), | ||
SetFinalPoint, | ||
} | ||
|
||
#[derive(Debug, Default, Clone, Copy)] | ||
pub struct Endpoints { | ||
pub initial_pt: Option<Point>, | ||
pub final_pt: Option<Point>, | ||
} | ||
|
||
#[derive(Debug, Default, PartialEq)] | ||
pub enum Mode { | ||
Draw, | ||
#[default] | ||
Crop, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
use super::Endpoints; | ||
|
||
#[derive(Debug, Default, Clone, Copy)] | ||
pub struct Shape { | ||
pub shape_type: ShapeType, | ||
pub endpoints: Endpoints, | ||
pub color: ShapeColor, | ||
pub is_filled: bool, | ||
pub stroke_width: ShapeStroke, | ||
} | ||
|
||
#[derive(Debug, Default, Clone, Copy, PartialEq)] | ||
pub enum ShapeType { | ||
#[default] | ||
Rectangle, | ||
Ellipse, | ||
Line, | ||
} | ||
|
||
#[derive(Debug, Default, Clone, Copy, PartialEq)] | ||
pub enum ShapeColor { | ||
#[default] | ||
Red, | ||
Green, | ||
Blue, | ||
Yellow, | ||
Black, | ||
White, | ||
} | ||
|
||
#[derive(Debug, Default, Clone, Copy, PartialEq)] | ||
pub enum ShapeStroke { | ||
Thin, | ||
#[default] | ||
Medium, | ||
Broad, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
pub mod app; | ||
pub mod config; | ||
pub mod capture; | ||
pub mod config; | ||
pub mod style; | ||
pub mod theme; | ||
pub mod window; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,14 @@ | ||
use iced::Color; | ||
|
||
pub struct ContainerClass; | ||
|
||
pub enum ButtonClass { | ||
Default, | ||
Danger, | ||
Selected, | ||
} | ||
|
||
pub struct TextClass; | ||
|
||
pub struct SvgClass; | ||
pub enum TextClass { | ||
Default, | ||
Custom(Color), | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.