Skip to content
Merged
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
322 changes: 162 additions & 160 deletions Cargo.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[workspace.package]
version = "1.0.0-alpha.4"
version = "1.0.0-alpha.5"
edition = "2024"

[workspace]
Expand Down
19 changes: 0 additions & 19 deletions icons.toml

This file was deleted.

15 changes: 9 additions & 6 deletions testangel/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,25 +34,25 @@ image = { version = "0.25.0", default-features = false, features = ["png"] }
thiserror = "2.0.4"
serde = { version = "1.0.180", features = [ "derive" ] }
uuid = { version = "1.4.1", features = [ "v4" ] }
ron = "0.10.1"
ron = "0.11.0"
genpdf = { version = "0.2.0", features = ["images"] }
chrono = "0.4.26"
base64 = "0.22.0"
itertools = "0.14.0"
opener = { version = "0.8.2", optional = true }
octocrab = "0.44.1"
octocrab = "0.47.0"
semver = "1.0.19"
relm4 = { version = "0.9.1", optional = true, features = [ "libadwaita", "gnome_44" ] }
relm4-icons = { version = "0.9.0", optional = true }
sourceview5 = { version = "0.9.1", optional = true, features = [ "v5_6" ] }
relm4 = { version = "0.10.0", optional = true, features = [ "libadwaita", "gnome_44" ] }
relm4-icons = { version = "0.10.0", optional = true }
sourceview5 = { version = "0.10.0", optional = true, features = [ "v5_6" ] }
fluent-templates = { version = "0.13.0", optional = true }
fuzzy-matcher = { version = "0.3.7", optional = true }
sys-locale = { version = "0.3.1", optional = true }
mlua = { version = "0.11.2", features = [ "luau" ] }
pest = "2.7.9"
pest_derive = "2.7.9"
convert_case = "0.8.0"
evp = "1.0.0-beta.2"
evp = "1.0.0-beta.3"
tracing = "0.1.41"
tracing-panic = { version = "0.1.2", optional = true }
tracing-subscriber = { version = "0.3.19", optional = true }
Expand All @@ -63,3 +63,6 @@ csv = "1.3.1"
[target.'cfg(windows)'.build-dependencies]
winres = "0.1"
ico-builder = "0.1"

