Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
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
14 changes: 14 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ use std::{io, time::Duration};
use gdk_pixbuf::{Pixbuf, PixbufLoader};
use gtk::prelude::*;
use relm4::gtk::gdk::Rectangle;
use relm4::RelmWidgetExt;
use relm4::{
actions::{ActionablePlus, RelmAction, RelmActionGroup},
gtk::{self, gdk::DisplayManager, Align, CssProvider, Inhibit, Window},
Expand Down Expand Up @@ -192,13 +193,15 @@ impl Component for App {
set_hexpand: false,

set_icon_name: "arrow-undo-filled",
set_tooltip: "Undo",
connect_clicked[sketch_board_sender] => move |_| {sketch_board_sender.emit(SketchBoardMessage::Undo);},
},
gtk::Button {
set_focusable: false,
set_hexpand: false,

set_icon_name: "arrow-redo-filled",
set_tooltip: "Redo",
connect_clicked[sketch_board_sender] => move |_| {sketch_board_sender.emit(SketchBoardMessage::Redo);},
},
gtk::Separator {},
Expand All @@ -207,34 +210,39 @@ impl Component for App {
set_hexpand: false,

set_icon_name: "crop-filled",
set_tooltip: "Crop",
ActionablePlus::set_action::<ToolsAction>: Tools::Crop,
},
gtk::ToggleButton {
set_focusable: false,
set_hexpand: false,

set_icon_name: "minus-large",
set_tooltip: "Line tool",
ActionablePlus::set_action::<ToolsAction>: Tools::Line,
},
gtk::ToggleButton {
set_focusable: false,
set_hexpand: false,

set_icon_name: "arrow-up-right-filled",
set_tooltip: "Arrow tool",
ActionablePlus::set_action::<ToolsAction>: Tools::Arrow,
},
gtk::ToggleButton {
set_focusable: false,
set_hexpand: false,

set_icon_name: "checkbox-unchecked-regular",
set_tooltip: "Rectangle tool",
ActionablePlus::set_action::<ToolsAction>: Tools::Rectangle,
},
gtk::ToggleButton {
set_focusable: false,
set_hexpand: false,

set_icon_name: "text-case-title-regular",
set_tooltip: "Text tool",
ActionablePlus::set_action::<ToolsAction>: Tools::Text,

},
Expand All @@ -243,6 +251,7 @@ impl Component for App {
set_hexpand: false,

set_icon_name: "drop-regular",
set_tooltip: "Blur",
ActionablePlus::set_action::<ToolsAction>: Tools::Blur,

},
Expand All @@ -252,6 +261,7 @@ impl Component for App {
set_hexpand: false,

set_icon_name: "copy-regular",
set_tooltip: "Copy to clipboard",
connect_clicked[sketch_board_sender] => move |_| {sketch_board_sender.emit(SketchBoardMessage::CopyClipboard);},
},
#[name(save_button)]
Expand All @@ -260,6 +270,7 @@ impl Component for App {
set_hexpand: false,

set_icon_name: "save-regular",
set_tooltip: "Save",
connect_clicked[sketch_board_sender] => move |_| {sketch_board_sender.emit(SketchBoardMessage::SaveFile);},
},

Expand Down Expand Up @@ -324,20 +335,23 @@ impl Component for App {
set_hexpand: false,

set_label: "S",
set_tooltip: "Small font size",
ActionablePlus::set_action::<SizeAction>: Size::Small,
},
gtk::ToggleButton {
set_focusable: false,
set_hexpand: false,

set_label: "M",
set_tooltip: "Medium font size",
ActionablePlus::set_action::<SizeAction>: Size::Medium,
},
gtk::ToggleButton {
set_focusable: false,
set_hexpand: false,

set_label: "L",
set_tooltip: "Large font size",
ActionablePlus::set_action::<SizeAction>: Size::Large,
},
},
Expand Down