-
-
Notifications
You must be signed in to change notification settings - Fork 0
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
Showing
16 changed files
with
1,496 additions
and
1,443 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
.SILENT: | ||
|
||
SHELL=/usr/bin/env bash -O globstar | ||
|
||
all: help | ||
|
||
test: test_unit test_clippy test_fmt ## Runs tests | ||
|
||
bench: ## Benchmark the project | ||
cargo bench | ||
|
||
build: ## Build the project | ||
source test-utils.sh ;\ | ||
section "Cargo build" ;\ | ||
cargo build --all | ||
|
||
fix-format: ## Fix formatting and clippy errors | ||
cargo fmt --all | ||
cargo clippy --all --fix --allow-dirty --allow-staged | ||
|
||
check-format: test_clippy test_fmt ## Check the project for clippy and formatting errors | ||
|
||
test_unit: | ||
source test-utils.sh ;\ | ||
section "Cargo test" ;\ | ||
cargo test --all --no-fail-fast --all-features --all-targets | ||
|
||
test_clippy: | ||
source test-utils.sh ;\ | ||
section "Cargo clippy" ;\ | ||
cargo clippy -- -D warnings | ||
|
||
test_fmt: | ||
source test-utils.sh ;\ | ||
section "Cargo fmt" ;\ | ||
cargo fmt --all -- --check | ||
|
||
help: ## Display available commands | ||
echo "Available make commands:" | ||
echo | ||
grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' |
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,8 +1,4 @@ | ||
/// This will be run prior to compiling the project and will compile the resources | ||
fn main() { | ||
glib_build_tools::compile_resources( | ||
&["./resources"], | ||
"./resources/resources.gresource.xml", | ||
"gosub.gresource", | ||
); | ||
} | ||
/// This will be run prior to compiling the project and will compile the resources | ||
fn main() { | ||
glib_build_tools::compile_resources(&["./resources"], "./resources/resources.gresource.xml", "gosub.gresource"); | ||
} |
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,2 @@ | ||
[toolchain] | ||
channel = "stable" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
pub mod about; | ||
pub mod shortcuts; | ||
pub mod shortcuts; |
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,41 +1,36 @@ | ||
use gtk4::gdk::Texture; | ||
use gtk4::gdk_pixbuf::Pixbuf; | ||
|
||
pub struct About; | ||
|
||
impl About { | ||
pub fn new() -> gtk4::AboutDialog { | ||
let about = gtk4::AboutDialog::new(); | ||
about.set_program_name("Gosub Browser".into()); | ||
about.set_version(Some("0.0.1")); | ||
about.set_website(Some("https://www.gosub.io".into())); | ||
about.set_website_label("Gosub Website"); | ||
about.set_copyright(Some("© 2024 Gosub Team")); | ||
about.set_license_type(gtk4::License::MitX11); | ||
// about.set_logo_icon_name(Some("gosub")); | ||
|
||
if let Ok(logo_pixbuf) = Pixbuf::from_resource_at_scale( | ||
"/io/gosub/browser-gtk/assets/gosub.svg", | ||
128, | ||
128, | ||
true, | ||
) { | ||
let logo_texture = Texture::for_pixbuf(&logo_pixbuf); | ||
about.set_logo(Some(&logo_texture)); | ||
} | ||
about.set_comments(Some("A simple browser written in Rust and GTK")); | ||
|
||
about.set_authors(&["Gosub Team", "Joshua Thijssen", "SharkTheOne"]); | ||
about.add_credit_section("Networking", &[ "Gosub Team" ]); | ||
about.add_credit_section("HTML5 parser", &[ "Gosub Team" ]); | ||
about.add_credit_section("CSS3 parser", &[ "Gosub Team" ]); | ||
about.add_credit_section("Renderer", &[ "Gosub Team" ]); | ||
about.add_credit_section("Javascript engine", &[ "Gosub Team" ]); | ||
about.add_credit_section("UI", &[ "Gosub Team" ]); | ||
about.add_credit_section("GTK integration", &[ "Gosub Team" ]); | ||
about.add_credit_section("Rust integration", &[ "Gosub Team" ]); | ||
about.set_translator_credits(Some("Gosub Team")); | ||
|
||
about | ||
} | ||
} | ||
use gtk4::gdk::Texture; | ||
use gtk4::gdk_pixbuf::Pixbuf; | ||
|
||
pub struct About; | ||
|
||
impl About { | ||
pub fn create_dialog() -> gtk4::AboutDialog { | ||
let about = gtk4::AboutDialog::new(); | ||
about.set_program_name("Gosub Browser".into()); | ||
about.set_version(Some("0.0.1")); | ||
about.set_website(Some("https://www.gosub.io")); | ||
about.set_website_label("Gosub Website"); | ||
about.set_copyright(Some("© 2024 Gosub Team")); | ||
about.set_license_type(gtk4::License::MitX11); | ||
// about.set_logo_icon_name(Some("gosub")); | ||
|
||
if let Ok(logo_pixbuf) = Pixbuf::from_resource_at_scale("/io/gosub/browser-gtk/assets/gosub.svg", 128, 128, true) { | ||
let logo_texture = Texture::for_pixbuf(&logo_pixbuf); | ||
about.set_logo(Some(&logo_texture)); | ||
} | ||
about.set_comments(Some("A simple browser written in Rust and GTK")); | ||
|
||
about.set_authors(&["Gosub Team", "Joshua Thijssen", "SharkTheOne"]); | ||
about.add_credit_section("Networking", &["Gosub Team"]); | ||
about.add_credit_section("HTML5 parser", &["Gosub Team"]); | ||
about.add_credit_section("CSS3 parser", &["Gosub Team"]); | ||
about.add_credit_section("Renderer", &["Gosub Team"]); | ||
about.add_credit_section("Javascript engine", &["Gosub Team"]); | ||
about.add_credit_section("UI", &["Gosub Team"]); | ||
about.add_credit_section("GTK integration", &["Gosub Team"]); | ||
about.add_credit_section("Rust integration", &["Gosub Team"]); | ||
about.set_translator_credits(Some("Gosub Team")); | ||
|
||
about | ||
} | ||
} |
Oops, something went wrong.