[build-dependencies]
relm4-icons-build = "0.10.0"
28 changes: 28 additions & 0 deletions testangel/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,34 @@ fn main() {
if cfg!(feature = "cli") || cfg!(feature = "ui") {
println!("cargo::rerun-if-changed=../icon.png");

relm4_icons_build::bundle_icons(
// Name of the file that will be generated at `OUT_DIR`
"icon_names.rs",
// Optional app ID
Some("uk.hpkns.testangel"),
// Custom base resource path:
// * defaults to `/com/example/myapp` in this case if not specified explicitly
// * or `/org/relm4` if app ID was not specified either
None::<&str>,
// Directory with custom icons (if any)
Some("icons"),
// List of icons to include
[
"down",
"edit",
"lightbulb",
"menu",
"papyrus-vertical",
"play",
"plus",
"puzzle-piece",
"settings",
"tag",
"up",
"cross-small-circle-filled",
],
);

#[cfg(windows)]
{
ico_builder::IcoBuilder::default()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ impl CompletionProviderImpl for CompletionProviderDescriptors {
if let Ok(proposal) = proposal.clone().downcast::<DescriptorCompletionProposal>() {
match cell.column() {
sourceview5::CompletionColumn::Icon => {
cell.set_icon_name(relm4_icons::icon_names::TAG);
cell.set_icon_name(crate::ui::icon_names::TAG);
}
sourceview5::CompletionColumn::Before | sourceview5::CompletionColumn::After => {
cell.set_text(None);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ impl CompletionProviderImpl for CompletionProviderEngines {
if let Ok(proposal) = proposal.clone().downcast::<EngineCompletionProposal>() {
match cell.column() {
sourceview5::CompletionColumn::Icon => {
cell.set_icon_name(relm4_icons::icon_names::GEAR);
cell.set_icon_name(crate::ui::icon_names::SETTINGS);
}
sourceview5::CompletionColumn::Before | sourceview5::CompletionColumn::After => {
cell.set_text(None);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ impl CompletionProviderImpl for CompletionProviderEngineInstructions {
{
match cell.column() {
sourceview5::CompletionColumn::Icon => {
cell.set_icon_name(relm4_icons::icon_names::PUZZLE_PIECE);
cell.set_icon_name(crate::ui::icon_names::PUZZLE_PIECE);
}
sourceview5::CompletionColumn::Before => {
cell.set_text(Some(&format!("{}.", proposal.engine_lua_name())));
Expand Down
4 changes: 2 additions & 2 deletions testangel/src/ui/actions/header.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ impl Component for ActionsHeader {

#[local_ref]
add_button -> gtk::MenuButton {
set_icon_name: relm4_icons::icon_names::PLUS,
set_icon_name: crate::ui::icon_names::PLUS,
set_tooltip: &lang::lookup("action-header-add"),

#[wrap(Some)]
Expand Down Expand Up @@ -105,7 +105,7 @@ impl Component for ActionsHeader {
},

gtk::Button {
set_icon_name: relm4_icons::icon_names::PAPYRUS_VERTICAL_ADD,
set_icon_name: crate::ui::icon_names::PAPYRUS_VERTICAL_ADD_SYMBOLIC,
set_tooltip: &lang::lookup("action-header-add-to-open-flow"),
#[watch]
set_sensitive: model.action_open,
Expand Down
2 changes: 1 addition & 1 deletion testangel/src/ui/actions/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ impl Component for ActionsModel {
adw::StatusPage {
set_title: &lang::lookup("nothing-open"),
set_description: Some(&lang::lookup("action-nothing-open-description")),
set_icon_name: Some(relm4_icons::icon_names::LIGHTBULB),
set_icon_name: Some(crate::ui::icon_names::LIGHTBULB),
set_vexpand: true,
}
} else {
Expand Down
2 changes: 1 addition & 1 deletion testangel/src/ui/components/variable_row.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ where
},

gtk::MenuButton {
set_icon_name: relm4_icons::icon_names::EDIT,
set_icon_name: crate::ui::icon_names::EDIT,
set_tooltip_text: Some(&lang::lookup("variable-row-edit-param")),
set_css_classes: &["flat"],
set_direction: gtk::ArrowType::Left,
Expand Down
6 changes: 3 additions & 3 deletions testangel/src/ui/flows/action_component.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ impl FactoryComponent for ActionComponent {
set_spacing: 5,

gtk::Button::builder().css_classes(["flat"]).build() {
set_icon_name: relm4_icons::icon_names::UP,
set_icon_name: crate::ui::icon_names::UP,
set_tooltip: &lang::lookup("move-up"),
set_valign: gtk::Align::Start,
set_height_request: 30,
Expand All @@ -128,7 +128,7 @@ impl FactoryComponent for ActionComponent {
},
},
gtk::Button::builder().css_classes(["flat"]).build() {
set_icon_name: relm4_icons::icon_names::DOWN,
set_icon_name: crate::ui::icon_names::DOWN,
set_tooltip: &lang::lookup("move-down"),
set_valign: gtk::Align::Start,
set_height_request: 30,
Expand All @@ -139,7 +139,7 @@ impl FactoryComponent for ActionComponent {
},
},
gtk::Button::builder().css_classes(["flat"]).build() {
set_icon_name: relm4_icons::icon_names::X_CIRCULAR,
set_icon_name: crate::ui::icon_names::CROSS_SMALL_CIRCLE_FILLED,
set_tooltip: &lang::lookup("delete-step"),
set_valign: gtk::Align::Start,
set_height_request: 30,
Expand Down
6 changes: 3 additions & 3 deletions testangel/src/ui/flows/header.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ impl Component for FlowsHeader {

#[local_ref]
add_button -> gtk::MenuButton {
set_icon_name: relm4_icons::icon_names::PLUS,
set_icon_name: crate::ui::icon_names::PLUS,
set_tooltip: &lang::lookup("flow-header-add"),

#[wrap(Some)]
Expand Down Expand Up @@ -108,7 +108,7 @@ impl Component for FlowsHeader {
},
if model.has_steps_requiring_data {
gtk::Button {
set_icon_name: relm4_icons::icon_names::PLAY_TABLE,
set_icon_name: crate::ui::icon_names::PLAY_TABLE_SYMBOLIC,
set_tooltip: &lang::lookup("flow-header-run-with-data"),
#[watch]
set_sensitive: model.flow_open,
Expand All @@ -119,7 +119,7 @@ impl Component for FlowsHeader {
}
} else {
gtk::Button {
set_icon_name: relm4_icons::icon_names::PLAY,
set_icon_name: crate::ui::icon_names::PLAY,
set_tooltip: &lang::lookup("flow-header-run"),
#[watch]
set_sensitive: model.flow_open,
Expand Down
2 changes: 1 addition & 1 deletion testangel/src/ui/flows/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ impl Component for FlowsModel {
adw::StatusPage {
set_title: &lang::lookup("nothing-open"),
set_description: Some(&lang::lookup("flow-nothing-open-description")),
set_icon_name: Some(relm4_icons::icon_names::LIGHTBULB),
set_icon_name: Some(crate::ui::icon_names::LIGHTBULB),
#[watch]
set_visible: model.open_flow.is_none(),
set_vexpand: true,
Expand Down
2 changes: 1 addition & 1 deletion testangel/src/ui/header_bar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ impl Component for HeaderBarModel {
},

pack_end = &gtk::MenuButton {
set_icon_name: relm4_icons::icon_names::MENU,
set_icon_name: crate::ui::icon_names::MENU,
set_tooltip: &lang::lookup("header-more"),
set_direction: gtk::ArrowType::Down,

Expand Down
12 changes: 9 additions & 3 deletions testangel/src/ui/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,17 @@ mod flows;
mod header_bar;
pub(crate) mod lang;

mod icon_names {
pub use custom::*;
pub use shipped::*;
include!(concat!(env!("OUT_DIR"), "/icon_names.rs"));
}

/// Initialise and open the UI.
pub fn initialise_ui() {
tracing::info!("Starting Next UI...");
let app = RelmApp::new("uk.hpkns.testangel");
relm4_icons::initialize_icons();
relm4_icons::initialize_icons(icon_names::GRESOURCE_BYTES, icon_names::RESOURCE_PREFIX);

let display = gtk::gdk::Display::default().unwrap();
let theme = gtk::IconTheme::for_display(&display);
Expand Down Expand Up @@ -189,7 +195,7 @@ impl Component for AppModel {
model.flows.widget(),
Some("flows"),
&lang::lookup("tab-flows"),
relm4_icons::icon_names::PAPYRUS_VERTICAL,
crate::ui::icon_names::PAPYRUS_VERTICAL,
);
if !std::env::var("TA_HIDE_ACTION_EDITOR")
.unwrap_or("no".to_string())
Expand All @@ -199,7 +205,7 @@ impl Component for AppModel {
model.actions.widget(),
Some("actions"),
&lang::lookup("tab-actions"),
relm4_icons::icon_names::PUZZLE_PIECE,
crate::ui::icon_names::PUZZLE_PIECE,
);
}

Expand Down