From 5ae87b26a087f28f409b7fc2ae1eeaa4c8735f46 Mon Sep 17 00:00:00 2001 From: Giuliano Bellini s294739 Date: Sun, 25 Feb 2024 22:52:53 +0100 Subject: [PATCH 01/12] migrate to iced 0.12: fix build errors --- Cargo.lock | 1550 +++++++++--------- Cargo.toml | 4 +- src/chart/types/traffic_chart.rs | 4 +- src/configs/types/config_window.rs | 29 +- src/countries/country_utils.rs | 32 +- src/gui/app.rs | 58 +- src/gui/components/button.rs | 12 +- src/gui/components/footer.rs | 28 +- src/gui/components/header.rs | 27 +- src/gui/components/modal.rs | 124 +- src/gui/components/tab.rs | 26 +- src/gui/pages/connection_details_page.rs | 43 +- src/gui/pages/initial_page.rs | 36 +- src/gui/pages/inspect_page.rs | 53 +- src/gui/pages/notifications_page.rs | 53 +- src/gui/pages/overview_page.rs | 78 +- src/gui/pages/settings_general_page.rs | 36 +- src/gui/pages/settings_notifications_page.rs | 134 +- src/gui/pages/settings_style_page.rs | 40 +- src/gui/pages/types/running_page.rs | 4 +- src/gui/pages/types/settings_page.rs | 4 +- src/gui/styles/button.rs | 132 +- src/gui/styles/checkbox.rs | 18 +- src/gui/styles/container.rs | 53 +- src/gui/styles/picklist.rs | 26 +- src/gui/styles/scrollbar.rs | 80 +- src/gui/styles/style_constants.rs | 6 +- src/gui/styles/text.rs | 2 +- src/gui/styles/text_input.rs | 58 +- src/gui/styles/toggler.rs | 17 +- src/gui/types/message.rs | 4 +- src/gui/types/sniffer.rs | 7 +- src/main.rs | 15 +- src/networking/types/my_link_type.rs | 2 +- src/notifications/types/sound.rs | 4 +- src/report/types/report_sort_type.rs | 4 +- src/report/types/sort_type.rs | 4 +- src/translations/translations.rs | 47 +- src/translations/translations_3.rs | 4 +- src/translations/types/language.rs | 4 +- src/utils/types/icon.rs | 6 +- 41 files changed, 1452 insertions(+), 1416 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 80e4dd1e..36e95967 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -35,11 +35,12 @@ checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" [[package]] name = "ahash" -version = "0.8.8" +version = "0.8.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42cd52102d3df161c77a887b608d7a4897d7cc112886a9537b738a887a03aaff" +checksum = "d713b3834d76b85304d4d525563c1276e2e30dc97cc67bfb4585a4a29fc2c89f" dependencies = [ "cfg-if", + "getrandom", "once_cell", "version_check", "zerocopy", @@ -90,20 +91,23 @@ dependencies = [ [[package]] name = "android-activity" -version = "0.4.3" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64529721f27c2314ced0890ce45e469574a73e5e6fdd6e9da1860eb29285f5e0" +checksum = "ee91c0c2905bae44f84bfa4e044536541df26b7703fd0888deeb9060fcc44289" dependencies = [ "android-properties", - "bitflags 1.3.2", + "bitflags 2.4.2", "cc", + "cesu8", + "jni 0.21.1", "jni-sys", "libc", "log", - "ndk", + "ndk 0.8.0", "ndk-context", - "ndk-sys", - "num_enum 0.6.1", + "ndk-sys 0.5.0+25.2.9519653", + "num_enum 0.7.2", + "thiserror", ] [[package]] @@ -148,6 +152,12 @@ version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" +[[package]] +name = "as-raw-xcb-connection" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "175571dd1d178ced59193a6fc02dde1b972eb0bc56c892cde9beeceac5bf0f6b" + [[package]] name = "ash" version = "0.37.3+1.3.251" @@ -169,6 +179,12 @@ dependencies = [ "system-deps", ] +[[package]] +name = "atomic-waker" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" + [[package]] name = "autocfg" version = "1.1.0" @@ -213,7 +229,7 @@ dependencies = [ "regex", "rustc-hash", "shlex", - "syn 2.0.48", + "syn 2.0.50", ] [[package]] @@ -251,28 +267,28 @@ checksum = "0d8c1fef690941d3e7788d328517591fecc684c084084702d6ff1641e993699a" [[package]] name = "block-sys" -version = "0.1.0-beta.1" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fa55741ee90902547802152aaf3f8e5248aab7e21468089560d4c8840561146" +checksum = "ae85a0696e7ea3b835a453750bf002770776609115e6d25c6d2ff28a8200f7e7" dependencies = [ "objc-sys", ] [[package]] name = "block2" -version = "0.2.0-alpha.6" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8dd9e63c1744f755c2f60332b88de39d341e5e86239014ad839bd71c106dec42" +checksum = "15b55663a85f33501257357e6421bb33e769d5c9ffb5ba0921c975a123e35e68" dependencies = [ "block-sys", - "objc2-encode", + "objc2", ] [[package]] name = "bumpalo" -version = "3.14.0" +version = "3.15.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f30e7476521f6f8af1a1c4c0b8cc94f0bee37d91763d0ca2665f299b6cd8aec" +checksum = "8ea184aa71bb362a1157c896979544cc23974e08fd265f29ea96b59f0b4a555b" [[package]] name = "bytemuck" @@ -291,7 +307,7 @@ checksum = "965ab7eb5f8f97d2a083c799f3a1b994fc397b2fe2da5d1da1626ce15a39f2b1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.50", ] [[package]] @@ -310,20 +326,6 @@ dependencies = [ "system-deps", ] -[[package]] -name = "calloop" -version = "0.10.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52e0d00eb1ea24371a97d2da6201c6747a633dc6dc1988ef503403b4c59504a8" -dependencies = [ - "bitflags 1.3.2", - "log", - "nix 0.25.1", - "slotmap", - "thiserror", - "vec_map", -] - [[package]] name = "calloop" version = "0.12.4" @@ -344,19 +346,18 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0f0ea9b9476c7fad82841a8dbb380e2eae480c21910feba80725b46931ed8f02" dependencies = [ - "calloop 0.12.4", + "calloop", "rustix", - "wayland-backend 0.3.3", - "wayland-client 0.31.2", + "wayland-backend", + "wayland-client", ] [[package]] name = "cc" -version = "1.0.83" +version = "1.0.88" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" +checksum = "02f341c093d19155a6e41631ce5971aac4e9a868262212153124c15fa22d1cdc" dependencies = [ - "jobserver", "libc", ] @@ -397,6 +398,12 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fd16c4719339c4530435d38e511904438d07cce7950afa3718a84ac36c10e89e" +[[package]] +name = "cfg_aliases" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77e53693616d3075149f4ead59bdeecd204ac6b8192d8969757601b74bddf00f" + [[package]] name = "chrono" version = "0.4.34" @@ -406,7 +413,7 @@ dependencies = [ "android-tzdata", "iana-time-zone", "num-traits", - "windows-targets 0.52.0", + "windows-targets 0.52.3", ] [[package]] @@ -422,13 +429,11 @@ dependencies = [ [[package]] name = "clipboard-win" -version = "4.5.0" +version = "5.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7191c27c2357d9b7ef96baac1773290d4ca63b24205b82a3fd8a0637afcf0362" +checksum = "12f9a0700e0127ba15d1d52dd742097f821cd9c65939303a44d970465040a297" dependencies = [ "error-code", - "str-buf", - "winapi", ] [[package]] @@ -444,35 +449,35 @@ dependencies = [ [[package]] name = "clipboard_wayland" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8134163bd07c47ae3cc29babc42c255fdb315facc790950ae2d0e561ea6f2ec0" +checksum = "003f886bc4e2987729d10c1db3424e7f80809f3fc22dbc16c685738887cb37b8" dependencies = [ "smithay-clipboard", ] [[package]] name = "clipboard_x11" -version = "0.4.1" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5cf45b436634fee64c6d3981639b46a87eeea3c64e422643273fcefd1baef56c" +checksum = "4274ea815e013e0f9f04a2633423e14194e408a0576c943ce3d14ca56c50031c" dependencies = [ "thiserror", - "x11rb 0.13.0", + "x11rb", ] [[package]] name = "cocoa" -version = "0.24.1" +version = "0.25.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f425db7937052c684daec3bd6375c8abe2d146dca4b8b143d6db777c39138f3a" +checksum = "f6140449f97a6e97f9511815c5632d84c8aacf8ac271ad77c559218161a1373c" dependencies = [ "bitflags 1.3.2", "block", "cocoa-foundation", "core-foundation", "core-graphics", - "foreign-types", + "foreign-types 0.5.0", "libc", "objc", ] @@ -508,10 +513,35 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3d7b894f5411737b7867f4827955924d7c254fc9f4d91a6aad6b097804b1018b" [[package]] -name = "com-rs" -version = "0.2.1" +name = "com" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e17887fd17353b65b1b2ef1c526c83e26cd72e74f598a8dc1bee13a48f3d9f6" +dependencies = [ + "com_macros", +] + +[[package]] +name = "com_macros" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf43edc576402991846b093a7ca18a3477e0ef9c588cde84964b5d3e43016642" +checksum = "d375883580a668c7481ea6631fc1a8863e33cc335bf56bfad8d7e6d4b04b13a5" +dependencies = [ + "com_macros_support", + "proc-macro2", + "syn 1.0.109", +] + +[[package]] +name = "com_macros_support" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad899a1087a9296d5644792d7cb72b8e34c1bec8e7d4fbc002230169a6e8710c" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] [[package]] name = "combine" @@ -562,14 +592,14 @@ checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" [[package]] name = "core-graphics" -version = "0.22.3" +version = "0.23.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2581bbab3b8ffc6fcbd550bf46c355135d16e9ff2a6ea032ad6b9bf1d7efe4fb" +checksum = "970a29baf4110c26fedbc7f82107d42c23f7e88e404c4577ed73fe99ff85a212" dependencies = [ "bitflags 1.3.2", "core-foundation", "core-graphics-types", - "foreign-types", + "foreign-types 0.5.0", "libc", ] @@ -606,16 +636,17 @@ dependencies = [ [[package]] name = "cosmic-text" -version = "0.9.0" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0b68966c2543609f8d92f9d33ac3b719b2a67529b0c6c0b3e025637b477eef9" +checksum = "75acbfb314aeb4f5210d379af45ed1ec2c98c7f1790bf57b8a4c562ac0c51b71" dependencies = [ - "aliasable", "fontdb", "libm", "log", "rangemap", - "rustybuzz 0.8.0", + "rustc-hash", + "rustybuzz 0.11.0", + "self_cell", "swash", "sys-locale", "unicode-bidi", @@ -638,7 +669,7 @@ dependencies = [ "js-sys", "libc", "mach2", - "ndk", + "ndk 0.7.0", "ndk-context", "oboe", "once_cell", @@ -651,9 +682,9 @@ dependencies = [ [[package]] name = "crc32fast" -version = "1.3.2" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d" +checksum = "b3855a8a784b474f333699ef2bbca9db2c4a1f6d9088a90a2d25b1eb53111eaa" dependencies = [ "cfg-if", ] @@ -670,6 +701,16 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" +[[package]] +name = "ctor" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30d2b3721e861707777e3195b0158f950ae6dc4a27e4d02ff9f67e3eb3de199e" +dependencies = [ + "quote", + "syn 2.0.50", +] + [[package]] name = "ctrlc" version = "3.4.2" @@ -688,12 +729,12 @@ checksum = "96a6ac251f4a2aca6b3f91340350eab87ae57c3f127ffeb585e92bd336717991" [[package]] name = "d3d12" -version = "0.6.0" +version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8f0de2f5a8e7bd4a9eec0e3c781992a4ce1724f68aec7d7a3715344de8b39da" +checksum = "3e3d747f100290a1ca24b752186f61f6637e1deffe3bf6320de6fcb29510a307" dependencies = [ - "bitflags 1.3.2", - "libloading 0.7.4", + "bitflags 2.4.2", + "libloading 0.8.1", "winapi", ] @@ -704,7 +745,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "978747c1d849a7d2ee5e8adc0159961c48fb7e5db2f06af6723b80123bb53856" dependencies = [ "cfg-if", - "hashbrown 0.14.3", + "hashbrown", "lock_api", "once_cell", "parking_lot_core 0.9.9", @@ -718,9 +759,9 @@ checksum = "0c87e182de0887fd5361989c677c4e8f5000cd9491d6d563161a8f3a5519fc7f" [[package]] name = "data-url" -version = "0.2.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d7439c3735f405729d52c3fbbe4de140eaf938a1fe47d227c27f8254d4302a5" +checksum = "5c297a1c74b71ae29df00c3e22dd9534821d60eb9af5a0192823fa2acea70c2a" [[package]] name = "directories" @@ -782,6 +823,45 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9ea835d29036a4087793836fa931b08837ad5e957da9e23886b29586fb9b6650" +[[package]] +name = "drm" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a0f8a69e60d75ae7dab4ef26a59ca99f2a89d4c142089b537775ae0c198bdcde" +dependencies = [ + "bitflags 2.4.2", + "bytemuck", + "drm-ffi", + "drm-fourcc", + "rustix", +] + +[[package]] +name = "drm-ffi" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41334f8405792483e32ad05fbb9c5680ff4e84491883d2947a4757dc54cb2ac6" +dependencies = [ + "drm-sys", + "rustix", +] + +[[package]] +name = "drm-fourcc" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0aafbcdb8afc29c1a7ee5fbe53b5d62f4565b35a042a662ca9fecd0b54dae6f4" + +[[package]] +name = "drm-sys" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d09ff881f92f118b11105ba5e34ff8f4adf27b30dae8f12e28c193af1c83176" +dependencies = [ + "libc", + "linux-raw-sys 0.6.4", +] + [[package]] name = "either" version = "1.10.0" @@ -836,13 +916,9 @@ dependencies = [ [[package]] name = "error-code" -version = "2.3.1" +version = "3.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64f18991e7bf11e7ffee451b5318b5c1a73c52d0d0ada6e5a3017c8c1ced6a21" -dependencies = [ - "libc", - "str-buf", -] +checksum = "26a147e1a6641a55d994b3e4e9fa4d9b180c8d652c09b363af8c9bf1b8e04139" [[package]] name = "etagere" @@ -878,15 +954,6 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dd2e7510819d6fbf51a5545c8f922716ecfb14df168a3242f7d33e0239efe6a1" -[[package]] -name = "fastrand" -version = "1.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e51093e27b0797c359783294ca4f0a911c270184cb10f85783b118614a1501be" -dependencies = [ - "instant", -] - [[package]] name = "fastrand" version = "2.0.1" @@ -953,13 +1020,13 @@ dependencies = [ [[package]] name = "fontdb" -version = "0.14.1" +version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af8d8cbea8f21307d7e84bca254772981296f058a1d36b461bf4d83a7499fc9e" +checksum = "020e203f177c0fb250fb19455a252e838d2bbbce1f80f25ecc42402aafa8cd38" dependencies = [ "fontconfig-parser", "log", - "memmap2 0.6.2", + "memmap2 0.8.0", "slotmap", "tinyvec", "ttf-parser 0.19.2", @@ -971,7 +1038,28 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" dependencies = [ - "foreign-types-shared", + "foreign-types-shared 0.1.1", +] + +[[package]] +name = "foreign-types" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d737d9aa519fb7b749cbc3b962edcf310a8dd1f4b67c91c4f83975dbdd17d965" +dependencies = [ + "foreign-types-macros", + "foreign-types-shared 0.3.1", +] + +[[package]] +name = "foreign-types-macros" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a5c6c585bc94aaf2c7b51dd4c2ba22680844aba4c687be581871a6f518c5742" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.50", ] [[package]] @@ -980,6 +1068,12 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" +[[package]] +name = "foreign-types-shared" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa9a19cbb55df58761df49b23516a86d432839add4af60fc256da840f66ed35b" + [[package]] name = "form_urlencoded" version = "1.2.1" @@ -1046,7 +1140,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.50", ] [[package]] @@ -1063,9 +1157,9 @@ checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" [[package]] name = "futures-timer" -version = "3.0.2" +version = "3.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e64b03909df88034c26dc1547e8970b91f98bdb65165d6a4e9110d94263dbb2c" +checksum = "f288b0a4f20f9a56b5d1da57e2227c661b7b16168e2f72365f57b63326e29b24" [[package]] name = "futures-util" @@ -1115,16 +1209,6 @@ dependencies = [ "system-deps", ] -[[package]] -name = "gethostname" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1ebd34e35c46e00bb73e81363248d627782724609fe1b6396f553f68fe3862e" -dependencies = [ - "libc", - "winapi", -] - [[package]] name = "gethostname" version = "0.4.3" @@ -1175,11 +1259,22 @@ dependencies = [ "winapi", ] +[[package]] +name = "gl_generator" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a95dfc23a2b4a9a2f5ab41d194f8bfda3cabec42af4e39f08c339eb2a0c124d" +dependencies = [ + "khronos_api", + "log", + "xml-rs", +] + [[package]] name = "glam" -version = "0.24.2" +version = "0.25.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5418c17512bdf42730f9032c74e1ae39afc408745ebb2acf72fbc4691c17945" +checksum = "151665d9be52f9bb40fc7966565d39666f2d1e69233571b71b87791c7e0528b3" [[package]] name = "glib-sys" @@ -1199,9 +1294,9 @@ checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" [[package]] name = "glow" -version = "0.12.3" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca0fe580e4b60a8ab24a868bc08e2f03cbcb20d3d676601fa909386713333728" +checksum = "bd348e04c43b32574f2de31c8bb397d96c9fcfa1371bd4ca6d8bdc464ab121b1" dependencies = [ "js-sys", "slotmap", @@ -1209,11 +1304,20 @@ dependencies = [ "web-sys", ] +[[package]] +name = "glutin_wgl_sys" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c8098adac955faa2d31079b65dc48841251f69efd3ac25477903fc424362ead" +dependencies = [ + "gl_generator", +] + [[package]] name = "glyphon" -version = "0.3.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e87caa7459145f5e5f167bf34db4532901404c679e62339fb712a0e3ccf722a" +checksum = "6a62d0338e4056db6a73221c2fb2e30619452f6ea9651bac4110f51b0f7a7581" dependencies = [ "cosmic-text", "etagere", @@ -1234,34 +1338,34 @@ dependencies = [ [[package]] name = "gpu-alloc" -version = "0.5.4" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22beaafc29b38204457ea030f6fb7a84c9e4dd1b86e311ba0542533453d87f62" +checksum = "fbcd2dba93594b227a1f57ee09b8b9da8892c34d55aa332e034a228d0fe6a171" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.4.2", "gpu-alloc-types", ] [[package]] name = "gpu-alloc-types" -version = "0.2.0" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54804d0d6bc9d7f26db4eaec1ad10def69b599315f487d32c334a80d1efe67a5" +checksum = "98ff03b468aa837d70984d55f5d3f846f6ec31fe34bbb97c4f85219caeee1ca4" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.4.2", ] [[package]] name = "gpu-allocator" -version = "0.22.0" +version = "0.25.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce95f9e2e11c2c6fadfce42b5af60005db06576f231f5c92550fdded43c423e8" +checksum = "6f56f6318968d03c18e1bcf4857ff88c61157e9da8e47c5f29055d60e1228884" dependencies = [ - "backtrace", "log", + "presser", "thiserror", "winapi", - "windows 0.44.0", + "windows 0.52.0", ] [[package]] @@ -1272,7 +1376,7 @@ checksum = "cc11df1ace8e7e564511f53af41f3e42ddc95b56fd07b3f4445d2a6048bc682c" dependencies = [ "bitflags 2.4.2", "gpu-descriptor-types", - "hashbrown 0.14.3", + "hashbrown", ] [[package]] @@ -1324,7 +1428,7 @@ dependencies = [ "futures-sink", "futures-util", "http", - "indexmap 2.2.2", + "indexmap", "slab", "tokio", "tokio-util", @@ -1341,12 +1445,6 @@ dependencies = [ "crunchy", ] -[[package]] -name = "hashbrown" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" - [[package]] name = "hashbrown" version = "0.14.3" @@ -1359,14 +1457,14 @@ dependencies = [ [[package]] name = "hassle-rs" -version = "0.10.0" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1397650ee315e8891a0df210707f0fc61771b0cc518c3023896064c5407cb3b0" +checksum = "af2a7e73e1f34c48da31fb668a907f250794837e08faa144fd24f0b8b741e890" dependencies = [ - "bitflags 1.3.2", - "com-rs", + "bitflags 2.4.2", + "com", "libc", - "libloading 0.7.4", + "libloading 0.8.1", "thiserror", "widestring", "winapi", @@ -1380,9 +1478,9 @@ checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" [[package]] name = "hermit-abi" -version = "0.3.5" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0c62115964e08cb8039170eb33c1d0e2388a256930279edca206fff675f82c3" +checksum = "379dada1584ad501b383485dd706b8afb7a70fcbc7f4da7d780638a5a6124a60" [[package]] name = "hexf-parse" @@ -1500,9 +1598,9 @@ dependencies = [ [[package]] name = "iced" -version = "0.10.0" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c708807ec86f99dd729dc4d42db5239acf118cec14d3c5f57679dcfdbbc472b1" +checksum = "7d4eb0fbbefb8c428b70680e77ed9013887b17c1d6be366b40f264f956d1a096" dependencies = [ "iced_core", "iced_futures", @@ -1514,23 +1612,27 @@ dependencies = [ [[package]] name = "iced_core" -version = "0.10.0" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64d0bc4fbf018576d08d93f838e6058cc6f10bbc05e04ae249a2a44dffb4ebc8" +checksum = "d8f68104cc550807c6c350c13095b1866f08e53c951b540eb122eee67d86b0ab" dependencies = [ - "bitflags 1.3.2", - "instant", + "bitflags 2.4.2", + "glam", "log", + "num-traits", "palette", + "raw-window-handle 0.6.0", + "smol_str", "thiserror", - "twox-hash", + "web-time", + "xxhash-rust", ] [[package]] name = "iced_futures" -version = "0.7.0" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14dab0054a9c7a1cbce227a8cd9ee4a094497b3d06094551ac6c1488d563802e" +checksum = "370bad88fb3832cbeeb3fa6c486b4701fb7e8da32a753b3101d4ce81fc1d9497" dependencies = [ "futures", "iced_core", @@ -1542,51 +1644,56 @@ dependencies = [ [[package]] name = "iced_graphics" -version = "0.9.0" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67ff14447a221e9e9205a13d84d7bbdf0636a3b1daa02cfca690ed09689c4d2b" +checksum = "6a044c193ef0840eacabfa05424717331d1fc5b3ecb9a89316200c75da2ba9a4" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.4.2", "bytemuck", - "glam", + "cosmic-text", "half", "iced_core", + "iced_futures", "log", "lyon_path", - "raw-window-handle", + "once_cell", + "raw-window-handle 0.6.0", + "rustc-hash", "thiserror", + "unicode-segmentation", + "xxhash-rust", ] [[package]] name = "iced_renderer" -version = "0.1.0" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1033385b0db0099a0d13178c9ff93c1ce11e7d0177522acf578bf79febdb2af8" +checksum = "5c281e03001d566058f53dec9325bbe61c62da715341206d2627f57a3ecc7f69" dependencies = [ "iced_graphics", "iced_tiny_skia", "iced_wgpu", "log", - "raw-window-handle", "thiserror", ] [[package]] name = "iced_runtime" -version = "0.1.1" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c6c89853e1250c6fac82c5015fa2144517be9b33d4b8e456f10e198b23e28bd" +checksum = "a79f852c01cc6d61663c94379cb3974ac3ad315a28c504e847d573e094f46822" dependencies = [ "iced_core", "iced_futures", + "raw-window-handle 0.6.0", "thiserror", ] [[package]] name = "iced_style" -version = "0.9.0" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d85c47d9d13e2281f75ddf98c865daf2101632bd2b855c401dd0b1c8b81a31a0" +checksum = "2ea42a740915d2a5a9ff9c3aa0bca28b16e9fb660bc8f675eed71d186cadb579" dependencies = [ "iced_core", "once_cell", @@ -1595,30 +1702,29 @@ dependencies = [ [[package]] name = "iced_tiny_skia" -version = "0.1.0" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7715f6222c9470bbbd75a39f70478fa0d1bdfb81a377a34fd1b090ffccc480b" +checksum = "8c2228781f4d381a1cbbd7905a9f077351aa8d37269094021d5d9e779f130aff" dependencies = [ "bytemuck", "cosmic-text", "iced_graphics", - "kurbo", + "kurbo 0.10.4", "log", - "raw-window-handle", "resvg", "rustc-hash", "softbuffer", - "tiny-skia 0.10.0", - "twox-hash", + "tiny-skia", + "xxhash-rust", ] [[package]] name = "iced_wgpu" -version = "0.11.1" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "703f7c5de46b997ed7b18e05ec67059dcdf3beeac51e917c21071b021bb848b9" +checksum = "e3c243b6700452886aac1ee1987e84d9fb43b56b53fea9a1eb67713fd0fde244" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.4.2", "bytemuck", "futures", "glam", @@ -1628,18 +1734,15 @@ dependencies = [ "log", "lyon", "once_cell", - "raw-window-handle", "resvg", - "rustc-hash", - "twox-hash", "wgpu", ] [[package]] name = "iced_widget" -version = "0.1.3" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a177219ae51c3ba08f228ab932354b360cc669e94aec50c01e7c9b675f074c7c" +checksum = "86d9065d7880c1156651a54f88366d29e21ed9fd42860b8119e93dcb8f519080" dependencies = [ "iced_renderer", "iced_runtime", @@ -1652,22 +1755,33 @@ dependencies = [ [[package]] name = "iced_winit" -version = "0.10.1" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad0c884bcb14722a57192b40a5ef6b5e170fa2f01fe2ff28d6cdd9efe37acf70" +checksum = "a2cb4d4e2566f4f5ebf5d818cb57a881fa13972db39d717ebfd9a28acb3be3dd" dependencies = [ "iced_graphics", "iced_runtime", "iced_style", "log", - "raw-window-handle", "thiserror", + "tracing", "web-sys", "winapi", "window_clipboard", "winit", ] +[[package]] +name = "icrate" +version = "0.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "99d3aaff8a54577104bafdf686ff18565c3b6903ca5782a2026ef06e2c7aa319" +dependencies = [ + "block2", + "dispatch", + "objc2", +] + [[package]] name = "idna" version = "0.5.0" @@ -1686,22 +1800,12 @@ checksum = "029d73f573d8e8d63e6d5020011d3255b28c3ba85d6cf870a07184ed23de9284" [[package]] name = "indexmap" -version = "1.9.3" +version = "2.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" -dependencies = [ - "autocfg", - "hashbrown 0.12.3", -] - -[[package]] -name = "indexmap" -version = "2.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "824b2ae422412366ba479e8111fd301f7b5faece8149317bb81925979a53f520" +checksum = "233cf39063f058ea2caae4091bf4a3ef70a653afbc026f5c4a4135d114e3c177" dependencies = [ "equivalent", - "hashbrown 0.14.3", + "hashbrown", ] [[package]] @@ -1711,20 +1815,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" dependencies = [ "cfg-if", - "js-sys", - "wasm-bindgen", - "web-sys", -] - -[[package]] -name = "io-lifetimes" -version = "1.0.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eae7b9aee968036d54dce06cebaefd919e4472e753296daccd6d344e3e2df0c2" -dependencies = [ - "hermit-abi", - "libc", - "windows-sys 0.48.0", ] [[package]] @@ -1795,20 +1885,27 @@ dependencies = [ ] [[package]] -name = "jni-sys" -version = "0.3.0" +name = "jni" +version = "0.21.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8eaf4bc02d17cbdd7ff4c7438cafcdf7fb9a4613313ad11b4f8fefe7d3fa0130" - -[[package]] -name = "jobserver" -version = "0.1.28" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab46a6e9526ddef3ae7f787c06f0f2600639ba80ea3eade3d8e670a2230f51d6" +checksum = "1a87aa2bb7d2af34197c04845522473242e1aa17c12f4935d5856491a7fb8c97" dependencies = [ - "libc", + "cesu8", + "cfg-if", + "combine", + "jni-sys", + "log", + "thiserror", + "walkdir", + "windows-sys 0.45.0", ] +[[package]] +name = "jni-sys" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8eaf4bc02d17cbdd7ff4c7438cafcdf7fb9a4613313ad11b4f8fefe7d3fa0130" + [[package]] name = "jpeg-decoder" version = "0.3.1" @@ -1826,15 +1923,21 @@ dependencies = [ [[package]] name = "khronos-egl" -version = "4.1.0" +version = "6.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c2352bd1d0bceb871cb9d40f24360c8133c11d7486b68b5381c1dd1a32015e3" +checksum = "6aae1df220ece3c0ada96b8153459b67eebe9ae9212258bb0134ae60416fdf76" dependencies = [ "libc", - "libloading 0.7.4", + "libloading 0.8.1", "pkg-config", ] +[[package]] +name = "khronos_api" +version = "3.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2db585e1d738fc771bf08a151420d3ed193d9d895a36df7f6f8a9456b911ddc" + [[package]] name = "kurbo" version = "0.9.5" @@ -1844,6 +1947,16 @@ dependencies = [ "arrayvec", ] +[[package]] +name = "kurbo" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1618d4ebd923e97d67e7cd363d80aef35fe961005cbbbb3d2dad8bdd1bc63440" +dependencies = [ + "arrayvec", + "smallvec", +] + [[package]] name = "lazy_static" version = "1.4.0" @@ -1926,6 +2039,12 @@ version = "0.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" +[[package]] +name = "linux-raw-sys" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0b5399f6804fbab912acbd8878ed3532d506b7c951b8f9f164ef90fef39e3f4" + [[package]] name = "lock_api" version = "0.4.11" @@ -1944,11 +2063,11 @@ checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" [[package]] name = "lru" -version = "0.11.1" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4a83fb7698b3643a0e34f9ae6f2e8f0178c0fd42f8b59d493aa271ff3a5bf21" +checksum = "d3262e75e648fce39813cb56ac41f3c3e3f65217ebf3844d818d1f9398cfb0dc" dependencies = [ - "hashbrown 0.14.3", + "hashbrown", ] [[package]] @@ -2041,18 +2160,9 @@ checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149" [[package]] name = "memmap2" -version = "0.5.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83faa42c0a078c393f6b29d5db232d8be22776a891f8f56e5284faee4a20b327" -dependencies = [ - "libc", -] - -[[package]] -name = "memmap2" -version = "0.6.2" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d28bba84adfe6646737845bc5ebbfa2c08424eb1c37e94a1fd2a82adb56a872" +checksum = "43a5a03cefb0d953ec0be133036f14e109412fa594edc2f77227249db66cc3ed" dependencies = [ "libc", ] @@ -2066,36 +2176,19 @@ dependencies = [ "libc", ] -[[package]] -name = "memoffset" -version = "0.6.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5aa361d4faea93603064a027415f07bd8e1d5c88c9fbf68bf56a285428fd79ce" -dependencies = [ - "autocfg", -] - -[[package]] -name = "memoffset" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5de893c32cde5f383baa4c04c5d6dbdd735cfd4a794b0debdb2bb1b421da5ff4" -dependencies = [ - "autocfg", -] - [[package]] name = "metal" -version = "0.24.0" +version = "0.27.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de11355d1f6781482d027a3b4d4de7825dcedb197bf573e0596d00008402d060" +checksum = "c43f73953f8cbe511f021b58f18c3ce1c3d1ae13fe953293e13345bf83217f25" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.4.2", "block", "core-graphics-types", - "foreign-types", + "foreign-types 0.5.0", "log", "objc", + "paste", ] [[package]] @@ -2127,22 +2220,21 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f3d0b296e374a4e6f3c7b0a1f5a51d748a0d34c85e7dc48fc3fa9a87657fe09" dependencies = [ "libc", - "log", "wasi", "windows-sys 0.48.0", ] [[package]] name = "naga" -version = "0.12.3" +version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbcc2e0513220fd2b598e6068608d4462db20322c0e77e47f6f488dfcfc279cb" +checksum = "8878eb410fc90853da3908aebfe61d73d26d4437ef850b70050461f939509899" dependencies = [ "bit-set", - "bitflags 1.3.2", + "bitflags 2.4.2", "codespan-reporting", "hexf-parse", - "indexmap 1.9.3", + "indexmap", "log", "num-traits", "rustc-hash", @@ -2178,9 +2270,24 @@ checksum = "451422b7e4718271c8b5b3aadf5adedba43dc76312454b387e98fae0fc951aa0" dependencies = [ "bitflags 1.3.2", "jni-sys", - "ndk-sys", + "ndk-sys 0.4.1+23.1.7779620", "num_enum 0.5.11", - "raw-window-handle", + "raw-window-handle 0.5.2", + "thiserror", +] + +[[package]] +name = "ndk" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2076a31b7010b17a38c01907c45b945e8f11495ee4dd588309718901b1f7a5b7" +dependencies = [ + "bitflags 2.4.2", + "jni-sys", + "log", + "ndk-sys 0.5.0+25.2.9519653", + "num_enum 0.7.2", + "raw-window-handle 0.6.0", "thiserror", ] @@ -2200,41 +2307,23 @@ dependencies = [ ] [[package]] -name = "nix" -version = "0.24.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa52e972a9a719cecb6864fb88568781eb706bac2cd1d4f04a648542dbf78069" -dependencies = [ - "bitflags 1.3.2", - "cfg-if", - "libc", - "memoffset 0.6.5", -] - -[[package]] -name = "nix" -version = "0.25.1" +name = "ndk-sys" +version = "0.5.0+25.2.9519653" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f346ff70e7dbfd675fe90590b92d59ef2de15a8779ae305ebcbfd3f0caf59be4" +checksum = "8c196769dd60fd4f363e11d948139556a344e79d451aeb2fa2fd040738ef7691" dependencies = [ - "autocfg", - "bitflags 1.3.2", - "cfg-if", - "libc", - "memoffset 0.6.5", + "jni-sys", ] [[package]] name = "nix" -version = "0.26.4" +version = "0.24.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "598beaf3cc6fdd9a5dfb1630c2800c7acd31df7aaf0f565796fba2b53ca1af1b" +checksum = "fa52e972a9a719cecb6864fb88568781eb706bac2cd1d4f04a648542dbf78069" dependencies = [ "bitflags 1.3.2", "cfg-if", "libc", - "memoffset 0.7.1", - "pin-utils", ] [[package]] @@ -2300,11 +2389,11 @@ dependencies = [ [[package]] name = "num_enum" -version = "0.6.1" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a015b430d3c108a207fd776d2e2196aaf8b1cf8cf93253e3a097ff3085076a1" +checksum = "02339744ee7253741199f897151b38e72257d13802d4ee837285cc2990a90845" dependencies = [ - "num_enum_derive 0.6.1", + "num_enum_derive 0.7.2", ] [[package]] @@ -2313,7 +2402,7 @@ version = "0.5.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dcbff9bc912032c62bf65ef1d5aea88983b420f4f839db1e9b0c281a25c9c799" dependencies = [ - "proc-macro-crate", + "proc-macro-crate 1.3.1", "proc-macro2", "quote", "syn 1.0.109", @@ -2321,14 +2410,14 @@ dependencies = [ [[package]] name = "num_enum_derive" -version = "0.6.1" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96667db765a921f7b295ffee8b60472b686a51d4f21c2ee4ffdb94c7013b65a6" +checksum = "681030a937600a36906c185595136d26abfebb4aa9c65701cefcaf8578bb982b" dependencies = [ - "proc-macro-crate", + "proc-macro-crate 3.1.0", "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.50", ] [[package]] @@ -2354,29 +2443,25 @@ dependencies = [ [[package]] name = "objc-sys" -version = "0.2.0-beta.2" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df3b9834c1e95694a05a828b59f55fa2afec6288359cda67146126b3f90a55d7" +checksum = "c7c71324e4180d0899963fc83d9d241ac39e699609fc1025a850aadac8257459" [[package]] name = "objc2" -version = "0.3.0-beta.3.patch-leaks.3" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e01640f9f2cb1220bbe80325e179e532cb3379ebcd1bf2279d703c19fe3a468" +checksum = "559c5a40fdd30eb5e344fbceacf7595a81e242529fb4e21cf5f43fb4f11ff98d" dependencies = [ - "block2", "objc-sys", "objc2-encode", ] [[package]] name = "objc2-encode" -version = "2.0.0-pre.2" +version = "3.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "abfcac41015b00a120608fdaa6938c44cb983fee294351cc4bac7638b4e50512" -dependencies = [ - "objc-sys", -] +checksum = "d079845b37af429bfe5dfa76e6d087d788031045b25cfc6fd898486fd9847666" [[package]] name = "objc_exception" @@ -2412,7 +2497,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8868cc237ee02e2d9618539a23a8d228b9bb3fc2e7a5b11eed3831de77c395d0" dependencies = [ "jni 0.20.0", - "ndk", + "ndk 0.7.0", "ndk-context", "num-derive", "num-traits", @@ -2436,13 +2521,13 @@ checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" [[package]] name = "openssl" -version = "0.10.63" +version = "0.10.64" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15c9d69dd87a29568d4d017cfe8ec518706046a05184e5aea92d0af890b803c8" +checksum = "95a0481286a310808298130d22dd1fef0fa571e05a8f44ec801801e84b216b1f" dependencies = [ "bitflags 2.4.2", "cfg-if", - "foreign-types", + "foreign-types 0.3.2", "libc", "once_cell", "openssl-macros", @@ -2457,7 +2542,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.50", ] [[package]] @@ -2468,9 +2553,9 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "openssl-sys" -version = "0.9.99" +version = "0.9.101" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22e1bf214306098e4832460f797824c05d25aacdf896f64a985fb0fd992454ae" +checksum = "dda2b0f344e78efc2facf7d195d098df0dd72151b26ab98da807afc26c198dff" dependencies = [ "cc", "libc", @@ -2495,9 +2580,9 @@ dependencies = [ [[package]] name = "ouroboros" -version = "0.17.2" +version = "0.18.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2ba07320d39dfea882faa70554b4bd342a5f273ed59ba7c1c6b4c840492c954" +checksum = "97b7be5a8a3462b752f4be3ff2b2bf2f7f1d00834902e46be2a4d68b87b0573c" dependencies = [ "aliasable", "ouroboros_macro", @@ -2506,15 +2591,16 @@ dependencies = [ [[package]] name = "ouroboros_macro" -version = "0.17.2" +version = "0.18.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec4c6225c69b4ca778c0aea097321a64c421cf4577b331c61b229267edabb6f8" +checksum = "b645dcde5f119c2c454a92d0dfa271a2a3b205da92e4292a68ead4bdbfde1f33" dependencies = [ "heck", - "proc-macro-error", + "itertools 0.12.1", "proc-macro2", + "proc-macro2-diagnostics", "quote", - "syn 2.0.48", + "syn 2.0.50", ] [[package]] @@ -2528,9 +2614,9 @@ dependencies = [ [[package]] name = "palette" -version = "0.7.4" +version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d38e6e5ca1612e2081cc31188f08c3cba630ce4ba44709a153f1a0f38d678f2" +checksum = "ebfc23a4b76642983d57e4ad00bb4504eb30a8ce3c70f4aee1f725610e36d97a" dependencies = [ "approx", "fast-srgb8", @@ -2540,13 +2626,13 @@ dependencies = [ [[package]] name = "palette_derive" -version = "0.7.4" +version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e05d1c929301fee6830dafa764341118829b2535c216b0571e3821ecac5c885b" +checksum = "e8890702dbec0bad9116041ae586f84805b13eecd1d8b1df27c29998a9969d6d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.50", ] [[package]] @@ -2609,6 +2695,12 @@ dependencies = [ "windows-targets 0.48.5", ] +[[package]] +name = "paste" +version = "1.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" + [[package]] name = "pcap" version = "1.2.0" @@ -2670,7 +2762,7 @@ dependencies = [ "phf_shared", "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.50", ] [[package]] @@ -2702,9 +2794,9 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "pkg-config" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2900ede94e305130c13ddd391e0ab7cbaeb783945ae07a279c268cb05109c6cb" +checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" [[package]] name = "plotters" @@ -2726,9 +2818,9 @@ checksum = "9e76628b4d3a7581389a35d5b6e2139607ad7c75b17aed325f210aa91f4a9609" [[package]] name = "plotters-iced" -version = "0.9.0" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b533be9c5ba7d80b7fd619fd5226c58bcae53db2c24b447fa82be25865c117e6" +checksum = "c5e45cd10abd572d7d0dce11446a915c8b54442480d2a46e71dcb9dd43d93b4c" dependencies = [ "iced_graphics", "iced_widget", @@ -2739,9 +2831,9 @@ dependencies = [ [[package]] name = "png" -version = "0.17.11" +version = "0.17.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f6c3c3e617595665b8ea2ff95a86066be38fb121ff920a9c0eb282abcd1da5a" +checksum = "06e4b0d3d1312775e782c86c91a111aa1f910cbb65e1337f9975b5f9a554b5e1" dependencies = [ "bitflags 1.3.2", "crc32fast", @@ -2752,9 +2844,9 @@ dependencies = [ [[package]] name = "polling" -version = "3.4.0" +version = "3.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30054e72317ab98eddd8561db0f6524df3367636884b7b21b703e4b280a84a14" +checksum = "24f040dee2588b4963afb4e420540439d126f73fdacf4a9c486a96d840bac3c9" dependencies = [ "cfg-if", "concurrent-queue", @@ -2765,10 +2857,10 @@ dependencies = [ ] [[package]] -name = "ppv-lite86" -version = "0.2.17" +name = "presser" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" +checksum = "e8cf8e6a8aa66ce33f63993ffc4ea4271eb5b0530a9002db8455ea6050c77bfa" [[package]] name = "proc-macro-crate" @@ -2781,27 +2873,12 @@ dependencies = [ ] [[package]] -name = "proc-macro-error" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" -dependencies = [ - "proc-macro-error-attr", - "proc-macro2", - "quote", - "syn 1.0.109", - "version_check", -] - -[[package]] -name = "proc-macro-error-attr" -version = "1.0.4" +name = "proc-macro-crate" +version = "3.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" +checksum = "6d37c51ca738a55da99dc0c4a34860fd675453b8b36209178c2249bb13651284" dependencies = [ - "proc-macro2", - "quote", - "version_check", + "toml_edit 0.21.1", ] [[package]] @@ -2814,19 +2891,23 @@ dependencies = [ ] [[package]] -name = "profiling" -version = "1.0.14" +name = "proc-macro2-diagnostics" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f0f7f43585c34e4fdd7497d746bc32e14458cf11c69341cc0587b1d825dde42" +checksum = "af066a9c399a26e020ada66a034357a868728e72cd426f3adcd35f80d88d88c8" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.50", + "version_check", + "yansi", +] [[package]] -name = "quick-xml" -version = "0.28.2" +name = "profiling" +version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ce5e73202a820a31f8a0ee32ada5e21029c81fd9e3ebf668a40832e4219d9d1" -dependencies = [ - "memchr", -] +checksum = "43d84d1d7a6ac92673717f9f6d1518374ef257669c24ebc5ac25d5033828be58" [[package]] name = "quick-xml" @@ -2852,18 +2933,6 @@ version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" dependencies = [ - "libc", - "rand_chacha", - "rand_core", -] - -[[package]] -name = "rand_chacha" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" -dependencies = [ - "ppv-lite86", "rand_core", ] @@ -2872,9 +2941,6 @@ name = "rand_core" version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" -dependencies = [ - "getrandom", -] [[package]] name = "range-alloc" @@ -2894,6 +2960,12 @@ version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f2ff9a1f06a88b01621b7ae906ef0211290d1c8a168a15542486a8f61c0833b9" +[[package]] +name = "raw-window-handle" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42a9830a0e1b9fb145ebb365b8bc4ccd75f290f98c0247deafbbe2c75cefb544" + [[package]] name = "rctree" version = "0.5.0" @@ -2902,9 +2974,9 @@ checksum = "3b42e27ef78c35d3998403c1d26f3efd9e135d3e5121b0a4845cc5cc27547f4f" [[package]] name = "read-fonts" -version = "0.15.4" +version = "0.15.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d70252c718fb23d41771a4f927e924700edefc2a91ecd52a2ee6f2461d4e6b64" +checksum = "c044ab88c43e2eae05b34a17fc13598736679fdb03d71b49fcfe114443ec8a86" dependencies = [ "font-types", ] @@ -3034,9 +3106,9 @@ dependencies = [ [[package]] name = "resvg" -version = "0.35.0" +version = "0.36.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6554f47c38eca56827eea7f285c2a3018b4e12e0e195cc105833c008be338f1" +checksum = "cc7980f653f9a7db31acff916a262c3b78c562919263edea29bf41a056e20497" dependencies = [ "gif", "jpeg-decoder", @@ -3045,7 +3117,7 @@ dependencies = [ "png", "rgb", "svgtypes", - "tiny-skia 0.10.0", + "tiny-skia", "usvg", ] @@ -3065,7 +3137,7 @@ dependencies = [ "objc", "objc-foundation", "objc_id", - "raw-window-handle", + "raw-window-handle 0.5.2", "wasm-bindgen", "wasm-bindgen-futures", "web-sys", @@ -3083,16 +3155,17 @@ dependencies = [ [[package]] name = "ring" -version = "0.17.7" +version = "0.17.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "688c63d65483050968b2a8937f7995f443e27041a0f7700aa59b0822aedebb74" +checksum = "c17fa4cb658e3583423e915b9f3acc01cceaee1860e33d59ebae66adc3a2dc0d" dependencies = [ "cc", + "cfg-if", "getrandom", "libc", "spin", "untrusted", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] @@ -3145,7 +3218,7 @@ dependencies = [ "regex", "relative-path", "rustc_version", - "syn 2.0.48", + "syn 2.0.50", "unicode-ident", ] @@ -3179,7 +3252,7 @@ dependencies = [ "bitflags 2.4.2", "errno 0.3.8", "libc", - "linux-raw-sys", + "linux-raw-sys 0.4.13", "windows-sys 0.52.0", ] @@ -3232,42 +3305,42 @@ dependencies = [ [[package]] name = "rustybuzz" -version = "0.7.0" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "162bdf42e261bee271b3957691018634488084ef577dddeb6420a9684cab2a6a" +checksum = "71cd15fef9112a1f94ac64b58d1e4628192631ad6af4dc69997f995459c874e7" dependencies = [ "bitflags 1.3.2", "bytemuck", "smallvec", - "ttf-parser 0.18.1", + "ttf-parser 0.19.2", "unicode-bidi-mirroring", "unicode-ccc", - "unicode-general-category", + "unicode-properties", "unicode-script", ] [[package]] name = "rustybuzz" -version = "0.8.0" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82eea22c8f56965eeaf3a209b3d24508256c7b920fb3b6211b8ba0f7c0583250" +checksum = "2ee8fe2a8461a0854a37101fe7a1b13998d0cfa987e43248e81d2a5f4570f6fa" dependencies = [ "bitflags 1.3.2", "bytemuck", "libm", "smallvec", - "ttf-parser 0.19.2", + "ttf-parser 0.20.0", "unicode-bidi-mirroring", "unicode-ccc", - "unicode-general-category", + "unicode-properties", "unicode-script", ] [[package]] name = "ryu" -version = "1.0.16" +version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f98d2aa92eebf49b69786be48e4477826b256916e84a57ff2a4f21923b48eb4c" +checksum = "e86697c916019a8588c99b5fac3cead74ec0b4b819707a682fd4d23fa0ce1ba1" [[package]] name = "same-file" @@ -3311,15 +3384,15 @@ dependencies = [ [[package]] name = "sctk-adwaita" -version = "0.5.4" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cda4e97be1fd174ccc2aae81c8b694e803fa99b34e8fd0f057a9d70698e3ed09" +checksum = "82b2eaf3a5b264a521b988b2e73042e742df700c4f962cde845d1541adb46550" dependencies = [ "ab_glyph", "log", - "memmap2 0.5.10", - "smithay-client-toolkit 0.16.1", - "tiny-skia 0.8.4", + "memmap2 0.9.4", + "smithay-client-toolkit", + "tiny-skia", ] [[package]] @@ -3345,37 +3418,43 @@ dependencies = [ "libc", ] +[[package]] +name = "self_cell" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "58bf37232d3bb9a2c4e641ca2a11d83b5062066f88df7fed36c28772046d65ba" + [[package]] name = "semver" -version = "1.0.21" +version = "1.0.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b97ed7a9823b74f99c7742f5336af7be5ecd3eeafcb1507d1fa93347b1d589b0" +checksum = "92d43fe69e652f3df9bdc2b85b2854a0825b86e4fb76bc44d945137d053639ca" [[package]] name = "serde" -version = "1.0.196" +version = "1.0.197" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "870026e60fa08c69f064aa766c10f10b1d62db9ccd4d0abb206472bee0ce3b32" +checksum = "3fb1c873e1b9b056a4dc4c0c198b24c3ffa059243875552b2bd0933b1aee4ce2" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.196" +version = "1.0.197" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33c85360c95e7d137454dc81d9a4ed2b8efd8fbe19cee57357b32b9771fccb67" +checksum = "7eb0b34b42edc17f6b7cac84a52a1c5f0e1bb2227e997ca9011ea3dd34e8610b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.50", ] [[package]] name = "serde_json" -version = "1.0.113" +version = "1.0.114" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69801b70b1c3dac963ecb03a364ba0ceda9cf60c71cfe475e99864759c8b8a79" +checksum = "c5f09b1bd632ef549eaa9f60a1f8de742bdbc698e6cee2095fc84dde5f549ae0" dependencies = [ "itoa", "ryu", @@ -3432,7 +3511,7 @@ checksum = "b93fb4adc70021ac1b47f7d45e8cc4169baaa7ea58483bc5b721d19a26202212" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.50", ] [[package]] @@ -3486,25 +3565,6 @@ version = "1.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e6ecd384b10a64542d77071bd64bd7b231f4ed5940fba55e98c3de13824cf3d7" -[[package]] -name = "smithay-client-toolkit" -version = "0.16.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "870427e30b8f2cbe64bf43ec4b86e88fe39b0a84b3f15efd9c9c2d020bc86eb9" -dependencies = [ - "bitflags 1.3.2", - "calloop 0.10.6", - "dlib", - "lazy_static", - "log", - "memmap2 0.5.10", - "nix 0.24.3", - "pkg-config", - "wayland-client 0.29.5", - "wayland-cursor 0.29.5", - "wayland-protocols 0.29.5", -] - [[package]] name = "smithay-client-toolkit" version = "0.18.1" @@ -3512,7 +3572,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "922fd3eeab3bd820d76537ce8f582b1cf951eceb5475c28500c7457d9d17f53a" dependencies = [ "bitflags 2.4.2", - "calloop 0.12.4", + "calloop", "calloop-wayland-source", "cursor-icon", "libc", @@ -3520,25 +3580,34 @@ dependencies = [ "memmap2 0.9.4", "rustix", "thiserror", - "wayland-backend 0.3.3", - "wayland-client 0.31.2", + "wayland-backend", + "wayland-client", "wayland-csd-frame", - "wayland-cursor 0.31.1", - "wayland-protocols 0.31.2", + "wayland-cursor", + "wayland-protocols", "wayland-protocols-wlr", - "wayland-scanner 0.31.1", + "wayland-scanner", "xkeysym", ] [[package]] name = "smithay-clipboard" -version = "0.7.0" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bb62b280ce5a5cba847669933a0948d00904cf83845c944eae96a4738cea1a6" +checksum = "c091e7354ea8059d6ad99eace06dd13ddeedbb0ac72d40a9a6e7ff790525882d" dependencies = [ "libc", - "smithay-client-toolkit 0.18.1", - "wayland-backend 0.3.3", + "smithay-client-toolkit", + "wayland-backend", +] + +[[package]] +name = "smol_str" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6845563ada680337a52d43bb0b29f396f2d911616f6573012645b9e3d048a49" +dependencies = [ + "serde", ] [[package]] @@ -3574,40 +3643,43 @@ dependencies = [ [[package]] name = "socket2" -version = "0.5.5" +version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b5fac59a5cb5dd637972e5fca70daf0523c9067fcdc4842f053dae04a18f8e9" +checksum = "05ffd9c0a93b7543e062e759284fcf5f5e3b098501104bfbdde4d404db792871" dependencies = [ "libc", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] name = "softbuffer" -version = "0.2.1" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2b953f6ba7285f0af131eb748aabd8ddaf53e0b81dda3ba5d803b0847d6559f" +checksum = "071916a85d1db274b4ed57af3a14afb66bd836ae7f82ebb6f1fd3455107830d9" dependencies = [ + "as-raw-xcb-connection", "bytemuck", - "cfg_aliases", + "cfg_aliases 0.2.0", "cocoa", "core-graphics", - "fastrand 1.9.0", - "foreign-types", + "drm", + "fastrand", + "foreign-types 0.5.0", + "js-sys", "log", - "nix 0.26.4", + "memmap2 0.9.4", "objc", - "raw-window-handle", - "redox_syscall 0.3.5", - "thiserror", + "raw-window-handle 0.6.0", + "redox_syscall 0.4.1", + "rustix", + "tiny-xlib", "wasm-bindgen", - "wayland-backend 0.1.2", - "wayland-client 0.30.2", - "wayland-sys 0.30.1", + "wayland-backend", + "wayland-client", + "wayland-sys", "web-sys", - "windows-sys 0.48.0", - "x11-dl", - "x11rb 0.11.1", + "windows-sys 0.52.0", + "x11rb", ] [[package]] @@ -3618,12 +3690,11 @@ checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" [[package]] name = "spirv" -version = "0.2.0+1.5.4" +version = "0.3.0+sdk-1.3.268.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "246bfa38fe3db3f1dfc8ca5a2cdeb7348c78be2112740cc0ec8ef18b6d94f830" +checksum = "eda41003dc44290527a59b13432d4a0379379fa074b70174882adfbdfd917844" dependencies = [ - "bitflags 1.3.2", - "num-traits", + "bitflags 2.4.2", ] [[package]] @@ -3638,12 +3709,6 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" -[[package]] -name = "str-buf" -version = "1.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e08d8363704e6c71fc928674353e6b7c23dcea9d82d7012c8faf2a3a025f8d0" - [[package]] name = "strict-num" version = "0.1.1" @@ -3661,11 +3726,11 @@ checksum = "8fb1df15f412ee2e9dfc1c504260fa695c1c3f10fe9f4a6ee2d2184d7d6450e2" [[package]] name = "svgtypes" -version = "0.11.0" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed4b0611e7f3277f68c0fa18e385d9e2d26923691379690039548f867cef02a7" +checksum = "d71499ff2d42f59d26edb21369a308ede691421f79ebc0f001e2b1fd3a7c9e52" dependencies = [ - "kurbo", + "kurbo 0.9.5", "siphasher", ] @@ -3743,9 +3808,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.48" +version = "2.0.50" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f" +checksum = "74f1bdc9872430ce9b75da68329d1c1746faf50ffac5f19e02b71e37ff881ffb" dependencies = [ "proc-macro2", "quote", @@ -3803,9 +3868,9 @@ dependencies = [ [[package]] name = "target-lexicon" -version = "0.12.13" +version = "0.12.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69758bda2e78f098e4ccb393021a0963bb3442eac05f135c30f61b7370bbafae" +checksum = "e1fc403891a21bcfb7c37834ba66a547a8f402146eba7265b5a6d88059c9ff2f" [[package]] name = "tempfile" @@ -3814,7 +3879,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a365e8cd18e44762ef95d87f284f4b5cd04107fec2ff3052bd6a3e6069669e67" dependencies = [ "cfg-if", - "fastrand 2.0.1", + "fastrand", "rustix", "windows-sys 0.52.0", ] @@ -3830,43 +3895,29 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.56" +version = "1.0.57" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d54378c645627613241d077a3a79db965db602882668f9136ac42af9ecb730ad" +checksum = "1e45bcbe8ed29775f228095caf2cd67af7a4ccf756ebff23a306bf3e8b47b24b" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.56" +version = "1.0.57" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa0faa943b50f3db30a20aa7e265dbc66076993efed8463e8de414e5d06d3471" +checksum = "a953cb265bef375dae3de6663da4d3804eee9682ea80d8e2542529b73c531c81" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", -] - -[[package]] -name = "tiny-skia" -version = "0.8.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df8493a203431061e901613751931f047d1971337153f96d0e5e363d6dbf6a67" -dependencies = [ - "arrayref", - "arrayvec", - "bytemuck", - "cfg-if", - "png", - "tiny-skia-path 0.8.4", + "syn 2.0.50", ] [[package]] name = "tiny-skia" -version = "0.10.0" +version = "0.11.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7db11798945fa5c3e5490c794ccca7c6de86d3afdd54b4eb324109939c6f37bc" +checksum = "83d13394d44dae3207b52a326c0c85a8bf87f1541f23b0d143811088497b09ab" dependencies = [ "arrayref", "arrayvec", @@ -3874,14 +3925,14 @@ dependencies = [ "cfg-if", "log", "png", - "tiny-skia-path 0.10.0", + "tiny-skia-path", ] [[package]] name = "tiny-skia-path" -version = "0.8.4" +version = "0.11.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adbfb5d3f3dd57a0e11d12f4f13d4ebbbc1b5c15b7ab0a156d030b21da5f677c" +checksum = "9c9e7fc0c2e86a30b117d0462aa261b72b7a99b7ebd7deb3a14ceda95c5bdc93" dependencies = [ "arrayref", "bytemuck", @@ -3889,14 +3940,15 @@ dependencies = [ ] [[package]] -name = "tiny-skia-path" -version = "0.10.0" +name = "tiny-xlib" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f60aa35c89ac2687ace1a2556eaaea68e8c0d47408a2e3e7f5c98a489e7281c" +checksum = "d4098d49269baa034a8d1eae9bd63e9fa532148d772121dace3bcd6a6c98eb6d" dependencies = [ - "arrayref", - "bytemuck", - "strict-num", + "as-raw-xcb-connection", + "ctor", + "libloading 0.8.1", + "tracing", ] [[package]] @@ -3982,7 +4034,7 @@ dependencies = [ "serde", "serde_spanned", "toml_datetime", - "toml_edit 0.22.4", + "toml_edit 0.22.6", ] [[package]] @@ -4000,22 +4052,33 @@ version = "0.19.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" dependencies = [ - "indexmap 2.2.2", + "indexmap", + "toml_datetime", + "winnow 0.5.40", +] + +[[package]] +name = "toml_edit" +version = "0.21.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a8534fd7f78b5405e860340ad6575217ce99f38d4d5c8f2442cb5ecb50090e1" +dependencies = [ + "indexmap", "toml_datetime", - "winnow", + "winnow 0.5.40", ] [[package]] name = "toml_edit" -version = "0.22.4" +version = "0.22.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c9ffdf896f8daaabf9b66ba8e77ea1ed5ed0f72821b398aba62352e95062951" +checksum = "2c1b5fd4128cc8d3e0cb74d4ed9a9cc7c7284becd4df68f5f940e1ad123606f6" dependencies = [ - "indexmap 2.2.2", + "indexmap", "serde", "serde_spanned", "toml_datetime", - "winnow", + "winnow 0.6.2", ] [[package]] @@ -4031,9 +4094,21 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" dependencies = [ "pin-project-lite", + "tracing-attributes", "tracing-core", ] +[[package]] +name = "tracing-attributes" +version = "0.1.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.50", +] + [[package]] name = "tracing-core" version = "0.1.32" @@ -4049,12 +4124,6 @@ version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" -[[package]] -name = "ttf-parser" -version = "0.18.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0609f771ad9c6155384897e1df4d948e692667cc0588548b68eb44d052b27633" - [[package]] name = "ttf-parser" version = "0.19.2" @@ -4067,17 +4136,6 @@ version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "17f77d76d837a7830fe1d4f12b7b4ba4192c1888001c7164257e4bc6d21d96b4" -[[package]] -name = "twox-hash" -version = "1.6.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97fee6b57c6a41524a810daee9286c02d7752c4253064d0b05472833a438f675" -dependencies = [ - "cfg-if", - "rand", - "static_assertions", -] - [[package]] name = "unicode-bidi" version = "0.3.15" @@ -4096,12 +4154,6 @@ version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cc2520efa644f8268dce4dcd3050eaa7fc044fca03961e9998ac7e2e92b77cf1" -[[package]] -name = "unicode-general-category" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2281c8c1d221438e373249e065ca4989c4c36952c211ff21a0ee91c44a3869e7" - [[package]] name = "unicode-ident" version = "1.0.12" @@ -4116,18 +4168,24 @@ checksum = "3b09c83c3c29d37506a3e260c08c03743a6bb66a9cd432c6934ab501a190571f" [[package]] name = "unicode-normalization" -version = "0.1.22" +version = "0.1.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" +checksum = "a56d1686db2308d901306f92a263857ef59ea39678a5458e7cb17f01415101f5" dependencies = [ "tinyvec", ] +[[package]] +name = "unicode-properties" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e4259d9d4425d9f0661581b804cb85fe66a4c631cadd8f490d1c13a35d5d9291" + [[package]] name = "unicode-script" -version = "0.5.5" +version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d817255e1bed6dfd4ca47258685d14d2bdcfbc64fdc9e3819bd5848057b8ecc" +checksum = "ad8d71f5726e5f285a935e9fe8edfd53f0491eb6e9a5774097fdabee7cd8c9cd" [[package]] name = "unicode-segmentation" @@ -4172,9 +4230,9 @@ dependencies = [ [[package]] name = "usvg" -version = "0.35.0" +version = "0.36.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14d09ddfb0d93bf84824c09336d32e42f80961a9d1680832eb24fdf249ce11e6" +checksum = "c51daa774fe9ee5efcf7b4fec13019b8119cda764d9a8b5b06df02bb1445c656" dependencies = [ "base64", "log", @@ -4187,14 +4245,14 @@ dependencies = [ [[package]] name = "usvg-parser" -version = "0.35.0" +version = "0.36.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d19bf93d230813599927d88557014e0908ecc3531666d47c634c6838bc8db408" +checksum = "45c88a5ffaa338f0e978ecf3d4e00d8f9f493e29bed0752e1a808a1db16afc40" dependencies = [ "data-url", "flate2", "imagesize", - "kurbo", + "kurbo 0.9.5", "log", "roxmltree 0.18.1", "simplecss", @@ -4205,14 +4263,14 @@ dependencies = [ [[package]] name = "usvg-text-layout" -version = "0.35.0" +version = "0.36.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "035044604e89652c0a2959b8b356946997a52649ba6cade45928c2842376feb4" +checksum = "4d2374378cb7a3fb8f33894e0fdb8625e1bbc4f25312db8d91f862130b541593" dependencies = [ "fontdb", - "kurbo", + "kurbo 0.9.5", "log", - "rustybuzz 0.7.0", + "rustybuzz 0.10.0", "unicode-bidi", "unicode-script", "unicode-vo", @@ -4221,14 +4279,14 @@ dependencies = [ [[package]] name = "usvg-tree" -version = "0.35.0" +version = "0.36.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7939a7e4ed21cadb5d311d6339730681c3e24c3e81d60065be80e485d3fc8b92" +checksum = "6cacb0c5edeaf3e80e5afcf5b0d4004cc1d36318befc9a7c6606507e5d0f4062" dependencies = [ "rctree", "strict-num", "svgtypes", - "tiny-skia-path 0.10.0", + "tiny-skia-path", ] [[package]] @@ -4237,12 +4295,6 @@ version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" -[[package]] -name = "vec_map" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191" - [[package]] name = "version-compare" version = "0.1.1" @@ -4301,7 +4353,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.50", "wasm-bindgen-shared", ] @@ -4335,7 +4387,7 @@ checksum = "642f325be6301eb8107a83d12a8ac6c1e1c54345a7ef1a9261962dfefda09e66" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.50", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -4361,21 +4413,6 @@ dependencies = [ "web-sys", ] -[[package]] -name = "wayland-backend" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41b48e27457e8da3b2260ac60d0a94512f5cba36448679f3747c0865b7893ed8" -dependencies = [ - "cc", - "downcast-rs", - "io-lifetimes", - "nix 0.26.4", - "scoped-tls", - "smallvec", - "wayland-sys 0.30.1", -] - [[package]] name = "wayland-backend" version = "0.3.3" @@ -4387,35 +4424,7 @@ dependencies = [ "rustix", "scoped-tls", "smallvec", - "wayland-sys 0.31.1", -] - -[[package]] -name = "wayland-client" -version = "0.29.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f3b068c05a039c9f755f881dc50f01732214f5685e379829759088967c46715" -dependencies = [ - "bitflags 1.3.2", - "downcast-rs", - "libc", - "nix 0.24.3", - "scoped-tls", - "wayland-commons", - "wayland-scanner 0.29.5", - "wayland-sys 0.29.5", -] - -[[package]] -name = "wayland-client" -version = "0.30.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "489c9654770f674fc7e266b3c579f4053d7551df0ceb392f153adb1f9ed06ac8" -dependencies = [ - "bitflags 1.3.2", - "nix 0.26.4", - "wayland-backend 0.1.2", - "wayland-scanner 0.30.1", + "wayland-sys", ] [[package]] @@ -4426,20 +4435,8 @@ checksum = "82fb96ee935c2cea6668ccb470fb7771f6215d1691746c2d896b447a00ad3f1f" dependencies = [ "bitflags 2.4.2", "rustix", - "wayland-backend 0.3.3", - "wayland-scanner 0.31.1", -] - -[[package]] -name = "wayland-commons" -version = "0.29.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8691f134d584a33a6606d9d717b95c4fa20065605f798a3f350d78dced02a902" -dependencies = [ - "nix 0.24.3", - "once_cell", - "smallvec", - "wayland-sys 0.29.5", + "wayland-backend", + "wayland-scanner", ] [[package]] @@ -4450,18 +4447,7 @@ checksum = "625c5029dbd43d25e6aa9615e88b829a5cad13b2819c4ae129fdbb7c31ab4c7e" dependencies = [ "bitflags 2.4.2", "cursor-icon", - "wayland-backend 0.3.3", -] - -[[package]] -name = "wayland-cursor" -version = "0.29.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6865c6b66f13d6257bef1cd40cbfe8ef2f150fb8ebbdb1e8e873455931377661" -dependencies = [ - "nix 0.24.3", - "wayland-client 0.29.5", - "xcursor", + "wayland-backend", ] [[package]] @@ -4471,22 +4457,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "71ce5fa868dd13d11a0d04c5e2e65726d0897be8de247c0c5a65886e283231ba" dependencies = [ "rustix", - "wayland-client 0.31.2", + "wayland-client", "xcursor", ] -[[package]] -name = "wayland-protocols" -version = "0.29.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b950621f9354b322ee817a23474e479b34be96c2e909c14f7bc0100e9a970bc6" -dependencies = [ - "bitflags 1.3.2", - "wayland-client 0.29.5", - "wayland-commons", - "wayland-scanner 0.29.5", -] - [[package]] name = "wayland-protocols" version = "0.31.2" @@ -4494,44 +4468,35 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f81f365b8b4a97f422ac0e8737c438024b5951734506b0e1d775c73030561f4" dependencies = [ "bitflags 2.4.2", - "wayland-backend 0.3.3", - "wayland-client 0.31.2", - "wayland-scanner 0.31.1", + "wayland-backend", + "wayland-client", + "wayland-scanner", ] [[package]] -name = "wayland-protocols-wlr" +name = "wayland-protocols-plasma" version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad1f61b76b6c2d8742e10f9ba5c3737f6530b4c243132c2a2ccc8aa96fe25cd6" +checksum = "23803551115ff9ea9bce586860c5c5a971e360825a0309264102a9495a5ff479" dependencies = [ "bitflags 2.4.2", - "wayland-backend 0.3.3", - "wayland-client 0.31.2", - "wayland-protocols 0.31.2", - "wayland-scanner 0.31.1", + "wayland-backend", + "wayland-client", + "wayland-protocols", + "wayland-scanner", ] [[package]] -name = "wayland-scanner" -version = "0.29.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f4303d8fa22ab852f789e75a967f0a2cdc430a607751c0499bada3e451cbd53" -dependencies = [ - "proc-macro2", - "quote", - "xml-rs", -] - -[[package]] -name = "wayland-scanner" -version = "0.30.1" +name = "wayland-protocols-wlr" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9b873b257fbc32ec909c0eb80dea312076a67014e65e245f5eb69a6b8ab330e" +checksum = "ad1f61b76b6c2d8742e10f9ba5c3737f6530b4c243132c2a2ccc8aa96fe25cd6" dependencies = [ - "proc-macro2", - "quick-xml 0.28.2", - "quote", + "bitflags 2.4.2", + "wayland-backend", + "wayland-client", + "wayland-protocols", + "wayland-scanner", ] [[package]] @@ -4541,50 +4506,37 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "63b3a62929287001986fb58c789dce9b67604a397c15c611ad9f747300b6c283" dependencies = [ "proc-macro2", - "quick-xml 0.31.0", + "quick-xml", "quote", ] [[package]] name = "wayland-sys" -version = "0.29.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be12ce1a3c39ec7dba25594b97b42cb3195d54953ddb9d3d95a7c3902bc6e9d4" -dependencies = [ - "dlib", - "lazy_static", - "pkg-config", -] - -[[package]] -name = "wayland-sys" -version = "0.30.1" +version = "0.31.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96b2a02ac608e07132978689a6f9bf4214949c85998c247abadd4f4129b1aa06" +checksum = "15a0c8eaff5216d07f226cb7a549159267f3467b289d9a2e52fd3ef5aae2b7af" dependencies = [ "dlib", - "lazy_static", "log", + "once_cell", "pkg-config", ] [[package]] -name = "wayland-sys" -version = "0.31.1" +name = "web-sys" +version = "0.3.67" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15a0c8eaff5216d07f226cb7a549159267f3467b289d9a2e52fd3ef5aae2b7af" +checksum = "58cd2333b6e0be7a39605f0e255892fd7418a682d8da8fe042fe25128794d2ed" dependencies = [ - "dlib", - "log", - "once_cell", - "pkg-config", + "js-sys", + "wasm-bindgen", ] [[package]] -name = "web-sys" -version = "0.3.68" +name = "web-time" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96565907687f7aceb35bc5fc03770a8a0471d82e479f25832f54a0e3f4b28446" +checksum = "aa30049b1c872b72c89866d458eae9f20380ab280ffd1b1e18df2d3e2d98cfe0" dependencies = [ "js-sys", "wasm-bindgen", @@ -4604,18 +4556,19 @@ checksum = "53a85b86a771b1c87058196170769dd264f66c0782acf1ae6cc51bfd64b39082" [[package]] name = "wgpu" -version = "0.16.3" +version = "0.19.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "480c965c9306872eb6255fa55e4b4953be55a8b64d57e61d7ff840d3dcc051cd" +checksum = "0bfe9a310dcf2e6b85f00c46059aaeaf4184caa8e29a1ecd4b7a704c3482332d" dependencies = [ "arrayvec", "cfg-if", + "cfg_aliases 0.1.1", "js-sys", "log", "naga", "parking_lot 0.12.1", "profiling", - "raw-window-handle", + "raw-window-handle 0.6.0", "smallvec", "static_assertions", "wasm-bindgen", @@ -4628,19 +4581,22 @@ dependencies = [ [[package]] name = "wgpu-core" -version = "0.16.1" +version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f478237b4bf0d5b70a39898a66fa67ca3a007d79f2520485b8b0c3dfc46f8c2" +checksum = "6b15e451d4060ada0d99a64df44e4d590213496da7c4f245572d51071e8e30ed" dependencies = [ "arrayvec", "bit-vec", "bitflags 2.4.2", + "cfg_aliases 0.1.1", "codespan-reporting", + "indexmap", "log", "naga", + "once_cell", "parking_lot 0.12.1", "profiling", - "raw-window-handle", + "raw-window-handle 0.6.0", "rustc-hash", "smallvec", "thiserror", @@ -4651,9 +4607,9 @@ dependencies = [ [[package]] name = "wgpu-hal" -version = "0.16.2" +version = "0.19.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ecb3258078e936deee14fd4e0febe1cfe9bbb5ffef165cb60218d2ee5eb4448" +checksum = "e3bb47856236bfafc0bc591a925eb036ac19cd987624a447ff353e7a7e7e6f72" dependencies = [ "android_system_properties", "arrayvec", @@ -4661,10 +4617,11 @@ dependencies = [ "bit-set", "bitflags 2.4.2", "block", + "cfg_aliases 0.1.1", "core-graphics-types", "d3d12", - "foreign-types", "glow", + "glutin_wgl_sys", "gpu-alloc", "gpu-allocator", "gpu-descriptor", @@ -4677,10 +4634,11 @@ dependencies = [ "metal", "naga", "objc", + "once_cell", "parking_lot 0.12.1", "profiling", "range-alloc", - "raw-window-handle", + "raw-window-handle 0.6.0", "renderdoc-sys", "rustc-hash", "smallvec", @@ -4693,9 +4651,9 @@ dependencies = [ [[package]] name = "wgpu-types" -version = "0.16.1" +version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0c153280bb108c2979eb5c7391cb18c56642dd3c072e55f52065e13e2a1252a" +checksum = "895fcbeb772bfb049eb80b2d6e47f6c9af235284e9703c96fc0218a42ffd5af2" dependencies = [ "bitflags 2.4.2", "js-sys", @@ -4733,15 +4691,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "winapi-wsapoll" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44c17110f57155602a80dca10be03852116403c9ff3cd25b079d666f2aa3df6e" -dependencies = [ - "winapi", -] - [[package]] name = "winapi-x86_64-pc-windows-gnu" version = "0.4.0" @@ -4750,34 +4699,35 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "window_clipboard" -version = "0.3.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "63287c9c4396ccf5346d035a9b0fcaead9e18377637f5eaa78b7ac65c873ff7d" +checksum = "f6d692d46038c433f9daee7ad8757e002a4248c20b0a3fbc991d99521d3bcb6d" dependencies = [ "clipboard-win", "clipboard_macos", "clipboard_wayland", "clipboard_x11", - "raw-window-handle", + "raw-window-handle 0.6.0", "thiserror", ] [[package]] name = "windows" -version = "0.44.0" +version = "0.46.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e745dab35a0c4c77aa3ce42d595e13d2003d6902d6b08c9ef5fc326d08da12b" +checksum = "cdacb41e6a96a052c6cb63a144f24900236121c6f63f4f8219fef5977ecb0c25" dependencies = [ "windows-targets 0.42.2", ] [[package]] name = "windows" -version = "0.46.0" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cdacb41e6a96a052c6cb63a144f24900236121c6f63f4f8219fef5977ecb0c25" +checksum = "e48a53791691ab099e5e2ad123536d0fff50652600abaf43bbf952894110d0be" dependencies = [ - "windows-targets 0.42.2", + "windows-core", + "windows-targets 0.52.3", ] [[package]] @@ -4786,7 +4736,7 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" dependencies = [ - "windows-targets 0.52.0", + "windows-targets 0.52.3", ] [[package]] @@ -4826,7 +4776,7 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "windows-targets 0.52.0", + "windows-targets 0.52.3", ] [[package]] @@ -4861,17 +4811,17 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.52.0" +version = "0.52.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a18201040b24831fbb9e4eb208f8892e1f50a37feb53cc7ff887feb8f50e7cd" +checksum = "d380ba1dc7187569a8a9e91ed34b8ccfc33123bbacb8c0aed2d1ad7f3ef2dc5f" dependencies = [ - "windows_aarch64_gnullvm 0.52.0", - "windows_aarch64_msvc 0.52.0", - "windows_i686_gnu 0.52.0", - "windows_i686_msvc 0.52.0", - "windows_x86_64_gnu 0.52.0", - "windows_x86_64_gnullvm 0.52.0", - "windows_x86_64_msvc 0.52.0", + "windows_aarch64_gnullvm 0.52.3", + "windows_aarch64_msvc 0.52.3", + "windows_i686_gnu 0.52.3", + "windows_i686_msvc 0.52.3", + "windows_x86_64_gnu 0.52.3", + "windows_x86_64_gnullvm 0.52.3", + "windows_x86_64_msvc 0.52.3", ] [[package]] @@ -4888,9 +4838,9 @@ checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_gnullvm" -version = "0.52.0" +version = "0.52.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb7764e35d4db8a7921e09562a0304bf2f93e0a51bfccee0bd0bb0b666b015ea" +checksum = "68e5dcfb9413f53afd9c8f86e56a7b4d86d9a2fa26090ea2dc9e40fba56c6ec6" [[package]] name = "windows_aarch64_msvc" @@ -4912,9 +4862,9 @@ checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_aarch64_msvc" -version = "0.52.0" +version = "0.52.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbaa0368d4f1d2aaefc55b6fcfee13f41544ddf36801e793edbbfd7d7df075ef" +checksum = "8dab469ebbc45798319e69eebf92308e541ce46760b49b18c6b3fe5e8965b30f" [[package]] name = "windows_i686_gnu" @@ -4936,9 +4886,9 @@ checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_gnu" -version = "0.52.0" +version = "0.52.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a28637cb1fa3560a16915793afb20081aba2c92ee8af57b4d5f28e4b3e7df313" +checksum = "2a4e9b6a7cac734a8b4138a4e1044eac3404d8326b6c0f939276560687a033fb" [[package]] name = "windows_i686_msvc" @@ -4960,9 +4910,9 @@ checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_i686_msvc" -version = "0.52.0" +version = "0.52.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffe5e8e31046ce6230cc7215707b816e339ff4d4d67c65dffa206fd0f7aa7b9a" +checksum = "28b0ec9c422ca95ff34a78755cfa6ad4a51371da2a5ace67500cf7ca5f232c58" [[package]] name = "windows_x86_64_gnu" @@ -4984,9 +4934,9 @@ checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnu" -version = "0.52.0" +version = "0.52.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d6fa32db2bc4a2f5abeacf2b69f7992cd09dca97498da74a151a3132c26befd" +checksum = "704131571ba93e89d7cd43482277d6632589b18ecf4468f591fbae0a8b101614" [[package]] name = "windows_x86_64_gnullvm" @@ -5002,9 +4952,9 @@ checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_gnullvm" -version = "0.52.0" +version = "0.52.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a657e1e9d3f514745a572a6846d3c7aa7dbe1658c056ed9c3344c4109a6949e" +checksum = "42079295511643151e98d61c38c0acc444e52dd42ab456f7ccfd5152e8ecf21c" [[package]] name = "windows_x86_64_msvc" @@ -5026,50 +4976,72 @@ checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "windows_x86_64_msvc" -version = "0.52.0" +version = "0.52.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" +checksum = "0770833d60a970638e989b3fa9fd2bb1aaadcf88963d1659fd7d9990196ed2d6" [[package]] name = "winit" -version = "0.28.7" +version = "0.29.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9596d90b45384f5281384ab204224876e8e8bf7d58366d9b795ad99aa9894b94" +checksum = "4c824f11941eeae66ec71111cc2674373c772f482b58939bb4066b642aa2ffcf" dependencies = [ + "ahash", "android-activity", - "bitflags 1.3.2", - "cfg_aliases", + "atomic-waker", + "bitflags 2.4.2", + "bytemuck", + "calloop", + "cfg_aliases 0.1.1", "core-foundation", "core-graphics", - "dispatch", - "instant", + "cursor-icon", + "icrate", + "js-sys", "libc", "log", - "mio", - "ndk", + "memmap2 0.9.4", + "ndk 0.8.0", + "ndk-sys 0.5.0+25.2.9519653", "objc2", "once_cell", "orbclient", "percent-encoding", - "raw-window-handle", + "raw-window-handle 0.6.0", "redox_syscall 0.3.5", + "rustix", "sctk-adwaita", - "smithay-client-toolkit 0.16.1", + "smithay-client-toolkit", + "smol_str", + "unicode-segmentation", "wasm-bindgen", - "wayland-client 0.29.5", - "wayland-commons", - "wayland-protocols 0.29.5", - "wayland-scanner 0.29.5", + "wasm-bindgen-futures", + "wayland-backend", + "wayland-client", + "wayland-protocols", + "wayland-protocols-plasma", "web-sys", - "windows-sys 0.45.0", + "web-time", + "windows-sys 0.48.0", "x11-dl", + "x11rb", + "xkbcommon-dl", +] + +[[package]] +name = "winnow" +version = "0.5.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f593a95398737aeed53e489c785df13f3618e41dbcd6718c6addbf1395aa6876" +dependencies = [ + "memchr", ] [[package]] name = "winnow" -version = "0.5.39" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5389a154b01683d28c77f8f68f49dea75f0a4da32557a58f68ee51ebba472d29" +checksum = "7a4191c47f15cc3ec71fcb4913cb83d58def65dd3787610213c649283b5ce178" dependencies = [ "memchr", ] @@ -5104,40 +5076,19 @@ dependencies = [ "pkg-config", ] -[[package]] -name = "x11rb" -version = "0.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cdf3c79412dd91bae7a7366b8ad1565a85e35dd049affc3a6a2c549e97419617" -dependencies = [ - "gethostname 0.2.3", - "libc", - "libloading 0.7.4", - "nix 0.25.1", - "once_cell", - "winapi", - "winapi-wsapoll", - "x11rb-protocol 0.11.1", -] - [[package]] name = "x11rb" version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f8f25ead8c7e4cba123243a6367da5d3990e0d3affa708ea19dce96356bd9f1a" dependencies = [ - "gethostname 0.4.3", + "as-raw-xcb-connection", + "gethostname", + "libc", + "libloading 0.8.1", + "once_cell", "rustix", - "x11rb-protocol 0.13.0", -] - -[[package]] -name = "x11rb-protocol" -version = "0.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0b1513b141123073ce54d5bb1d33f801f17508fbd61e02060b1214e96d39c56" -dependencies = [ - "nix 0.25.1", + "x11rb-protocol", ] [[package]] @@ -5152,6 +5103,19 @@ version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a0ccd7b4a5345edfcd0c3535718a4e9ff7798ffc536bb5b5a0e26ff84732911" +[[package]] +name = "xkbcommon-dl" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d039de8032a9a8856a6be89cea3e5d12fdd82306ab7c94d74e6deab2460651c5" +dependencies = [ + "bitflags 2.4.2", + "dlib", + "log", + "once_cell", + "xkeysym", +] + [[package]] name = "xkeysym" version = "0.2.0" @@ -5176,6 +5140,18 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec7a2a501ed189703dba8b08142f057e887dfc4b2cc4db2d343ac6376ba3e0b9" +[[package]] +name = "xxhash-rust" +version = "0.8.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "927da81e25be1e1a2901d59b81b37dd2efd1fc9c9345a55007f09bf5a2d3ee03" + +[[package]] +name = "yansi" +version = "1.0.0-rc.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1367295b8f788d371ce2dbc842c7b709c73ee1364d30351dd300ec2203b12377" + [[package]] name = "yazi" version = "0.1.6" @@ -5205,5 +5181,5 @@ checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.50", ] diff --git a/Cargo.toml b/Cargo.toml index 6f290342..86505799 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -41,8 +41,8 @@ pcap = "1.2.0" etherparse = "0.14.2" chrono = { version = "0.4.33", default_features = false, features = ["clock"] } plotters = { version = "0.3.5", default_features = false, features = ["area_series"] } -iced = { version = "0.10.0", features = ["tokio", "svg", "advanced", "lazy"] } -plotters-iced = "0.9.0" +iced = { version = "0.12.1", features = ["tokio", "svg", "advanced", "lazy"] } +plotters-iced = "0.10.0" maxminddb = "0.24.0" confy = "0.6.0" serde = { version = "1.0.196", default_features = false, features = ["derive"] } diff --git a/src/chart/types/traffic_chart.rs b/src/chart/types/traffic_chart.rs index a2c9d38a..d974269b 100644 --- a/src/chart/types/traffic_chart.rs +++ b/src/chart/types/traffic_chart.rs @@ -2,7 +2,7 @@ use iced::alignment::{Horizontal, Vertical}; use iced::widget::{Column, Container}; -use iced::{Element, Renderer}; +use iced::{Element, Renderer, Theme}; use plotters::prelude::*; use plotters_iced::{Chart, ChartBuilder, ChartWidget, DrawingBackend}; use splines::Spline; @@ -63,7 +63,7 @@ impl TrafficChart { } } - pub fn view(&self) -> Element> { + pub fn view(&self) -> Element { Container::new(Column::new().push(ChartWidget::new(self))) .align_x(Horizontal::Left) .align_y(Vertical::Bottom) diff --git a/src/configs/types/config_window.rs b/src/configs/types/config_window.rs index 73975b82..cde2b0f7 100644 --- a/src/configs/types/config_window.rs +++ b/src/configs/types/config_window.rs @@ -1,4 +1,5 @@ use iced::window::Position; +use iced::{Point, Size}; use serde::{Deserialize, Serialize}; #[cfg(not(test))] @@ -6,8 +7,8 @@ use crate::SNIFFNET_LOWERCASE; #[derive(Serialize, Deserialize, Copy, Clone, PartialEq, Debug)] pub struct ConfigWindow { - pub position: (i32, i32), - pub size: (u32, u32), + pub position: (f32, f32), + pub size: (f32, f32), } impl ConfigWindow { @@ -32,8 +33,8 @@ impl ConfigWindow { impl Default for ConfigWindow { fn default() -> Self { Self { - position: (0, 0), - size: (1190, 670), + position: (0.0, 0.0), + size: (1190.0, 670.0), } } } @@ -42,9 +43,25 @@ pub trait ToPosition { fn to_position(self) -> Position; } -impl ToPosition for (i32, i32) { +impl ToPosition for (f32, f32) { fn to_position(self) -> Position { - Position::Specific(self.0, self.1) + Position::Specific(Point { + x: self.0, + y: self.1, + }) + } +} + +pub trait ToSize { + fn to_size(self) -> Size; +} + +impl ToSize for (f32, f32) { + fn to_size(self) -> Size { + Size{ + width: self.0, + height: self.1 + } } } diff --git a/src/countries/country_utils.rs b/src/countries/country_utils.rs index ae99ee63..2a293522 100644 --- a/src/countries/country_utils.rs +++ b/src/countries/country_utils.rs @@ -1,8 +1,8 @@ use iced::widget::svg::Handle; use iced::widget::tooltip::Position; -use iced::widget::Svg; use iced::widget::Tooltip; -use iced::{Font, Length, Renderer}; +use iced::widget::{Svg, Text}; +use iced::{Font, Length, Renderer, Theme}; use crate::countries::flags_pictures::{ AD, AE, AF, AG, AI, AL, AM, AO, AQ, AR, AS, AT, AU, AW, AX, AZ, BA, BB, BD, BE, BF, BG, BH, BI, @@ -35,7 +35,7 @@ fn get_flag_from_country( is_loopback: bool, traffic_type: TrafficType, language: Language, -) -> (Svg>, String) { +) -> (Svg, String) { #![allow(clippy::too_many_lines)] let mut tooltip = country.to_string(); let mut svg_style = SvgType::Standard; @@ -322,7 +322,7 @@ pub fn get_flag_tooltip( host_info: &DataInfoHost, language: Language, font: Font, -) -> Tooltip<'static, Message, Renderer> { +) -> Tooltip<'static, Message, StyleType> { let is_local = host_info.is_local; let is_loopback = host_info.is_loopback; let traffic_type = host_info.traffic_type; @@ -335,10 +335,13 @@ pub fn get_flag_tooltip( language, ); - let mut tooltip = Tooltip::new(content, tooltip, Position::FollowCursor) - .font(font) - .snap_within_viewport(true) - .style(ContainerType::Tooltip); + let mut tooltip = Tooltip::new( + content, + Text::new(tooltip).font(font), + Position::FollowCursor, + ) + .snap_within_viewport(true) + .style(ContainerType::Tooltip); if width == FLAGS_WIDTH_SMALL { tooltip = tooltip.padding(3); @@ -353,7 +356,7 @@ pub fn get_computer_tooltip( traffic_type: TrafficType, language: Language, font: Font, -) -> Tooltip<'static, Message, Renderer> { +) -> Tooltip<'static, Message, StyleType> { let content = Svg::new(Handle::from_memory(Vec::from( match (is_my_address, is_local, traffic_type) { (true, _, _) => COMPUTER, @@ -375,8 +378,11 @@ pub fn get_computer_tooltip( (false, false, TrafficType::Unicast) => unknown_translation(language), }; - Tooltip::new(content, tooltip, Position::FollowCursor) - .font(font) - .snap_within_viewport(true) - .style(ContainerType::Tooltip) + Tooltip::new( + content, + Text::new(tooltip).font(font), + Position::FollowCursor, + ) + .snap_within_viewport(true) + .style(ContainerType::Tooltip) } diff --git a/src/gui/app.rs b/src/gui/app.rs index dd672c60..c04a3c96 100644 --- a/src/gui/app.rs +++ b/src/gui/app.rs @@ -4,11 +4,14 @@ use std::time::Duration; -use iced::keyboard::{Event, KeyCode, Modifiers}; +use iced::keyboard::key::Named; +use iced::keyboard::{Event, Key, Modifiers}; use iced::widget::Column; +use iced::window::Id; use iced::Event::{Keyboard, Window}; use iced::{ executor, font, subscription, window, Application, Command, Element, Renderer, Subscription, + Theme, }; use crate::gui::components::footer::footer; @@ -46,9 +49,9 @@ impl Application for Sniffer { ( flags, Command::batch(vec![ - font::load(SARASA_MONO_BOLD_BYTES).map(Message::FontLoaded), - font::load(SARASA_MONO_BYTES).map(Message::FontLoaded), - font::load(ICONS_BYTES).map(Message::FontLoaded), + // font::load(SARASA_MONO_BOLD_BYTES).map(Message::FontLoaded), + // font::load(SARASA_MONO_BYTES).map(Message::FontLoaded), + // font::load(ICONS_BYTES).map(Message::FontLoaded), ]), ) } @@ -61,7 +64,7 @@ impl Application for Sniffer { self.update(message) } - fn view(&self) -> Element> { + fn view(&self) -> Element { let ConfigSettings { style, language, @@ -130,37 +133,34 @@ impl Application for Sniffer { fn subscription(&self) -> Subscription { const NO_MODIFIER: Modifiers = Modifiers::empty(); - let window_events_subscription = subscription::events_with(|event, _| match event { - Window(window::Event::Focused) => Some(Message::WindowFocused), - Window(window::Event::Moved { x, y }) => Some(Message::WindowMoved(x, y)), - Window(window::Event::Resized { width, height }) => { - Some(Message::WindowResized(width, height)) + let window_events_subscription = iced::event::listen_with(|event, _| match event { + Window(Id::MAIN, window::Event::Focused) => Some(Message::WindowFocused), + Window(Id::MAIN, window::Event::Moved { x, y }) => Some(Message::WindowMoved(x as f32, y as f32)), + Window(Id::MAIN, window::Event::Resized { width, height }) => { + Some(Message::WindowResized(width as f32, height as f32)) } - Window(window::Event::CloseRequested) => Some(Message::CloseRequested), + Window(Id::MAIN, window::Event::CloseRequested) => Some(Message::CloseRequested), _ => None, }); - let hot_keys_subscription = subscription::events_with(|event, _| match event { - Keyboard(Event::KeyPressed { - key_code, - modifiers, - }) => match modifiers { - Modifiers::COMMAND => match key_code { - KeyCode::Q => Some(Message::CloseRequested), - KeyCode::Comma => Some(Message::OpenLastSettings), - KeyCode::Backspace => Some(Message::ResetButtonPressed), - KeyCode::D => Some(Message::CtrlDPressed), - KeyCode::Left => Some(Message::ArrowPressed(false)), - KeyCode::Right => Some(Message::ArrowPressed(true)), + let hot_keys_subscription = iced::event::listen_with(|event, _| match event { + Keyboard(Event::KeyPressed { key, modifiers, .. }) => match modifiers { + Modifiers::COMMAND => match key.as_ref() { + Key::Character("q") => Some(Message::CloseRequested), + Key::Character(",") => Some(Message::OpenLastSettings), + Key::Named(Named::Backspace) => Some(Message::ResetButtonPressed), + Key::Character("d") => Some(Message::CtrlDPressed), + Key::Named(Named::ArrowLeft) => Some(Message::ArrowPressed(false)), + Key::Named(Named::ArrowRight) => Some(Message::ArrowPressed(true)), _ => None, }, - Modifiers::SHIFT => match key_code { - KeyCode::Tab => Some(Message::SwitchPage(false)), + Modifiers::SHIFT => match key { + Key::Named(Named::Tab) => Some(Message::SwitchPage(false)), _ => None, }, - NO_MODIFIER => match key_code { - KeyCode::Enter => Some(Message::ReturnKeyPressed), - KeyCode::Escape => Some(Message::EscKeyPressed), - KeyCode::Tab => Some(Message::SwitchPage(true)), + NO_MODIFIER => match key { + Key::Named(Named::Enter) => Some(Message::ReturnKeyPressed), + Key::Named(Named::Backspace) => Some(Message::EscKeyPressed), + Key::Named(Named::Tab) => Some(Message::SwitchPage(true)), _ => None, }, _ => None, diff --git a/src/gui/components/button.rs b/src/gui/components/button.rs index ea3579ee..6610ae15 100644 --- a/src/gui/components/button.rs +++ b/src/gui/components/button.rs @@ -3,7 +3,7 @@ use iced::alignment::{Horizontal, Vertical}; use iced::widget::tooltip::Position; use iced::widget::{button, Text, Tooltip}; -use iced::{Font, Length, Renderer}; +use iced::{Font, Length, Renderer, Theme}; use crate::gui::styles::container::ContainerType; use crate::gui::types::message::Message; @@ -16,7 +16,7 @@ pub fn button_hide( message: Message, language: Language, font: Font, -) -> Tooltip<'static, Message, Renderer> { +) -> Tooltip<'static, Message, StyleType> { Tooltip::new( button( Text::new("×") @@ -29,11 +29,10 @@ pub fn button_hide( .height(Length::Fixed(20.0)) .width(Length::Fixed(20.0)) .on_press(message), - hide_translation(language), + Text::new(hide_translation(language)).font(font), Position::Right, ) .gap(5) - .font(font) .style(ContainerType::Tooltip) } @@ -44,7 +43,7 @@ pub fn button_open_file( font: Font, is_editable: bool, action: fn(String) -> Message, -) -> Tooltip<'static, Message, Renderer> { +) -> Tooltip<'static, Message, StyleType> { let mut tooltip_str = ""; let mut tooltip_style = ContainerType::Neutral; @@ -65,8 +64,7 @@ pub fn button_open_file( button = button.on_press(Message::OpenFile(old_file, file_info, action)); } - Tooltip::new(button, tooltip_str, Position::Right) + Tooltip::new(button, Text::new(tooltip_str).font(font), Position::Right) .gap(5) - .font(font) .style(tooltip_style) } diff --git a/src/gui/components/footer.rs b/src/gui/components/footer.rs index ade1ee71..c39976af 100644 --- a/src/gui/components/footer.rs +++ b/src/gui/components/footer.rs @@ -3,10 +3,10 @@ use std::sync::{Arc, Mutex}; use iced::alignment::{Horizontal, Vertical}; -use iced::widget::horizontal_space; use iced::widget::tooltip::Position; use iced::widget::{button, Container, Row, Text, Tooltip}; -use iced::{Alignment, Font, Length, Renderer}; +use iced::widget::{horizontal_space, Space}; +use iced::{Alignment, Font, Length, Renderer, Theme}; use crate::gui::styles::button::ButtonType; use crate::gui::styles::container::ContainerType; @@ -27,7 +27,7 @@ pub fn footer( font: Font, font_footer: Font, newer_release_available: &Arc>>, -) -> Container<'static, Message, Renderer> { +) -> Container<'static, Message, StyleType> { let release_details_row = get_release_details(language, font, font_footer, newer_release_available); @@ -56,7 +56,7 @@ pub fn footer( .style(ContainerType::Gradient(color_gradient)) } -fn get_button_website(font: Font) -> Tooltip<'static, Message, Renderer> { +fn get_button_website(font: Font) -> Tooltip<'static, Message, StyleType> { let content = button( Icon::Globe .to_text() @@ -68,12 +68,11 @@ fn get_button_website(font: Font) -> Tooltip<'static, Message, Renderer Tooltip<'static, Message, Renderer> { +fn get_button_github(font: Font) -> Tooltip<'static, Message, StyleType> { let content = button( Icon::GitHub .to_text() @@ -85,12 +84,11 @@ fn get_button_github(font: Font) -> Tooltip<'static, Message, Renderer Tooltip<'static, Message, Renderer> { +fn get_button_sponsor(font: Font) -> Tooltip<'static, Message, StyleType> { let content = button( Text::new('❤'.to_string()) .font(font) @@ -104,8 +102,7 @@ fn get_button_sponsor(font: Font) -> Tooltip<'static, Message, Renderer>>, -) -> Row<'static, Message, Renderer> { +) -> Row<'static, Message, StyleType> { let mut ret_val = Row::new() .align_items(Alignment::Center) .height(Length::Fill) @@ -141,13 +138,12 @@ fn get_release_details( .on_press(Message::OpenWebPage(WebPage::WebsiteDownload)); let tooltip = Tooltip::new( button, - new_version_available_translation(language), + Text::new(new_version_available_translation(language)).font(font), Position::Top, ) - .font(font) .style(ContainerType::Tooltip); ret_val = ret_val - .push(horizontal_space(Length::Fixed(10.0))) + .push(Space::with_width(Length::Fixed(10.0))) .push(tooltip); } else { // this is the latest release diff --git a/src/gui/components/header.rs b/src/gui/components/header.rs index d5b30f30..828cc0ea 100644 --- a/src/gui/components/header.rs +++ b/src/gui/components/header.rs @@ -3,9 +3,9 @@ use iced::alignment::{Horizontal, Vertical}; use iced::widget::text::LineHeight; use iced::widget::tooltip::Position; -use iced::widget::{button, Container, Row, Tooltip}; +use iced::widget::{button, Container, Row, Text, Tooltip}; use iced::Length::FillPortion; -use iced::{Alignment, Font, Length, Renderer}; +use iced::{Alignment, Font, Length, Renderer, Theme}; use crate::gui::pages::types::settings_page::SettingsPage; use crate::gui::styles::container::ContainerType; @@ -21,7 +21,7 @@ pub fn header( back_button: bool, language: Language, last_opened_setting: SettingsPage, -) -> Container<'static, Message, Renderer> { +) -> Container<'static, Message, StyleType> { let logo = Icon::Sniffnet .to_text() .horizontal_alignment(Horizontal::Center) @@ -58,10 +58,7 @@ pub fn header( .style(ContainerType::Gradient(color_gradient)) } -fn get_button_reset( - font: Font, - language: Language, -) -> Tooltip<'static, Message, Renderer> { +fn get_button_reset(font: Font, language: Language) -> Tooltip<'static, Message, StyleType> { let content = button( Icon::ArrowBack .to_text() @@ -76,11 +73,10 @@ fn get_button_reset( Tooltip::new( content, - quit_analysis_translation(language), + Text::new(quit_analysis_translation(language)).font(font), Position::Right, ) .gap(5) - .font(font) .style(ContainerType::Tooltip) } @@ -88,7 +84,7 @@ pub fn get_button_settings( font: Font, language: Language, open_overlay: SettingsPage, -) -> Tooltip<'static, Message, Renderer> { +) -> Tooltip<'static, Message, StyleType> { let content = button( Icon::Settings .to_text() @@ -101,8 +97,11 @@ pub fn get_button_settings( .width(Length::Fixed(60.0)) .on_press(Message::OpenSettings(open_overlay)); - Tooltip::new(content, settings_translation(language), Position::Left) - .gap(5) - .font(font) - .style(ContainerType::Tooltip) + Tooltip::new( + content, + Text::new(settings_translation(language)).font(font), + Position::Left, + ) + .gap(5) + .style(ContainerType::Tooltip) } diff --git a/src/gui/components/modal.rs b/src/gui/components/modal.rs index eb35b803..b4eb2bbe 100644 --- a/src/gui/components/modal.rs +++ b/src/gui/components/modal.rs @@ -4,10 +4,10 @@ use iced::advanced::renderer; use iced::advanced::widget::{self, Widget}; use iced::advanced::{self, Clipboard, Shell}; use iced::alignment::{Alignment, Horizontal, Vertical}; -use iced::widget::{button, horizontal_space, vertical_space, Column, Container, Row, Text}; +use iced::widget::{button, horizontal_space, Column, Container, Row, Space, Text}; use iced::{ - event, mouse, BorderRadius, Color, Element, Event, Font, Length, Point, Rectangle, Renderer, - Size, + event, mouse, Border, Color, Element, Event, Font, Length, Point, Rectangle, Renderer, Size, + Theme, Vector, }; use crate::gui::components::button::button_hide; @@ -27,7 +27,7 @@ pub fn get_exit_overlay( font: Font, font_headers: Font, language: Language, -) -> Container<'static, Message, Renderer> { +) -> Container<'static, Message, StyleType> { let row_buttons = confirm_button_row(language, font, Message::Reset); let content = Column::new() @@ -40,7 +40,7 @@ pub fn get_exit_overlay( language, quit_analysis_translation(language), )) - .push(vertical_space(Length::Fixed(20.0))) + .push(Space::with_height(Length::Fixed(20.0))) .push( ask_quit_translation(language) .horizontal_alignment(Horizontal::Center) @@ -59,7 +59,7 @@ pub fn get_clear_all_overlay( font: Font, font_headers: Font, language: Language, -) -> Container<'static, Message, Renderer> { +) -> Container<'static, Message, StyleType> { let row_buttons = confirm_button_row(language, font, Message::ClearAllNotifications); let content = Column::new() @@ -72,7 +72,7 @@ pub fn get_clear_all_overlay( language, clear_all_translation(language), )) - .push(vertical_space(Length::Fixed(20.0))) + .push(Space::with_height(Length::Fixed(20.0))) .push( ask_clear_all_translation(language) .horizontal_alignment(Horizontal::Center) @@ -92,10 +92,10 @@ fn get_modal_header( color_gradient: GradientType, language: Language, title: String, -) -> Container<'static, Message, Renderer> { +) -> Container<'static, Message, StyleType> { Container::new( Row::new() - .push(horizontal_space(Length::FillPortion(1))) + .push(Space::with_width(Length::FillPortion(1))) .push( Text::new(title) .font(font_headers) @@ -120,7 +120,7 @@ fn confirm_button_row( language: Language, font: Font, message: Message, -) -> Row<'static, Message, Renderer> { +) -> Row<'static, Message, StyleType> { Row::new() .height(Length::Fill) .align_items(Alignment::Center) @@ -140,18 +140,17 @@ fn confirm_button_row( } /// A widget that centers a modal element over some base element -pub struct Modal<'a, Message, Renderer> { - base: Element<'a, Message, Renderer>, - #[allow(clippy::struct_field_names)] - modal: Element<'a, Message, Renderer>, +pub struct Modal<'a, Message, Theme, Renderer> { + base: Element<'a, Message, Theme, Renderer>, + modal: Element<'a, Message, Theme, Renderer>, on_blur: Option, } -impl<'a, Message, Renderer> Modal<'a, Message, Renderer> { +impl<'a, Message, Theme, Renderer> Modal<'a, Message, Theme, Renderer> { /// Returns a new [`Modal`] pub fn new( - base: impl Into>, - modal: impl Into>, + base: impl Into>, + modal: impl Into>, ) -> Self { Self { base: base.into(), @@ -170,7 +169,8 @@ impl<'a, Message, Renderer> Modal<'a, Message, Renderer> { } } -impl<'a, Message, Renderer> Widget for Modal<'a, Message, Renderer> +impl<'a, Message, Theme, Renderer> Widget + for Modal<'a, Message, Theme, Renderer> where Renderer: advanced::Renderer, Message: Clone, @@ -186,16 +186,19 @@ where tree.diff_children(&[&self.base, &self.modal]); } - fn width(&self) -> Length { - self.base.as_widget().width() + fn size(&self) -> Size { + self.base.as_widget().size() } - fn height(&self) -> Length { - self.base.as_widget().height() - } - - fn layout(&self, renderer: &Renderer, limits: &layout::Limits) -> layout::Node { - self.base.as_widget().layout(renderer, limits) + fn layout( + &self, + tree: &mut widget::Tree, + renderer: &Renderer, + limits: &layout::Limits, + ) -> layout::Node { + self.base + .as_widget() + .layout(&mut tree.children[0], renderer, limits) } fn on_event( @@ -225,7 +228,7 @@ where &self, state: &widget::Tree, renderer: &mut Renderer, - theme: &::Theme, + theme: &Theme, style: &renderer::Style, layout: Layout<'_>, cursor: mouse::Cursor, @@ -247,16 +250,15 @@ where state: &'b mut widget::Tree, layout: Layout<'_>, _renderer: &Renderer, - ) -> Option> { - Some(overlay::Element::new( - layout.position(), - Box::new(Overlay { - content: &mut self.modal, - tree: &mut state.children[1], - size: layout.bounds().size(), - on_blur: self.on_blur.clone(), - }), - )) + translation: Vector, + ) -> Option> { + Some(overlay::Element::new(Box::new(Overlay { + position: layout.position() + translation, + content: &mut self.modal, + tree: &mut state.children[1], + size: layout.bounds().size(), + on_blur: self.on_blur.clone(), + }))) } fn mouse_interaction( @@ -289,31 +291,32 @@ where } } -struct Overlay<'a, 'b, Message, Renderer> { - content: &'b mut Element<'a, Message, Renderer>, +struct Overlay<'a, 'b, Message, Theme, Renderer> { + position: Point, + content: &'b mut Element<'a, Message, Theme, Renderer>, tree: &'b mut widget::Tree, size: Size, on_blur: Option, } -impl<'a, 'b, Message, Renderer> overlay::Overlay - for Overlay<'a, 'b, Message, Renderer> +impl<'a, 'b, Message, Theme, Renderer> overlay::Overlay + for Overlay<'a, 'b, Message, Theme, Renderer> where Renderer: advanced::Renderer, Message: Clone, { - fn layout(&self, renderer: &Renderer, _bounds: Size, position: Point) -> layout::Node { + fn layout(&mut self, renderer: &Renderer, _bounds: Size) -> layout::Node { let limits = layout::Limits::new(Size::ZERO, self.size) .width(Length::Fill) .height(Length::Fill); - let mut child = self.content.as_widget().layout(renderer, &limits); - child.align(Alignment::Center, Alignment::Center, limits.max()); - - let mut node = layout::Node::with_children(self.size, vec![child]); - node.move_to(position); + let child = self + .content + .as_widget() + .layout(self.tree, renderer, &limits) + .align(Alignment::Center, Alignment::Center, limits.max()); - node + layout::Node::with_children(self.size, vec![child]).move_to(self.position) } fn on_event( @@ -351,7 +354,7 @@ where fn draw( &self, renderer: &mut Renderer, - theme: &Renderer::Theme, + theme: &Theme, style: &renderer::Style, layout: Layout<'_>, cursor: mouse::Cursor, @@ -359,9 +362,7 @@ where renderer.fill_quad( renderer::Quad { bounds: layout.bounds(), - border_radius: BorderRadius::default(), - border_width: 0.0, - border_color: Color::TRANSPARENT, + ..renderer::Quad::default() }, Color { a: 0.80, @@ -414,19 +415,24 @@ where &'c mut self, layout: Layout<'_>, renderer: &Renderer, - ) -> Option> { - self.content - .as_widget_mut() - .overlay(self.tree, layout.children().next().unwrap(), renderer) + ) -> Option> { + self.content.as_widget_mut().overlay( + self.tree, + layout.children().next().unwrap(), + renderer, + Vector::ZERO, + ) } } -impl<'a, Message, Renderer> From> for Element<'a, Message, Renderer> +impl<'a, Message, Theme, Renderer> From> + for Element<'a, Message, Theme, Renderer> where - Renderer: 'a + advanced::Renderer, + Theme: 'a, Message: 'a + Clone, + Renderer: 'a + advanced::Renderer, { - fn from(modal: Modal<'a, Message, Renderer>) -> Self { + fn from(modal: Modal<'a, Message, Theme, Renderer>) -> Self { Element::new(modal) } } diff --git a/src/gui/components/tab.rs b/src/gui/components/tab.rs index 12168141..6334f901 100644 --- a/src/gui/components/tab.rs +++ b/src/gui/components/tab.rs @@ -1,8 +1,8 @@ //! Tab buttons to be used in the various pages just under the header use iced::alignment::Vertical; -use iced::widget::{button, horizontal_space, Button, Container, Row, Text}; -use iced::{alignment, Alignment, Font, Length, Renderer}; +use iced::widget::{button, horizontal_space, Button, Container, Row, Space, Text}; +use iced::{alignment, Alignment, Font, Length, Renderer, Theme}; use crate::gui::pages::types::settings_page::SettingsPage; use crate::gui::styles::button::ButtonType; @@ -16,7 +16,7 @@ pub fn get_settings_tabs( active: SettingsPage, font: Font, language: Language, -) -> Row<'static, Message, Renderer> { +) -> Row<'static, Message, StyleType> { let mut tabs = Row::new() .width(Length::Fill) .align_items(Alignment::Start) @@ -36,7 +36,7 @@ pub fn get_pages_tabs( font_headers: Font, language: Language, unread_notifications: usize, -) -> Row<'static, Message, Renderer> { +) -> Row<'static, Message, StyleType> { let mut tabs = Row::new() .width(Length::Fill) .align_items(Alignment::Start) @@ -69,10 +69,10 @@ fn new_page_tab( font: Font, font_headers: Font, unread: Option, -) -> Button<'static, Message, Renderer> { +) -> Button<'static, Message, StyleType> { let mut content = Row::new() .align_items(Alignment::Center) - .push(horizontal_space(Length::FillPortion(1))) + .push(Space::with_width(Length::FillPortion(1))) .push( page.icon() .size(15) @@ -84,7 +84,7 @@ fn new_page_tab( .horizontal_alignment(alignment::Horizontal::Center) .vertical_alignment(alignment::Vertical::Center), ) - .push(horizontal_space(10)) + .push(Space::with_width(10)) .push( Text::new(page.get_tab_label(language).to_string()) .font(font) @@ -107,12 +107,12 @@ fn new_page_tab( .height(Length::Fixed(20.0)) .style(ContainerType::Highlighted); content = content - .push(horizontal_space(Length::Fixed(7.0))) + .push(Space::with_width(Length::Fixed(7.0))) .push(notifications_badge); } } - content = content.push(horizontal_space(Length::FillPortion(1))); + content = content.push(Space::with_width(Length::FillPortion(1))); button(content) .height(Length::Fixed(if active { 35.0 } else { 30.0 })) @@ -131,10 +131,10 @@ fn new_settings_tab( active: bool, language: Language, font: Font, -) -> Button<'static, Message, Renderer> { +) -> Button<'static, Message, StyleType> { let content = Row::new() .align_items(Alignment::Center) - .push(horizontal_space(Length::FillPortion(1))) + .push(Space::with_width(Length::FillPortion(1))) .push( page.icon() .size(15) @@ -146,7 +146,7 @@ fn new_settings_tab( .horizontal_alignment(alignment::Horizontal::Center) .vertical_alignment(alignment::Vertical::Center), ) - .push(horizontal_space(10)) + .push(Space::with_width(10)) .push( Text::new(page.get_tab_label(language).to_string()) .font(font) @@ -159,7 +159,7 @@ fn new_settings_tab( .horizontal_alignment(alignment::Horizontal::Center) .vertical_alignment(alignment::Vertical::Center), ) - .push(horizontal_space(Length::FillPortion(1))); + .push(Space::with_width(Length::FillPortion(1))); button(content) .height(Length::Fixed(if active { 35.0 } else { 30.0 })) diff --git a/src/gui/pages/connection_details_page.rs b/src/gui/pages/connection_details_page.rs index ee9c67d1..5c345135 100644 --- a/src/gui/pages/connection_details_page.rs +++ b/src/gui/pages/connection_details_page.rs @@ -3,10 +3,10 @@ use std::net::IpAddr; use iced::alignment::{Horizontal, Vertical}; use iced::widget::scrollable::Direction; use iced::widget::tooltip::Position; -use iced::widget::{button, horizontal_space, lazy, vertical_space, Rule, Scrollable}; +use iced::widget::{button, lazy, Rule, Scrollable, Space}; use iced::widget::{Column, Container, Row, Text, Tooltip}; use iced::Length::Fixed; -use iced::{Alignment, Font, Length, Renderer}; +use iced::{Alignment, Font, Length, Renderer, Theme}; use crate::countries::country_utils::{get_computer_tooltip, get_flag_tooltip}; use crate::countries::flags_pictures::FLAGS_WIDTH_BIG; @@ -45,7 +45,7 @@ use crate::{ByteMultiple, ConfigSettings, Language, Protocol, Sniffer, StyleType pub fn connection_details_page( sniffer: &Sniffer, key: AddressPortPair, -) -> Container> { +) -> Container { Container::new(lazy( ( sniffer.runtime_data.tot_out_packets + sniffer.runtime_data.tot_in_packets, @@ -59,7 +59,7 @@ pub fn connection_details_page( fn page_content( sniffer: &Sniffer, key: &AddressPortPair, -) -> Container<'static, Message, Renderer> { +) -> Container<'static, Message, StyleType> { let ConfigSettings { style, language, @@ -159,10 +159,10 @@ fn page_header( font_headers: Font, color_gradient: GradientType, language: Language, -) -> Container<'static, Message, Renderer> { +) -> Container<'static, Message, StyleType> { Container::new( Row::new() - .push(horizontal_space(Length::FillPortion(1))) + .push(Space::with_width(Length::FillPortion(1))) .push( Text::new(connection_details_translation(language)) .font(font_headers) @@ -188,14 +188,14 @@ fn col_info( val: &InfoAddressPortPair, font: Font, language: Language, -) -> Column<'static, Message, Renderer> { +) -> Column<'static, Message, StyleType> { let is_icmp = key.protocol.eq(&Protocol::ICMP); let mut ret_val = Column::new() .spacing(10) .padding([20, 10, 20, 40]) .width(Length::FillPortion(2)) - .push(vertical_space(Length::FillPortion(1))) + .push(Space::with_height(Length::FillPortion(1))) .push( Row::new().spacing(5).push(Icon::Clock.to_text()).push( Text::new(format!( @@ -260,7 +260,7 @@ fn col_info( ); } - ret_val = ret_val.push(vertical_space(Length::FillPortion(1))); + ret_val = ret_val.push(Space::with_height(Length::FillPortion(1))); ret_val } @@ -270,7 +270,7 @@ fn get_host_info_col( host: &Host, font: Font, language: Language, -) -> Column<'static, Message, Renderer> { +) -> Column<'static, Message, StyleType> { let mut host_info_col = Column::new().spacing(4); if r_dns.parse::().is_err() || (!host.asn.name.is_empty() && host.asn.number > 0) { host_info_col = host_info_col.push(Rule::horizontal(10.0)); @@ -296,7 +296,7 @@ fn get_local_tooltip( sniffer: &Sniffer, address_to_lookup: &str, key: &AddressPortPair, -) -> Tooltip<'static, Message, Renderer> { +) -> Tooltip<'static, Message, StyleType> { let ConfigSettings { style, language, .. } = sniffer.configs.lock().unwrap().settings; @@ -325,14 +325,14 @@ fn get_local_tooltip( } fn get_src_or_dest_col( - caption: Row<'static, Message, Renderer>, + caption: Row<'static, Message, StyleType>, ip: &String, port: Option, mac: &Option, font: Font, language: Language, timing_events: &TimingEvents, -) -> Column<'static, Message, Renderer> { +) -> Column<'static, Message, StyleType> { let address_caption = if port.is_some() { socket_address_translation(language) } else { @@ -368,10 +368,10 @@ fn get_src_or_dest_col( } fn assemble_widgets( - col_info: Column<'static, Message, Renderer>, - source_col: Column<'static, Message, Renderer>, - dest_col: Column<'static, Message, Renderer>, -) -> Row<'static, Message, Renderer> { + col_info: Column<'static, Message, StyleType>, + source_col: Column<'static, Message, StyleType>, + dest_col: Column<'static, Message, StyleType>, +) -> Row<'static, Message, StyleType> { let [source_container, dest_container] = [source_col, dest_col].map(|col| { Container::new(col) .padding(7) @@ -390,11 +390,11 @@ fn assemble_widgets( .width(Length::FillPortion(3)) .align_items(Alignment::Center) .spacing(5) - .push(vertical_space(Length::FillPortion(1))) + .push(Space::with_height(Length::FillPortion(1))) .push(source_container) .push(Icon::ArrowsDown.to_text()) .push(dest_container) - .push(vertical_space(Length::FillPortion(1))), + .push(Space::with_height(Length::FillPortion(1))), ) } @@ -403,7 +403,7 @@ fn get_button_copy( font: Font, string: &String, timing_events: &TimingEvents, -) -> Tooltip<'static, Message, Renderer> { +) -> Tooltip<'static, Message, StyleType> { let icon = if timing_events.was_just_copy_ip(string) { Text::new("✔").font(font).size(14) } else { @@ -421,10 +421,9 @@ fn get_button_copy( Tooltip::new( content, - format!("{} (IP)", copy_translation(language)), + Text::new(format!("{} (IP)", copy_translation(language))).font(font), Position::Right, ) .gap(5) - .font(font) .style(ContainerType::Tooltip) } diff --git a/src/gui/pages/initial_page.rs b/src/gui/pages/initial_page.rs index c83ab884..a4b78aa3 100644 --- a/src/gui/pages/initial_page.rs +++ b/src/gui/pages/initial_page.rs @@ -8,11 +8,10 @@ use iced::alignment::{Horizontal, Vertical}; use iced::widget::scrollable::Direction; use iced::widget::tooltip::Position; use iced::widget::{ - button, horizontal_space, vertical_space, Button, Column, Container, Row, Rule, Scrollable, - Text, TextInput, Tooltip, + button, Button, Column, Container, Row, Rule, Scrollable, Space, Text, TextInput, Tooltip, }; use iced::Length::FillPortion; -use iced::{alignment, Font, Length, Renderer}; +use iced::{alignment, Font, Length, Renderer, Theme}; use pcap::Device; use crate::gui::styles::button::ButtonType; @@ -37,7 +36,7 @@ use crate::utils::types::icon::Icon; use crate::{ConfigSettings, IpVersion, Language, Protocol, StyleType}; /// Computes the body of gui initial page -pub fn initial_page(sniffer: &Sniffer) -> Container> { +pub fn initial_page(sniffer: &Sniffer) -> Container { let ConfigSettings { style, language, @@ -96,12 +95,14 @@ pub fn initial_page(sniffer: &Sniffer) -> Container .align_x(Horizontal::Center), ); - let body = Column::new().push(vertical_space(Length::Fixed(5.0))).push( - Row::new() - .push(col_adapter) - .push(horizontal_space(Length::Fixed(30.0))) - .push(filters_pane), - ); + let body = Column::new() + .push(Space::with_height(Length::Fixed(5.0))) + .push( + Row::new() + .push(col_adapter) + .push(Space::with_width(Length::Fixed(30.0))) + .push(filters_pane), + ); Container::new(body).height(Length::Fill) } @@ -110,7 +111,7 @@ fn col_ip_buttons( active_ip_filters: &HashSet, font: Font, language: Language, -) -> Column<'static, Message, Renderer> { +) -> Column<'static, Message, StyleType> { let mut buttons_row = Row::new().spacing(5).padding([0, 0, 0, 5]); for option in IpVersion::ALL { let is_active = active_ip_filters.contains(&option); @@ -149,7 +150,7 @@ fn col_protocol_buttons( active_protocol_filters: &HashSet, font: Font, language: Language, -) -> Column<'static, Message, Renderer> { +) -> Column<'static, Message, StyleType> { let mut buttons_row = Row::new().spacing(5).padding([0, 0, 0, 5]); for option in Protocol::ALL { let is_active = active_protocol_filters.contains(&option); @@ -189,7 +190,7 @@ fn col_address_input( value: &str, font: Font, language: Language, -) -> Column<'static, Message, Renderer> { +) -> Column<'static, Message, StyleType> { let is_error = if value.is_empty() { false } else { @@ -224,7 +225,7 @@ fn col_port_input( value: &str, font: Font, language: Language, -) -> Column<'static, Message, Renderer> { +) -> Column<'static, Message, StyleType> { let is_error = if value.is_empty() { false } else { @@ -260,7 +261,7 @@ fn button_start( language: Language, color_gradient: GradientType, filters: &Filters, -) -> Tooltip<'static, Message, Renderer> { +) -> Tooltip<'static, Message, StyleType> { let mut content = button( Icon::Rocket .to_text() @@ -284,13 +285,12 @@ fn button_start( position = Position::FollowCursor; } - Tooltip::new(content, tooltip, position) + Tooltip::new(content, Text::new(tooltip).font(font), position) .gap(5) - .font(font) .style(ContainerType::Tooltip) } -fn get_col_adapter(sniffer: &Sniffer, font: Font) -> Column> { +fn get_col_adapter(sniffer: &Sniffer, font: Font) -> Column { let ConfigSettings { language, .. } = sniffer.configs.lock().unwrap().settings; let mut dev_str_list = vec![]; diff --git a/src/gui/pages/inspect_page.rs b/src/gui/pages/inspect_page.rs index 32b4f3e2..1b127e1b 100644 --- a/src/gui/pages/inspect_page.rs +++ b/src/gui/pages/inspect_page.rs @@ -4,9 +4,9 @@ use iced::alignment::{Horizontal, Vertical}; use iced::widget::scrollable::Direction; use iced::widget::text_input::Side; use iced::widget::tooltip::Position; -use iced::widget::{button, horizontal_space, text_input, vertical_space, Rule, Toggler, Tooltip}; +use iced::widget::{button, text_input, Rule, Space, Toggler, Tooltip}; use iced::widget::{lazy, Button, Column, Container, Row, Scrollable, Text, TextInput}; -use iced::{alignment, Alignment, Font, Length, Renderer}; +use iced::{alignment, Alignment, Font, Length, Pixels, Renderer, Theme}; use crate::gui::components::tab::get_pages_tabs; use crate::gui::components::types::my_modal::MyModal; @@ -32,7 +32,7 @@ use crate::utils::types::icon::Icon; use crate::{ConfigSettings, Language, ReportSortType, RunningPage, Sniffer, StyleType}; /// Computes the body of gui inspect page -pub fn inspect_page(sniffer: &Sniffer) -> Container> { +pub fn inspect_page(sniffer: &Sniffer) -> Container { let ConfigSettings { style, language, .. } = sniffer.configs.lock().unwrap().settings; @@ -79,7 +79,7 @@ pub fn inspect_page(sniffer: &Sniffer) -> Container font, sniffer.report_sort_type, )) - .push(vertical_space(4)) + .push(Space::with_height(4)) .push(Rule::horizontal(5)) .push(report); @@ -101,7 +101,7 @@ pub fn inspect_page(sniffer: &Sniffer) -> Container Container::new(Column::new().push(tab_and_body.push(body))).height(Length::Fill) } -fn lazy_report(sniffer: &Sniffer) -> Column<'static, Message, Renderer> { +fn lazy_report(sniffer: &Sniffer) -> Column<'static, Message, StyleType> { let ConfigSettings { style, language, .. } = sniffer.configs.lock().unwrap().settings; @@ -151,11 +151,11 @@ fn lazy_report(sniffer: &Sniffer) -> Column<'static, Message, Renderer Row<'static, Message, Renderer> { +) -> Row<'static, Message, StyleType> { let mut ret_val = Row::new().padding([0, 2]).align_items(Alignment::Center); for report_col in ReportCol::ALL { let (title_display, title_small_display, tooltip_val) = @@ -185,9 +185,12 @@ fn report_header_row( } else { ContainerType::Tooltip }; - let title_tooltip = Tooltip::new(title_row, tooltip_val, Position::FollowCursor) - .font(font) - .style(tooltip_style); + let title_tooltip = Tooltip::new( + title_row, + Text::new(tooltip_val).font(font), + Position::FollowCursor, + ) + .style(tooltip_style); let mut col_header = Column::new() .align_items(Alignment::Center) @@ -250,7 +253,7 @@ fn title_report_col_display( fn sort_arrows( active_sort_type: ReportSortType, report_col: &ReportCol, -) -> Container<'static, Message, Renderer> { +) -> Container<'static, Message, StyleType> { Container::new( button( active_sort_type @@ -271,7 +274,7 @@ fn row_report_entry( key: &AddressPortPair, val: &InfoAddressPortPair, font: Font, -) -> Row<'static, Message, Renderer> { +) -> Row<'static, Message, StyleType> { let text_type = if val.traffic_direction == TrafficDirection::Outgoing { TextType::Outgoing } else { @@ -304,7 +307,7 @@ fn host_filters_col( search_params: &SearchParameters, font: Font, language: Language, -) -> Column<'static, Message, Renderer> { +) -> Column<'static, Message, StyleType> { let search_params2 = search_params.clone(); let mut title_row = Row::new().spacing(10).align_items(Alignment::Center).push( @@ -378,7 +381,7 @@ fn host_filters_col( Column::new() .align_items(Alignment::Start) .push(title_row) - .push(vertical_space(10)) + .push(Space::with_height(10)) .push( Row::new() .align_items(Alignment::Center) @@ -392,7 +395,7 @@ fn filter_input( filter_input_type: FilterInputType, search_params: SearchParameters, font: Font, -) -> Container<'static, Message, Renderer> { +) -> Container<'static, Message, StyleType> { let filter_value = filter_input_type.current_value(&search_params); let is_filter_active = !filter_value.is_empty(); @@ -416,7 +419,7 @@ fn filter_input( input = input.icon(text_input::Icon { font: ICONS, code_point: Icon::Funnel.codepoint(), - size: Some(12.0), + size: Some(Pixels(12.0)), spacing: 2.0, side: Side::Left, }); @@ -444,7 +447,7 @@ fn filter_input( }) } -fn get_button_change_page(increment: bool) -> Button<'static, Message, Renderer> { +fn get_button_change_page(increment: bool) -> Button<'static, Message, StyleType> { button( if increment { Icon::ArrowRight @@ -469,16 +472,16 @@ fn get_change_page_row( start_entry_num: usize, end_entry_num: usize, results_number: usize, -) -> Row<'static, Message, Renderer> { +) -> Row<'static, Message, StyleType> { Row::new() .height(Length::Fixed(40.0)) .align_items(Alignment::Center) .spacing(10) - .push(horizontal_space(Length::Fill)) + .push(Space::with_width(Length::Fill)) .push(if page_number > 1 { Container::new(get_button_change_page(false).width(25.0)) } else { - Container::new(horizontal_space(25.0)) + Container::new(Space::with_width(25.0)) }) .push( Text::new(showing_results_translation( @@ -492,15 +495,15 @@ fn get_change_page_row( .push(if page_number < (results_number + 20 - 1) / 20 { Container::new(get_button_change_page(true).width(25.0)) } else { - Container::new(horizontal_space(25.0)) + Container::new(Space::with_width(25.0)) }) - .push(horizontal_space(Length::Fill)) + .push(Space::with_width(Length::Fill)) } fn button_clear_filter( new_search_parameters: SearchParameters, font: Font, -) -> Button<'static, Message, Renderer> { +) -> Button<'static, Message, StyleType> { button( Text::new("×") .font(font) diff --git a/src/gui/pages/notifications_page.rs b/src/gui/pages/notifications_page.rs index d114f019..1b87d598 100644 --- a/src/gui/pages/notifications_page.rs +++ b/src/gui/pages/notifications_page.rs @@ -1,10 +1,10 @@ use iced::alignment::{Horizontal, Vertical}; use iced::widget::scrollable::Direction; use iced::widget::tooltip::Position; -use iced::widget::{button, vertical_space}; +use iced::widget::{button, Space}; use iced::widget::{lazy, Column, Container, Row, Scrollable, Text, Tooltip}; use iced::Length::FillPortion; -use iced::{Alignment, Font, Length, Renderer}; +use iced::{Alignment, Font, Length, Renderer, Theme}; use crate::countries::country_utils::get_flag_tooltip; use crate::countries::flags_pictures::FLAGS_WIDTH_BIG; @@ -31,7 +31,7 @@ use crate::utils::types::icon::Icon; use crate::{ByteMultiple, ConfigSettings, Language, RunningPage, Sniffer, StyleType}; /// Computes the body of gui notifications page -pub fn notifications_page(sniffer: &Sniffer) -> Container> { +pub fn notifications_page(sniffer: &Sniffer) -> Container { let ConfigSettings { style, language, @@ -55,7 +55,7 @@ pub fn notifications_page(sniffer: &Sniffer) -> Container Container Column<'static, Message, Renderer> { +) -> Column<'static, Message, StyleType> { Column::new() .padding(5) .spacing(5) .align_items(Alignment::Center) .width(Length::Fill) - .push(vertical_space(FillPortion(1))) + .push(Space::with_height(FillPortion(1))) .push( no_notifications_set_translation(language) .horizontal_alignment(Horizontal::Center) @@ -128,34 +128,34 @@ fn body_no_notifications_set( language, SettingsPage::Notifications, )) - .push(vertical_space(FillPortion(2))) + .push(Space::with_height(FillPortion(2))) } fn body_no_notifications_received( font: Font, language: Language, waiting: &str, -) -> Column<'static, Message, Renderer> { +) -> Column<'static, Message, StyleType> { Column::new() .padding(5) .spacing(5) .align_items(Alignment::Center) .width(Length::Fill) - .push(vertical_space(FillPortion(1))) + .push(Space::with_height(FillPortion(1))) .push( no_notifications_received_translation(language) .horizontal_alignment(Horizontal::Center) .font(font), ) .push(Text::new(waiting.to_owned()).font(font).size(50)) - .push(vertical_space(FillPortion(2))) + .push(Space::with_height(FillPortion(2))) } fn packets_notification_log( logged_notification: PacketsThresholdExceeded, language: Language, font: Font, -) -> Container<'static, Message, Renderer> { +) -> Container<'static, Message, StyleType> { let threshold_str = format!( "{}: {} {}", threshold_translation(language), @@ -177,10 +177,9 @@ fn packets_notification_log( .push( Tooltip::new( Icon::PacketsThreshold.to_text().size(80), - packets_exceeded_translation(language), + Text::new(packets_exceeded_translation(language)).font(font), Position::FollowCursor, ) - .font(font) .style(ContainerType::Tooltip), ) .push( @@ -229,7 +228,7 @@ fn bytes_notification_log( logged_notification: BytesThresholdExceeded, language: Language, font: Font, -) -> Container<'static, Message, Renderer> { +) -> Container<'static, Message, StyleType> { let mut threshold_str = threshold_translation(language); threshold_str.push_str(": "); threshold_str.push_str(&ByteMultiple::formatted_string( @@ -256,10 +255,9 @@ fn bytes_notification_log( .push( Tooltip::new( Icon::BytesThreshold.to_text().size(80), - bytes_exceeded_translation(language), + Text::new(bytes_exceeded_translation(language)).font(font), Position::FollowCursor, ) - .font(font) .style(ContainerType::Tooltip), ) .push( @@ -310,7 +308,7 @@ fn favorite_notification_log( logged_notification: FavoriteTransmitted, language: Language, font: Font, -) -> Container<'static, Message, Renderer> { +) -> Container<'static, Message, StyleType> { let country = logged_notification.host.country; let asn = &logged_notification.host.asn; @@ -338,10 +336,9 @@ fn favorite_notification_log( .push( Tooltip::new( Icon::Star.to_text().size(80).style(TextType::Starred), - favorite_transmitted_translation(language), + Text::new(favorite_transmitted_translation(language)).font(font), Position::FollowCursor, ) - .font(font) .style(ContainerType::Tooltip), ) .push( @@ -373,10 +370,7 @@ fn favorite_notification_log( .style(ContainerType::BorderedRound) } -fn get_button_clear_all( - font: Font, - language: Language, -) -> Tooltip<'static, Message, Renderer> { +fn get_button_clear_all(font: Font, language: Language) -> Tooltip<'static, Message, StyleType> { let content = button( Icon::Bin .to_text() @@ -389,13 +383,16 @@ fn get_button_clear_all( .width(Length::Fixed(75.0)) .on_press(Message::ShowModal(MyModal::ClearAll)); - Tooltip::new(content, clear_all_translation(language), Position::Top) - .gap(5) - .font(font) - .style(ContainerType::Tooltip) + Tooltip::new( + content, + Text::new(clear_all_translation(language)).font(font), + Position::Top, + ) + .gap(5) + .style(ContainerType::Tooltip) } -fn lazy_logged_notifications(sniffer: &Sniffer) -> Column<'static, Message, Renderer> { +fn lazy_logged_notifications(sniffer: &Sniffer) -> Column<'static, Message, StyleType> { let ConfigSettings { style, language, .. } = sniffer.configs.lock().unwrap().settings; diff --git a/src/gui/pages/overview_page.rs b/src/gui/pages/overview_page.rs index 2da8de42..578e6e40 100644 --- a/src/gui/pages/overview_page.rs +++ b/src/gui/pages/overview_page.rs @@ -7,11 +7,10 @@ use iced::alignment::{Horizontal, Vertical}; use iced::widget::scrollable::Direction; use iced::widget::tooltip::Position; use iced::widget::{ - button, lazy, vertical_space, Button, Column, Container, Row, Scrollable, Text, Tooltip, + button, lazy, Button, Column, Container, Row, Rule, Scrollable, Space, Text, Tooltip, }; -use iced::widget::{horizontal_space, Rule}; use iced::Length::{Fill, FillPortion, Fixed}; -use iced::{Alignment, Font, Length, Renderer}; +use iced::{Alignment, Font, Length, Renderer, Theme}; use crate::countries::country_utils::get_flag_tooltip; use crate::countries::flags_pictures::FLAGS_WIDTH_BIG; @@ -48,7 +47,7 @@ use crate::utils::types::icon::Icon; use crate::{ByteMultiple, ChartType, ConfigSettings, Language, RunningPage, StyleType}; /// Computes the body of gui overview page -pub fn overview_page(sniffer: &Sniffer) -> Container> { +pub fn overview_page(sniffer: &Sniffer) -> Container { let ConfigSettings { style, language, .. } = sniffer.configs.lock().unwrap().settings; @@ -146,7 +145,7 @@ fn body_no_packets( font: Font, language: Language, waiting: &str, -) -> Column<'static, Message, Renderer> { +) -> Column<'static, Message, StyleType> { let link_type = device.link_type; let mut adapter_info = device.name.clone(); adapter_info.push_str(&format!("\n{}", link_type.full_print_on_one_line(language))); @@ -178,12 +177,12 @@ fn body_no_packets( .padding(10) .spacing(10) .align_items(Alignment::Center) - .push(vertical_space(FillPortion(1))) + .push(Space::with_height(FillPortion(1))) .push(icon_text) - .push(vertical_space(Length::Fixed(15.0))) + .push(Space::with_height(Length::Fixed(15.0))) .push(nothing_to_see_text) .push(Text::new(waiting.to_owned()).font(font).size(50)) - .push(vertical_space(FillPortion(2))) + .push(Space::with_height(FillPortion(2))) } fn body_no_observed( @@ -193,7 +192,7 @@ fn body_no_observed( font_headers: Font, language: Language, waiting: &str, -) -> Column<'static, Message, Renderer> { +) -> Column<'static, Message, StyleType> { let tot_packets_text = some_observed_translation(language, observed) .horizontal_alignment(Horizontal::Center) .font(font); @@ -203,7 +202,7 @@ fn body_no_observed( .padding(10) .spacing(10) .align_items(Alignment::Center) - .push(vertical_space(FillPortion(1))) + .push(Space::with_height(FillPortion(1))) .push(Icon::Funnel.to_text().size(60)) .push(get_active_filters_col( filters, @@ -215,7 +214,7 @@ fn body_no_observed( .push(Rule::horizontal(20)) .push(tot_packets_text) .push(Text::new(waiting.to_owned()).font(font).size(50)) - .push(vertical_space(FillPortion(2))) + .push(Space::with_height(FillPortion(2))) } fn body_pcap_error( @@ -223,7 +222,7 @@ fn body_pcap_error( waiting: &str, language: Language, font: Font, -) -> Column<'static, Message, Renderer> { +) -> Column<'static, Message, StyleType> { // let err_string = pcap_error.clone().unwrap(); let error_text = error_translation(language, pcap_error) .horizontal_alignment(Horizontal::Center) @@ -234,15 +233,15 @@ fn body_pcap_error( .padding(10) .spacing(10) .align_items(Alignment::Center) - .push(vertical_space(FillPortion(1))) + .push(Space::with_height(FillPortion(1))) .push(Icon::Error.to_text().size(60)) - .push(vertical_space(Length::Fixed(15.0))) + .push(Space::with_height(Length::Fixed(15.0))) .push(error_text) .push(Text::new(waiting.to_owned()).font(font).size(50)) - .push(vertical_space(FillPortion(2))) + .push(Space::with_height(FillPortion(2))) } -fn lazy_row_report(sniffer: &Sniffer) -> Container<'static, Message, Renderer> { +fn lazy_row_report(sniffer: &Sniffer) -> Container<'static, Message, StyleType> { let mut row_report = Row::new() .padding([0, 10, 5, 10]) .height(Length::Fill) @@ -261,7 +260,7 @@ fn lazy_row_report(sniffer: &Sniffer) -> Container<'static, Message, Renderer Column<'static, Message, Renderer> { +fn col_host(width: f32, sniffer: &Sniffer) -> Column<'static, Message, StyleType> { let ConfigSettings { style, language, .. } = sniffer.configs.lock().unwrap().settings; @@ -302,7 +301,7 @@ fn col_host(width: f32, sniffer: &Sniffer) -> Column<'static, Message, Renderer< }) .font(font), ) - .push(horizontal_space(Length::FillPortion(1))) + .push(Space::with_width(Length::FillPortion(1))) .push( Text::new(if chart_type.eq(&ChartType::Packets) { data_info_host.data_info.tot_packets().to_string() @@ -336,11 +335,13 @@ fn col_host(width: f32, sniffer: &Sniffer) -> Column<'static, Message, Renderer< } if entries.len() >= 30 { - scroll_host = scroll_host.push(vertical_space(Length::Fixed(25.0))).push( - Text::new(only_top_30_items_translation(language)) - .font(font) - .horizontal_alignment(Horizontal::Center), - ); + scroll_host = scroll_host + .push(Space::with_height(Length::Fixed(25.0))) + .push( + Text::new(only_top_30_items_translation(language)) + .font(font) + .horizontal_alignment(Horizontal::Center), + ); } Column::new() @@ -355,7 +356,7 @@ fn col_host(width: f32, sniffer: &Sniffer) -> Column<'static, Message, Renderer< .style(TextType::Title) .size(FONT_SIZE_TITLE), ) - .push(horizontal_space(Length::Fill)) + .push(Space::with_width(Length::Fill)) .push(sort_arrows( sniffer.host_sort_type, Message::HostSortSelection, @@ -367,7 +368,7 @@ fn col_host(width: f32, sniffer: &Sniffer) -> Column<'static, Message, Renderer< ) } -fn col_service(width: f32, sniffer: &Sniffer) -> Column<'static, Message, Renderer> { +fn col_service(width: f32, sniffer: &Sniffer) -> Column<'static, Message, StyleType> { let ConfigSettings { style, language, .. } = sniffer.configs.lock().unwrap().settings; @@ -394,7 +395,7 @@ fn col_service(width: f32, sniffer: &Sniffer) -> Column<'static, Message, Render .push( Row::new() .push(Text::new(service.to_string()).font(font)) - .push(horizontal_space(Length::FillPortion(1))) + .push(Space::with_width(Length::FillPortion(1))) .push( Text::new(if chart_type.eq(&ChartType::Packets) { data_info.tot_packets().to_string() @@ -418,7 +419,7 @@ fn col_service(width: f32, sniffer: &Sniffer) -> Column<'static, Message, Render if entries.len() >= 30 { scroll_service = scroll_service - .push(vertical_space(Length::Fixed(25.0))) + .push(Space::with_height(Length::Fixed(25.0))) .push( Text::new(only_top_30_items_translation(language)) .font(font) @@ -438,7 +439,7 @@ fn col_service(width: f32, sniffer: &Sniffer) -> Column<'static, Message, Render .style(TextType::Title) .size(FONT_SIZE_TITLE), ) - .push(horizontal_space(Length::Fill)) + .push(Space::with_width(Length::Fill)) .push(sort_arrows( sniffer.service_sort_type, Message::ServiceSortSelection, @@ -455,7 +456,7 @@ fn lazy_col_info( filtered: u128, dropped: u32, sniffer: &Sniffer, -) -> Container<'static, Message, Renderer> { +) -> Container<'static, Message, StyleType> { let ConfigSettings { style, language, .. } = sniffer.configs.lock().unwrap().settings; @@ -507,7 +508,7 @@ fn lazy_col_info( .style(ContainerType::BorderedRound) } -fn container_chart(sniffer: &Sniffer, font: Font) -> Container> { +fn container_chart(sniffer: &Sniffer, font: Font) -> Container { let ConfigSettings { language, .. } = sniffer.configs.lock().unwrap().settings; let traffic_chart = &sniffer.traffic_chart; @@ -551,7 +552,7 @@ fn col_device( language: Language, font: Font, device: &MyDevice, -) -> Column<'static, Message, Renderer> { +) -> Column<'static, Message, StyleType> { let link_type = device.link_type; #[cfg(not(target_os = "windows"))] let adapter_info = &device.name; @@ -572,7 +573,7 @@ fn col_data_representation( language: Language, font: Font, chart_type: ChartType, -) -> Column<'static, Message, Renderer> { +) -> Column<'static, Message, StyleType> { let mut ret_val = Column::new().spacing(5).push( Text::new(format!("{}:", data_representation_translation(language))) .style(TextType::Subtitle) @@ -610,7 +611,7 @@ fn col_bytes_packets( font: Font, font_headers: Font, sniffer: &Sniffer, -) -> Column<'static, Message, Renderer> { +) -> Column<'static, Message, StyleType> { let filtered_bytes = sniffer.runtime_data.tot_out_bytes + sniffer.runtime_data.tot_in_bytes; let all_bytes = sniffer.runtime_data.all_bytes; let filters = &sniffer.filters; @@ -735,7 +736,7 @@ fn get_bars_length( (in_len, out_len) } -fn get_bars(in_len: f32, out_len: f32) -> Row<'static, Message, Renderer> { +fn get_bars(in_len: f32, out_len: f32) -> Row<'static, Message, StyleType> { Row::new() .push(if in_len > 0.0 { Row::new() @@ -753,7 +754,7 @@ fn get_bars(in_len: f32, out_len: f32) -> Row<'static, Message, Renderer Button<'static, Message, Renderer> { +fn get_star_button(is_favorite: bool, host: Host) -> Button<'static, Message, StyleType> { button( Icon::Star .to_text() @@ -778,7 +779,7 @@ fn get_active_filters_col( font: Font, font_headers: Font, show: bool, -) -> Column<'static, Message, Renderer> { +) -> Column<'static, Message, StyleType> { let mut ret_val = Column::new().push( Text::new(format!("{}:", active_filters_translation(language),)) .font(font) @@ -800,10 +801,9 @@ fn get_active_filters_col( .height(Fixed(20.0)) .width(Fixed(20.0)) .style(ContainerType::Highlighted), - filters_string, + Text::new(filters_string).font(font), Position::FollowCursor, ) - .font(font) .style(ContainerType::Tooltip), ) }); @@ -814,7 +814,7 @@ fn get_active_filters_col( fn sort_arrows( active_sort_type: SortType, message: fn(SortType) -> Message, -) -> Container<'static, Message, Renderer> { +) -> Container<'static, Message, StyleType> { Container::new( button( active_sort_type diff --git a/src/gui/pages/settings_general_page.rs b/src/gui/pages/settings_general_page.rs index b0fed305..4dc8d86f 100644 --- a/src/gui/pages/settings_general_page.rs +++ b/src/gui/pages/settings_general_page.rs @@ -2,12 +2,9 @@ use std::sync::Arc; use iced::alignment::{Horizontal, Vertical}; use iced::widget::tooltip::Position; -use iced::widget::{ - button, horizontal_space, vertical_space, Column, Container, PickList, Row, Rule, Slider, Text, - Tooltip, -}; +use iced::widget::{button, Column, Container, PickList, Row, Rule, Slider, Space, Text, Tooltip}; use iced::Length::Fixed; -use iced::{Alignment, Font, Length, Renderer}; +use iced::{Alignment, Font, Length, Renderer, Theme}; use crate::gui::components::button::button_open_file; use crate::gui::components::tab::get_settings_tabs; @@ -28,7 +25,7 @@ use crate::utils::types::file_info::FileInfo; use crate::utils::types::web_page::WebPage; use crate::{ConfigSettings, Language, RunningPage, Sniffer, StyleType}; -pub fn settings_general_page(sniffer: &Sniffer) -> Container> { +pub fn settings_general_page(sniffer: &Sniffer) -> Container { let ConfigSettings { style, language, @@ -48,7 +45,7 @@ pub fn settings_general_page(sniffer: &Sniffer) -> Container Container Column<'static, Message, Renderer> { +) -> Column<'static, Message, StyleType> { let ConfigSettings { language, scale_factor, @@ -84,7 +81,7 @@ fn column_all_general_setting( .padding(10.0) .style(ContainerType::Badge), ) - .push(vertical_space(Fixed(10.0))); + .push(Space::with_height(Fixed(10.0))); } column = column.push(mmdb_settings( @@ -104,7 +101,7 @@ fn row_language_scale_factor( language: Language, font: Font, scale_factor: f64, -) -> Row<'static, Message, Renderer> { +) -> Row<'static, Message, StyleType> { Row::new() .align_items(Alignment::Start) .height(Length::Fixed(90.0)) @@ -112,13 +109,10 @@ fn row_language_scale_factor( .push(Rule::vertical(25)) .push(scale_factor_slider(language, font, scale_factor)) .push(Rule::vertical(25)) - .push(horizontal_space(Length::FillPortion(1))) + .push(Space::with_width(Length::FillPortion(1))) } -fn language_picklist( - language: Language, - font: Font, -) -> Container<'static, Message, Renderer> { +fn language_picklist(language: Language, font: Font) -> Container<'static, Message, StyleType> { let mut flag_row = Row::new() .align_items(Alignment::Center) .spacing(10) @@ -137,10 +131,10 @@ fn language_picklist( .padding(2) .height(Fixed(20.0)) .width(Fixed(20.0)), - "The selected language is not\nfully updated to version 1.3 ↗", + Text::new("The selected language is not\nfully updated to version 1.3 ↗") + .font(font), Position::FollowCursor, ) - .font(font) .style(ContainerType::Tooltip), ); } @@ -175,7 +169,7 @@ fn scale_factor_slider( language: Language, font: Font, scale_factor: f64, -) -> Container<'static, Message, Renderer> { +) -> Container<'static, Message, StyleType> { #[allow(clippy::cast_possible_truncation)] let slider_width = 150.0 / scale_factor as f32; Container::new( @@ -208,7 +202,7 @@ fn mmdb_settings( asn_path: &str, country_reader: &Arc, asn_reader: &Arc, -) -> Column<'static, Message, Renderer> { +) -> Column<'static, Message, StyleType> { Column::new() .spacing(5) .align_items(Alignment::Center) @@ -246,7 +240,7 @@ fn mmdb_selection_row( mmdb_reader: &Arc, caption: &str, language: Language, -) -> Row<'static, Message, Renderer> { +) -> Row<'static, Message, StyleType> { let is_error = if custom_path.is_empty() { false } else { @@ -286,7 +280,7 @@ fn button_clear_mmdb( message: fn(String) -> Message, font: Font, is_editable: bool, -) -> Tooltip<'static, Message, Renderer> { +) -> Tooltip<'static, Message, StyleType> { let mut button = button( Text::new("×") .font(font) diff --git a/src/gui/pages/settings_notifications_page.rs b/src/gui/pages/settings_notifications_page.rs index fcb0a32b..47a1829c 100644 --- a/src/gui/pages/settings_notifications_page.rs +++ b/src/gui/pages/settings_notifications_page.rs @@ -1,11 +1,9 @@ use iced::alignment::{Horizontal, Vertical}; use iced::widget::scrollable::Direction; -use iced::widget::{ - horizontal_space, vertical_space, Checkbox, Column, Container, Row, Scrollable, Text, TextInput, -}; use iced::widget::{Button, Slider}; +use iced::widget::{Checkbox, Column, Container, Row, Scrollable, Space, Text, TextInput}; use iced::Length::Fixed; -use iced::{Alignment, Font, Length, Renderer}; +use iced::{Alignment, Font, Length, Renderer, Theme}; use crate::gui::components::button::button_hide; use crate::gui::components::tab::get_settings_tabs; @@ -30,7 +28,7 @@ use crate::translations::translations::{ use crate::utils::types::icon::Icon; use crate::{ConfigSettings, Language, Sniffer, StyleType}; -pub fn settings_notifications_page(sniffer: &Sniffer) -> Container> { +pub fn settings_notifications_page(sniffer: &Sniffer) -> Container { let ConfigSettings { style, language, @@ -54,7 +52,7 @@ pub fn settings_notifications_page(sniffer: &Sniffer) -> Container Container Column<'static, Message, Renderer> { +) -> Column<'static, Message, StyleType> { let checkbox = Checkbox::new( packets_threshold_translation(language), packets_notification.threshold.is_some(), - move |toggled| { - if toggled { - Message::UpdateNotificationSettings( - Notification::Packets(PacketsNotification { - threshold: Some(packets_notification.previous_threshold), - ..packets_notification - }), - false, - ) - } else { - Message::UpdateNotificationSettings( - Notification::Packets(PacketsNotification { - threshold: None, - ..packets_notification - }), - false, - ) - } - }, ) + .on_toggle(move |toggled| { + if toggled { + Message::UpdateNotificationSettings( + Notification::Packets(PacketsNotification { + threshold: Some(packets_notification.previous_threshold), + ..packets_notification + }), + false, + ) + } else { + Message::UpdateNotificationSettings( + Notification::Packets(PacketsNotification { + threshold: None, + ..packets_notification + }), + false, + ) + } + }) .size(18) .font(font); @@ -158,30 +156,30 @@ fn get_bytes_notify( bytes_notification: BytesNotification, language: Language, font: Font, -) -> Column<'static, Message, Renderer> { +) -> Column<'static, Message, StyleType> { let checkbox = Checkbox::new( bytes_threshold_translation(language), bytes_notification.threshold.is_some(), - move |toggled| { - if toggled { - Message::UpdateNotificationSettings( - Notification::Bytes(BytesNotification { - threshold: Some(bytes_notification.previous_threshold), - ..bytes_notification - }), - false, - ) - } else { - Message::UpdateNotificationSettings( - Notification::Bytes(BytesNotification { - threshold: None, - ..bytes_notification - }), - false, - ) - } - }, ) + .on_toggle(move |toggled| { + if toggled { + Message::UpdateNotificationSettings( + Notification::Bytes(BytesNotification { + threshold: Some(bytes_notification.previous_threshold), + ..bytes_notification + }), + false, + ) + } else { + Message::UpdateNotificationSettings( + Notification::Bytes(BytesNotification { + threshold: None, + ..bytes_notification + }), + false, + ) + } + }) .size(18) .font(font); @@ -211,21 +209,21 @@ fn get_favorite_notify( favorite_notification: FavoriteNotification, language: Language, font: Font, -) -> Column<'static, Message, Renderer> { +) -> Column<'static, Message, StyleType> { let checkbox = Checkbox::new( favorite_notification_translation(language), favorite_notification.notify_on_favorite, - move |toggled| { - Message::UpdateNotificationSettings( - if toggled { - Notification::Favorite(FavoriteNotification::on(favorite_notification.sound)) - } else { - Notification::Favorite(FavoriteNotification::off(favorite_notification.sound)) - }, - false, - ) - }, ) + .on_toggle(move |toggled| { + Message::UpdateNotificationSettings( + if toggled { + Notification::Favorite(FavoriteNotification::on(favorite_notification.sound)) + } else { + Notification::Favorite(FavoriteNotification::off(favorite_notification.sound)) + }, + false, + ) + }) .size(18) .font(font); @@ -258,12 +256,12 @@ fn input_group_packets( packets_notification: PacketsNotification, font: Font, language: Language, -) -> Container<'static, Message, Renderer> { +) -> Container<'static, Message, StyleType> { let curr_threshold_str = &packets_notification.threshold.unwrap().to_string(); let input_row = Row::new() .align_items(Alignment::Center) .spacing(5) - .push(horizontal_space(Fixed(45.0))) + .push(Space::with_width(Fixed(45.0))) .push(Text::new(format!("{}:", threshold_translation(language))).font(font)) .push( TextInput::new( @@ -301,7 +299,7 @@ fn input_group_bytes( bytes_notification: BytesNotification, font: Font, language: Language, -) -> Container<'static, Message, Renderer> { +) -> Container<'static, Message, StyleType> { let info_str = format!( "{}; {}", per_second_translation(language), @@ -314,7 +312,7 @@ fn input_group_bytes( let input_row = Row::new() .spacing(5) .align_items(Alignment::Center) - .push(horizontal_space(Fixed(45.0))) + .push(Space::with_width(Fixed(45.0))) .push(Text::new(format!("{}:", threshold_translation(language))).font(font)) .push( TextInput::new( @@ -348,7 +346,7 @@ fn volume_slider( language: Language, font: Font, volume: u8, -) -> Container<'static, Message, Renderer> { +) -> Container<'static, Message, StyleType> { Container::new( Column::new() .spacing(5) @@ -368,7 +366,7 @@ fn volume_slider( .step(5) .width(Fixed(200.0)), ) - .push(horizontal_space(Length::Fixed(15.0))) + .push(Space::with_width(Length::Fixed(15.0))) .push( Icon::AudioHigh .to_text() @@ -388,7 +386,7 @@ fn sound_buttons( notification: Notification, font: Font, language: Language, -) -> Row<'static, Message, Renderer> { +) -> Row<'static, Message, StyleType> { let current_sound = match notification { Notification::Packets(n) => n.sound, Notification::Bytes(n) => n.sound, @@ -398,7 +396,7 @@ fn sound_buttons( let mut ret_val = Row::new() .align_items(Alignment::Center) .spacing(5) - .push(horizontal_space(Fixed(45.0))) + .push(Space::with_width(Fixed(45.0))) .push(Text::new(format!("{}:", sound_translation(language))).font(font)); for option in Sound::ALL { @@ -436,10 +434,10 @@ pub fn settings_header( font_headers: Font, color_gradient: GradientType, language: Language, -) -> Container<'static, Message, Renderer> { +) -> Container<'static, Message, StyleType> { Container::new( Row::new() - .push(horizontal_space(Length::FillPortion(1))) + .push(Space::with_width(Length::FillPortion(1))) .push( Text::new(settings_translation(language)) .font(font_headers) diff --git a/src/gui/pages/settings_style_page.rs b/src/gui/pages/settings_style_page.rs index af992031..f6bf19fc 100644 --- a/src/gui/pages/settings_style_page.rs +++ b/src/gui/pages/settings_style_page.rs @@ -1,9 +1,9 @@ use iced::alignment::{Horizontal, Vertical}; use iced::widget::scrollable::Direction; -use iced::widget::{button, horizontal_space, lazy, vertical_space, Rule}; -use iced::widget::{Button, Column, Container, Row, Scrollable, Space, Text}; +use iced::widget::{button, horizontal_space, lazy, Rule, Space}; +use iced::widget::{Button, Column, Container, Row, Scrollable, Text}; use iced::Length::Fixed; -use iced::{Alignment, Color, Element, Font, Length, Renderer}; +use iced::{Alignment, Color, Element, Font, Length, Renderer, Theme}; use crate::gui::components::button::button_open_file; use crate::gui::components::tab::get_settings_tabs; @@ -31,7 +31,7 @@ use crate::utils::types::icon::Icon; use crate::StyleType::{Day, DeepSea, MonAmour, Night}; use crate::{ConfigSettings, Language, Sniffer, StyleType}; -pub fn settings_style_page(sniffer: &Sniffer) -> Container> { +pub fn settings_style_page(sniffer: &Sniffer) -> Container { let ConfigSettings { style, language, @@ -53,16 +53,16 @@ pub fn settings_style_page(sniffer: &Sniffer) -> Container Container Container Container Container Container Row<'static, Message, Renderer> { +) -> Row<'static, Message, StyleType> { Row::new() .align_items(Alignment::Center) .spacing(10) @@ -191,7 +191,7 @@ fn get_palette_container( name: String, description: String, on_press: StyleType, -) -> Button<'static, Message, Renderer> { +) -> Button<'static, Message, StyleType> { let font = style.get_extension().font; let is_custom = matches!(on_press, StyleType::Custom(_)); @@ -227,7 +227,7 @@ fn get_palette_rule( palette: Palette, buttons_color: Color, is_custom: bool, -) -> Container<'static, Message, Renderer> { +) -> Container<'static, Message, StyleType> { let height = if is_custom { 25 } else { 40 }; Container::new( @@ -256,7 +256,7 @@ fn get_palette_rule( fn get_extra_palettes( styles: &[ExtraStyles], current_style: StyleType, -) -> Vec>> { +) -> Vec> { // Map each extra style into a palette container let mut styles = styles.iter().map(|&style| { let name = style.to_string(); @@ -277,17 +277,17 @@ fn get_extra_palettes( children.extend([ Row::new() .push(first) - .push(horizontal_space(Length::Fixed(15.0))) + .push(Space::with_width(Length::Fixed(15.0))) .push(second) .into(), - >>>::into(vertical_space( + >>::into(Space::with_height( Length::Fixed(10.0), )), ]); } else { children.extend([ Row::new().push(first).into(), - >>>::into(vertical_space( + >>::into(Space::with_height( Length::Fixed(10.0), )), ]); @@ -302,7 +302,7 @@ fn lazy_custom_style_input( font: Font, custom_path: &str, style: StyleType, -) -> Button<'static, Message, Renderer> { +) -> Button<'static, Message, StyleType> { let is_custom_toml_style_set = matches!(style, StyleType::Custom(ExtraStyles::CustomToml(_))); let custom_palette = Palette::from_file(custom_path); diff --git a/src/gui/pages/types/running_page.rs b/src/gui/pages/types/running_page.rs index 3a2db7e2..2a928b6a 100644 --- a/src/gui/pages/types/running_page.rs +++ b/src/gui/pages/types/running_page.rs @@ -1,4 +1,4 @@ -use iced::Renderer; +use iced::{Renderer, Theme}; use crate::gui::types::message::Message; use crate::translations::translations::{notifications_translation, overview_translation}; @@ -53,7 +53,7 @@ impl RunningPage { } } - pub fn icon(self) -> iced::widget::Text<'static, Renderer> { + pub fn icon(self) -> iced::widget::Text<'static, StyleType> { match self { RunningPage::Overview => Icon::Overview, RunningPage::Inspect => Icon::Inspect, diff --git a/src/gui/pages/types/settings_page.rs b/src/gui/pages/types/settings_page.rs index 7fe21ac7..1ec31fd5 100644 --- a/src/gui/pages/types/settings_page.rs +++ b/src/gui/pages/types/settings_page.rs @@ -1,4 +1,4 @@ -use iced::Renderer; +use iced::{Renderer, Theme}; use crate::gui::types::message::Message; use crate::translations::translations::{notifications_translation, style_translation}; @@ -48,7 +48,7 @@ impl SettingsPage { } } - pub fn icon(self) -> iced::widget::Text<'static, Renderer> { + pub fn icon(self) -> iced::widget::Text<'static, StyleType> { match self { SettingsPage::Notifications => Icon::Notification, SettingsPage::Appearance => Icon::HalfSun, diff --git a/src/gui/styles/button.rs b/src/gui/styles/button.rs index 7f0fda1d..720907d3 100644 --- a/src/gui/styles/button.rs +++ b/src/gui/styles/button.rs @@ -4,7 +4,7 @@ use iced::widget::button; use iced::widget::button::Appearance; -use iced::{Background, Color, Vector}; +use iced::{Background, Border, Color, Vector}; use crate::gui::styles::style_constants::{BORDER_BUTTON_RADIUS, BORDER_WIDTH}; use crate::gui::styles::types::gradient_type::{ @@ -59,23 +59,33 @@ impl button::StyleSheet for StyleType { )), _ => Background::Color(ext.buttons_color), }), - border_radius: match style { - ButtonType::Neutral => 0.0.into(), - ButtonType::TabActive | ButtonType::TabInactive => [0.0, 0.0, 30.0, 30.0].into(), - ButtonType::BorderedRound | ButtonType::BorderedRoundSelected => 12.0.into(), - ButtonType::Starred | ButtonType::NotStarred => 100.0.into(), - _ => BORDER_BUTTON_RADIUS.into(), - }, - border_width: match style { - ButtonType::TabActive - | ButtonType::TabInactive - | ButtonType::SortArrows - | ButtonType::SortArrowActive - | ButtonType::Starred - | ButtonType::NotStarred - | ButtonType::Neutral => 0.0, - ButtonType::BorderedRound => BORDER_WIDTH * 2.0, - _ => BORDER_WIDTH, + border: Border{ + radius: match style { + ButtonType::Neutral => 0.0.into(), + ButtonType::TabActive | ButtonType::TabInactive => [0.0, 0.0, 30.0, 30.0].into(), + ButtonType::BorderedRound | ButtonType::BorderedRoundSelected => 12.0.into(), + ButtonType::Starred | ButtonType::NotStarred => 100.0.into(), + _ => BORDER_BUTTON_RADIUS.into(), + }, + width: match style { + ButtonType::TabActive + | ButtonType::TabInactive + | ButtonType::SortArrows + | ButtonType::SortArrowActive + | ButtonType::Starred + | ButtonType::NotStarred + | ButtonType::Neutral => 0.0, + ButtonType::BorderedRound => BORDER_WIDTH * 2.0, + _ => BORDER_WIDTH, + }, + color: match style { + ButtonType::Alert => Color::new(0.8, 0.15, 0.15, 1.0), + ButtonType::BorderedRound => Color { + a: ext.alpha_round_borders, + ..ext.buttons_color + }, + _ => colors.secondary, + }, }, shadow_offset: match style { ButtonType::TabActive | ButtonType::TabInactive => Vector::new(3.0, 2.0), @@ -91,14 +101,7 @@ impl button::StyleSheet for StyleType { ButtonType::Gradient(_) => colors.text_headers, _ => colors.text_body, }, - border_color: match style { - ButtonType::Alert => Color::new(0.8, 0.15, 0.15, 1.0), - ButtonType::BorderedRound => Color { - a: ext.alpha_round_borders, - ..ext.buttons_color - }, - _ => colors.secondary, - }, + shadow: Default::default() } } @@ -130,30 +133,32 @@ impl button::StyleSheet for StyleType { ), _ => Background::Color(mix_colors(colors.primary, ext.buttons_color)), }), - border_radius: match style { - ButtonType::Neutral => 0.0.into(), - ButtonType::TabActive | ButtonType::TabInactive => [0.0, 0.0, 30.0, 30.0].into(), - ButtonType::BorderedRound | ButtonType::BorderedRoundSelected => 12.0.into(), - ButtonType::Starred | ButtonType::NotStarred => 100.0.into(), - _ => BORDER_BUTTON_RADIUS.into(), - }, - border_width: match style { - ButtonType::Starred - | ButtonType::TabActive - | ButtonType::SortArrows - | ButtonType::SortArrowActive - | ButtonType::TabInactive - | ButtonType::BorderedRound => 0.0, - _ => BORDER_WIDTH, - }, - border_color: match style { - ButtonType::Alert => Color::new(0.8, 0.15, 0.15, 1.0), - ButtonType::BorderedRound | ButtonType::NotStarred => Color { - a: ext.alpha_round_borders, - ..ext.buttons_color + border: Border{ + radius: match style { + ButtonType::Neutral => 0.0.into(), + ButtonType::TabActive | ButtonType::TabInactive => [0.0, 0.0, 30.0, 30.0].into(), + ButtonType::BorderedRound | ButtonType::BorderedRoundSelected => 12.0.into(), + ButtonType::Starred | ButtonType::NotStarred => 100.0.into(), + _ => BORDER_BUTTON_RADIUS.into(), + }, + width: match style { + ButtonType::Starred + | ButtonType::TabActive + | ButtonType::SortArrows + | ButtonType::SortArrowActive + | ButtonType::TabInactive + | ButtonType::BorderedRound => 0.0, + _ => BORDER_WIDTH, + }, + color: match style { + ButtonType::Alert => Color::new(0.8, 0.15, 0.15, 1.0), + ButtonType::BorderedRound | ButtonType::NotStarred => Color { + a: ext.alpha_round_borders, + ..ext.buttons_color + }, + ButtonType::Neutral => ext.buttons_color, + _ => colors.secondary, }, - ButtonType::Neutral => ext.buttons_color, - _ => colors.secondary, }, text_color: match style { ButtonType::Starred => Color::BLACK, @@ -161,6 +166,7 @@ impl button::StyleSheet for StyleType { ButtonType::SortArrowActive | ButtonType::SortArrows => colors.secondary, _ => colors.text_body, }, + shadow: Default::default() } } @@ -184,17 +190,20 @@ impl button::StyleSheet for StyleType { } _ => Background::Color(ext.buttons_color), }), - border_radius: BORDER_BUTTON_RADIUS.into(), - border_width: BORDER_WIDTH, + border: Border{ + radius: BORDER_BUTTON_RADIUS.into(), + width: BORDER_WIDTH, + color: Color { + a: ext.alpha_chart_badge, + ..colors.secondary + }, + }, shadow_offset: Vector::new(0.0, 0.0), text_color: Color { a: ext.alpha_chart_badge, ..colors.text_headers }, - border_color: Color { - a: ext.alpha_chart_badge, - ..colors.secondary - }, + shadow: Default::default() }, ButtonType::Standard => Appearance { shadow_offset: Vector::new(0.0, 0.0), @@ -202,16 +211,19 @@ impl button::StyleSheet for StyleType { a: ext.alpha_chart_badge, ..ext.buttons_color })), - border_radius: BORDER_BUTTON_RADIUS.into(), - border_width: BORDER_WIDTH, - border_color: Color { - a: ext.alpha_chart_badge, - ..colors.secondary + border: Border{ + radius: BORDER_BUTTON_RADIUS.into(), + width: BORDER_WIDTH, + color: Color { + a: ext.alpha_chart_badge, + ..colors.secondary + }, }, text_color: Color { a: ext.alpha_chart_badge, ..colors.text_body }, + shadow: Default::default() }, _ => button::StyleSheet::active(self, style), } diff --git a/src/gui/styles/checkbox.rs b/src/gui/styles/checkbox.rs index 6c6fbf3c..72b8fb82 100644 --- a/src/gui/styles/checkbox.rs +++ b/src/gui/styles/checkbox.rs @@ -3,7 +3,7 @@ #![allow(clippy::module_name_repetitions)] use iced::widget::checkbox::Appearance; -use iced::Background; +use iced::{Background, Border}; use crate::gui::styles::style_constants::BORDER_WIDTH; use crate::StyleType; @@ -25,9 +25,11 @@ impl iced::widget::checkbox::StyleSheet for StyleType { Appearance { background: Background::Color(ext.buttons_color), icon_color: colors.text_body, - border_radius: CHECKBOX_BORDER_RADIUS.into(), - border_width: if is_checked { BORDER_WIDTH } else { 0.0 }, - border_color: colors.secondary, + border: Border { + radius: CHECKBOX_BORDER_RADIUS.into(), + width: if is_checked { BORDER_WIDTH } else { 0.0 }, + color: colors.secondary, + }, text_color: None, } } @@ -38,9 +40,11 @@ impl iced::widget::checkbox::StyleSheet for StyleType { Appearance { background: Background::Color(ext.buttons_color), icon_color: colors.text_body, - border_radius: CHECKBOX_BORDER_RADIUS.into(), - border_width: BORDER_WIDTH, - border_color: colors.secondary, + border: Border{ + radius: CHECKBOX_BORDER_RADIUS.into(), + width: BORDER_WIDTH, + color: colors.secondary, + }, text_color: None, } } diff --git a/src/gui/styles/container.rs b/src/gui/styles/container.rs index 10432686..13c13bf6 100644 --- a/src/gui/styles/container.rs +++ b/src/gui/styles/container.rs @@ -3,7 +3,7 @@ #![allow(clippy::module_name_repetitions)] use iced::widget::container::Appearance; -use iced::{Background, Color}; +use iced::{Background, Border, Color}; use crate::gui::styles::style_constants::{BORDER_ROUNDED_RADIUS, BORDER_WIDTH}; use crate::gui::styles::types::gradient_type::{get_gradient_headers, GradientType}; @@ -56,32 +56,35 @@ impl iced::widget::container::StyleSheet for StyleType { ContainerType::Modal => Background::Color(colors.primary), ContainerType::Standard => Background::Color(Color::TRANSPARENT), }), - border_radius: match style { - ContainerType::BorderedRound => BORDER_ROUNDED_RADIUS.into(), - ContainerType::Modal => { - [0.0, 0.0, BORDER_ROUNDED_RADIUS, BORDER_ROUNDED_RADIUS].into() - } - ContainerType::Tooltip => 7.0.into(), - ContainerType::Badge | ContainerType::Highlighted => 100.0.into(), - _ => 0.0.into(), - }, - border_width: match style { - ContainerType::Standard - | ContainerType::Modal - | ContainerType::Neutral - | ContainerType::Gradient(_) - | ContainerType::Highlighted => 0.0, - ContainerType::Tooltip => BORDER_WIDTH / 2.0, - ContainerType::BorderedRound => BORDER_WIDTH * 2.0, - _ => BORDER_WIDTH, - }, - border_color: match style { - ContainerType::Palette => Color::BLACK, - _ => Color { - a: ext.alpha_round_borders, - ..ext.buttons_color + border: Border{ + radius: match style { + ContainerType::BorderedRound => BORDER_ROUNDED_RADIUS.into(), + ContainerType::Modal => { + [0.0, 0.0, BORDER_ROUNDED_RADIUS, BORDER_ROUNDED_RADIUS].into() + } + ContainerType::Tooltip => 7.0.into(), + ContainerType::Badge | ContainerType::Highlighted => 100.0.into(), + _ => 0.0.into(), + }, + width: match style { + ContainerType::Standard + | ContainerType::Modal + | ContainerType::Neutral + | ContainerType::Gradient(_) + | ContainerType::Highlighted => 0.0, + ContainerType::Tooltip => BORDER_WIDTH / 2.0, + ContainerType::BorderedRound => BORDER_WIDTH * 2.0, + _ => BORDER_WIDTH, + }, + color: match style { + ContainerType::Palette => Color::BLACK, + _ => Color { + a: ext.alpha_round_borders, + ..ext.buttons_color + }, }, }, + shadow: Default::default() } } } diff --git a/src/gui/styles/picklist.rs b/src/gui/styles/picklist.rs index 5f36d612..0c766654 100644 --- a/src/gui/styles/picklist.rs +++ b/src/gui/styles/picklist.rs @@ -3,7 +3,7 @@ #![allow(clippy::module_name_repetitions)] use iced::widget::pick_list; -use iced::{Background, Color}; +use iced::{Background, Border, Color}; use crate::gui::styles::style_constants::BORDER_WIDTH; use crate::gui::styles::types::palette::mix_colors; @@ -26,9 +26,11 @@ impl iced::overlay::menu::StyleSheet for StyleType { iced::overlay::menu::Appearance { text_color: colors.text_body, background: Background::Color(ext.buttons_color), - border_width: BORDER_WIDTH, - border_radius: PICKLIST_BORDER_RADIUS.into(), - border_color: colors.secondary, + border: Border{ + width: BORDER_WIDTH, + radius: PICKLIST_BORDER_RADIUS.into(), + color: colors.secondary, + }, selected_text_color: colors.text_body, selected_background: Background::Color(mix_colors(ext.buttons_color, colors.primary)), } @@ -46,9 +48,11 @@ impl pick_list::StyleSheet for StyleType { placeholder_color: colors.text_body, handle_color: colors.text_body, background: Background::Color(ext.buttons_color), - border_radius: PICKLIST_BORDER_RADIUS.into(), - border_width: 0.0, - border_color: Color::TRANSPARENT, + border: Border{ + radius: PICKLIST_BORDER_RADIUS.into(), + width: 0.0, + color: Color::TRANSPARENT, + }, } } @@ -60,9 +64,11 @@ impl pick_list::StyleSheet for StyleType { placeholder_color: colors.text_body, handle_color: colors.text_body, background: Background::Color(mix_colors(ext.buttons_color, colors.primary)), - border_radius: PICKLIST_BORDER_RADIUS.into(), - border_width: BORDER_WIDTH, - border_color: colors.secondary, + border: Border{ + radius: PICKLIST_BORDER_RADIUS.into(), + width: BORDER_WIDTH, + color: colors.secondary, + }, } } } diff --git a/src/gui/styles/scrollbar.rs b/src/gui/styles/scrollbar.rs index cf7b1834..dc4d2f91 100644 --- a/src/gui/styles/scrollbar.rs +++ b/src/gui/styles/scrollbar.rs @@ -2,9 +2,9 @@ #![allow(clippy::module_name_repetitions)] -use iced::widget::scrollable::Properties; +use iced::widget::scrollable::{Appearance, Properties}; use iced::widget::scrollable::{Scrollbar, Scroller}; -use iced::{Background, Color}; +use iced::{Background, Border, Color}; use crate::gui::styles::style_constants::BORDER_ROUNDED_RADIUS; use crate::gui::styles::types::palette::mix_colors; @@ -25,46 +25,62 @@ impl ScrollbarType { impl iced::widget::scrollable::StyleSheet for StyleType { type Style = ScrollbarType; - fn active(&self, _: &Self::Style) -> Scrollbar { + fn active(&self, _: &Self::Style) -> Appearance { let ext = self.get_extension(); - Scrollbar { - background: Some(Background::Color(Color::TRANSPARENT)), - border_radius: BORDER_ROUNDED_RADIUS.into(), - border_width: 0.0, - border_color: Color::TRANSPARENT, - scroller: Scroller { - color: Color { - a: ext.alpha_round_borders, - ..ext.buttons_color + Appearance { + container: Default::default(), + scrollbar: Scrollbar { + background: Some(Background::Color(Color::TRANSPARENT)), + scroller: Scroller { + color: Color { + a: ext.alpha_round_borders, + ..ext.buttons_color + }, + border: Border { + radius: BORDER_ROUNDED_RADIUS.into(), + width: 0.0, + color: Color::TRANSPARENT, + }, + }, + border: Border { + radius: BORDER_ROUNDED_RADIUS.into(), + width: 0.0, + color: Color::TRANSPARENT, }, - border_radius: BORDER_ROUNDED_RADIUS.into(), - border_width: 0.0, - border_color: Color::TRANSPARENT, }, + gap: None, } } - fn hovered(&self, _: &Self::Style, is_mouse_over_scrollbar: bool) -> Scrollbar { + fn hovered(&self, _: &Self::Style, is_mouse_over_scrollbar: bool) -> Appearance { let colors = self.get_palette(); let ext = self.get_extension(); - Scrollbar { - background: Some(Background::Color(Color { - a: ext.alpha_round_borders, - ..ext.buttons_color - })), - border_radius: BORDER_ROUNDED_RADIUS.into(), - border_width: 0.0, - border_color: Color::TRANSPARENT, - scroller: Scroller { - color: if is_mouse_over_scrollbar { - colors.secondary - } else { - mix_colors(colors.secondary, ext.buttons_color) + Appearance { + container: Default::default(), + scrollbar: Scrollbar { + background: Some(Background::Color(Color { + a: ext.alpha_round_borders, + ..ext.buttons_color + })), + scroller: Scroller { + color: if is_mouse_over_scrollbar { + colors.secondary + } else { + mix_colors(colors.secondary, ext.buttons_color) + }, + border: Border { + radius: BORDER_ROUNDED_RADIUS.into(), + width: 0.0, + color: Color::TRANSPARENT, + }, + }, + border: Border { + radius: BORDER_ROUNDED_RADIUS.into(), + width: 0.0, + color: Color::TRANSPARENT, }, - border_radius: BORDER_ROUNDED_RADIUS.into(), - border_width: 0.0, - border_color: Color::TRANSPARENT, }, + gap: None, } } } diff --git a/src/gui/styles/style_constants.rs b/src/gui/styles/style_constants.rs index 64fc09a7..720ff6b8 100644 --- a/src/gui/styles/style_constants.rs +++ b/src/gui/styles/style_constants.rs @@ -1,6 +1,6 @@ //! Module defining the constants used for aesthetic purposes (colors, borders...) -use iced::font::{Family, Stretch, Weight}; +use iced::font::{Family, Stretch, Style, Weight}; use iced::{Color, Font}; use crate::gui::app::{FONT_FAMILY_NAME, ICON_FONT_FAMILY_NAME}; @@ -196,7 +196,7 @@ pub const SARASA_MONO_BOLD: Font = Font { family: Family::Name(FONT_FAMILY_NAME), weight: Weight::Bold, stretch: Stretch::Normal, - monospaced: true, + style: Style::Normal, }; pub const SARASA_MONO_BYTES: &[u8] = @@ -205,7 +205,7 @@ pub const SARASA_MONO: Font = Font { family: Family::Name(FONT_FAMILY_NAME), weight: Weight::Normal, stretch: Stretch::Normal, - monospaced: true, + style: Style::Normal, }; //font to display icons diff --git a/src/gui/styles/text.rs b/src/gui/styles/text.rs index 443ba91c..8e6a750e 100644 --- a/src/gui/styles/text.rs +++ b/src/gui/styles/text.rs @@ -28,7 +28,7 @@ impl TextType { subtitle: &str, desc: &str, font: Font, - ) -> Column<'static, Message, Renderer> { + ) -> Column<'static, Message, StyleType> { Column::new() .push( Text::new(format!("{subtitle}:")) diff --git a/src/gui/styles/text_input.rs b/src/gui/styles/text_input.rs index c494068d..fe1f6e83 100644 --- a/src/gui/styles/text_input.rs +++ b/src/gui/styles/text_input.rs @@ -3,7 +3,7 @@ #![allow(clippy::module_name_repetitions)] use iced::widget::text_input::Appearance; -use iced::{Background, Color}; +use iced::{Background, Border, Color}; use crate::gui::styles::style_constants::BORDER_WIDTH; use crate::StyleType; @@ -32,12 +32,14 @@ impl iced::widget::text_input::StyleSheet for StyleType { ..ext.buttons_color }, }), - border_radius: TEXT_INPUT_BORDER_RADIUS.into(), - border_width: BORDER_WIDTH, - border_color: match style { - TextInputType::Badge => Color::TRANSPARENT, - TextInputType::Standard => ext.buttons_color, - TextInputType::Error => Color::new(0.8, 0.15, 0.15, 1.0), + border: Border{ + radius: TEXT_INPUT_BORDER_RADIUS.into(), + width: BORDER_WIDTH, + color: match style { + TextInputType::Badge => Color::TRANSPARENT, + TextInputType::Standard => ext.buttons_color, + TextInputType::Error => Color::new(0.8, 0.15, 0.15, 1.0), + }, }, icon_color: Color { a: if ext.is_nightly { 0.2 } else { 0.7 }, @@ -51,11 +53,13 @@ impl iced::widget::text_input::StyleSheet for StyleType { let is_nightly = self.get_extension().is_nightly; Appearance { background: Background::Color(colors.primary), - border_radius: TEXT_INPUT_BORDER_RADIUS.into(), - border_width: BORDER_WIDTH, - border_color: match style { - TextInputType::Error => Color::new(0.8, 0.15, 0.15, 1.0), - _ => colors.secondary, + border: Border{ + radius: TEXT_INPUT_BORDER_RADIUS.into(), + width: BORDER_WIDTH, + color: match style { + TextInputType::Error => Color::new(0.8, 0.15, 0.15, 1.0), + _ => colors.secondary, + }, }, icon_color: Color { a: if is_nightly { 0.2 } else { 0.7 }, @@ -103,11 +107,13 @@ impl iced::widget::text_input::StyleSheet for StyleType { TextInputType::Badge => Color::TRANSPARENT, _ => ext.buttons_color, }), - border_radius: TEXT_INPUT_BORDER_RADIUS.into(), - border_width: BORDER_WIDTH, - border_color: match style { - TextInputType::Error => Color::new(0.8, 0.15, 0.15, 1.0), - _ => colors.secondary, + border: Border{ + radius: TEXT_INPUT_BORDER_RADIUS.into(), + width: BORDER_WIDTH, + color: match style { + TextInputType::Error => Color::new(0.8, 0.15, 0.15, 1.0), + _ => colors.secondary, + }, }, icon_color: Color { a: if ext.is_nightly { 0.2 } else { 0.7 }, @@ -127,15 +133,17 @@ impl iced::widget::text_input::StyleSheet for StyleType { ..ext.buttons_color }, }), - border_radius: TEXT_INPUT_BORDER_RADIUS.into(), - border_width: BORDER_WIDTH, - border_color: match style { - TextInputType::Badge => Color::TRANSPARENT, - TextInputType::Standard => Color { - a: ext.alpha_round_borders, - ..ext.buttons_color + border: Border{ + radius: TEXT_INPUT_BORDER_RADIUS.into(), + width: BORDER_WIDTH, + color: match style { + TextInputType::Badge => Color::TRANSPARENT, + TextInputType::Standard => Color { + a: ext.alpha_round_borders, + ..ext.buttons_color + }, + TextInputType::Error => Color::new(0.8, 0.15, 0.15, ext.alpha_round_borders), }, - TextInputType::Error => Color::new(0.8, 0.15, 0.15, ext.alpha_round_borders), }, icon_color: Color { a: if ext.is_nightly { 0.2 } else { 0.7 }, diff --git a/src/gui/styles/toggler.rs b/src/gui/styles/toggler.rs index 73b6ca69..c3c3d056 100644 --- a/src/gui/styles/toggler.rs +++ b/src/gui/styles/toggler.rs @@ -4,6 +4,7 @@ use iced::widget::toggler::Appearance; use iced::Color; +use crate::gui::styles::style_constants::BORDER_WIDTH; use crate::StyleType; @@ -28,13 +29,15 @@ impl iced::widget::toggler::StyleSheet for StyleType { } else { ext.buttons_color }, - background_border: Some(ext.buttons_color), + background_border_width: BORDER_WIDTH, foreground: colors.primary, - foreground_border: Some(if is_active { + foreground_border_width: BORDER_WIDTH, + background_border_color: ext.buttons_color, + foreground_border_color: if is_active { colors.secondary } else { ext.buttons_color - }), + } } } @@ -50,13 +53,15 @@ impl iced::widget::toggler::StyleSheet for StyleType { } else { ext.buttons_color }, - background_border: Some(colors.secondary), + background_border_width: BORDER_WIDTH, foreground: colors.primary, - foreground_border: Some(if is_active { + foreground_border_width: BORDER_WIDTH, + background_border_color: colors.secondary, + foreground_border_color: if is_active { colors.secondary } else { ext.buttons_color - }), + } } } } diff --git a/src/gui/types/message.rs b/src/gui/types/message.rs index 3a85881d..410ab6f8 100644 --- a/src/gui/types/message.rs +++ b/src/gui/types/message.rs @@ -96,9 +96,9 @@ pub enum Message { /// Set UI scale factor ChangeScaleFactor(f64), /// The app window position has been changed - WindowMoved(i32, i32), + WindowMoved(f32, f32), /// The app window size has been changed - WindowResized(u32, u32), + WindowResized(f32, f32), /// The country MMDB custom path has been updated CustomCountryDb(String), /// The ASN MMDB custom path has been updated diff --git a/src/gui/types/sniffer.rs b/src/gui/types/sniffer.rs index f8c478d4..ad3aadce 100644 --- a/src/gui/types/sniffer.rs +++ b/src/gui/types/sniffer.rs @@ -7,6 +7,7 @@ use std::sync::{Arc, Mutex}; use std::thread; use iced::{window, Command}; +use iced::window::Id; use pcap::Device; use rfd::FileHandle; @@ -277,8 +278,8 @@ impl Sniffer { #[allow(clippy::cast_possible_truncation, clippy::cast_sign_loss)] Message::WindowResized(width, height) => { let scale_factor = self.configs.lock().unwrap().settings.scale_factor; - let scaled_width = (f64::from(width) * scale_factor) as u32; - let scaled_height = (f64::from(height) * scale_factor) as u32; + let scaled_width = width * scale_factor as f32; + let scaled_height = height * scale_factor as f32; self.configs.lock().unwrap().window.size = (scaled_width, scaled_height); } Message::CustomCountryDb(db) => { @@ -294,7 +295,7 @@ impl Sniffer { // } Message::CloseRequested => { self.configs.lock().unwrap().clone().store(); - return window::close(); + return window::close(Id::MAIN); } Message::CopyIp(string) => { self.timing_events.copy_ip_now(string.clone()); diff --git a/src/main.rs b/src/main.rs index 0df1b33c..e20ef155 100644 --- a/src/main.rs +++ b/src/main.rs @@ -4,10 +4,11 @@ use std::sync::{Arc, Mutex}; use std::{panic, process, thread}; +use std::borrow::Cow; #[cfg(target_os = "linux")] use iced::window::PlatformSpecific; -use iced::{window, Application, Font, Settings}; +use iced::{window, Application, Font, Settings, Pixels}; use chart::types::chart_type::ChartType; use chart::types::traffic_chart::TrafficChart; @@ -28,9 +29,10 @@ use report::types::report_sort_type::ReportSortType; use translations::types::language::Language; use utils::formatted_strings::print_cli_welcome_message; -use crate::configs::types::config_window::{ConfigWindow, ToPosition}; +use crate::configs::types::config_window::{ConfigWindow, ToPosition, ToSize}; use crate::configs::types::configs::Configs; use crate::gui::app::FONT_FAMILY_NAME; +use crate::gui::styles::style_constants::{ICONS_BYTES, SARASA_MONO_BOLD_BYTES, SARASA_MONO_BYTES}; use crate::secondary_threads::check_updates::set_newer_release_status; mod chart; @@ -91,9 +93,9 @@ pub fn main() -> iced::Result { // id needed for Linux Wayland; should match StartupWMClass in .desktop file; see issue #292 id: Some(String::from(SNIFFNET_LOWERCASE)), window: window::Settings { - size, // start size + size: size.to_size(), // start size position: position.to_position(), - min_size: Some((800, 500)), // min size allowed + min_size: Some((800.0, 500.0).to_size()), // min size allowed max_size: None, visible: true, resizable: true, @@ -104,12 +106,13 @@ pub fn main() -> iced::Result { platform_specific: PlatformSpecific { application_id: String::from(SNIFFNET_LOWERCASE), }, + exit_on_close_request: false, ..Default::default() }, flags: Sniffer::new(&configs1, newer_release_available1), + fonts: vec![Cow::Borrowed(SARASA_MONO_BYTES), Cow::Borrowed(SARASA_MONO_BOLD_BYTES), Cow::Borrowed(ICONS_BYTES)], default_font: Font::with_name(FONT_FAMILY_NAME), - default_text_size: FONT_SIZE_BODY, + default_text_size: Pixels(FONT_SIZE_BODY), antialiasing: false, - exit_on_close_request: false, }) } diff --git a/src/networking/types/my_link_type.rs b/src/networking/types/my_link_type.rs index 7aff1c2f..674ec77e 100644 --- a/src/networking/types/my_link_type.rs +++ b/src/networking/types/my_link_type.rs @@ -61,7 +61,7 @@ impl MyLinkType { self, language: Language, font: Font, - ) -> Column<'static, Message, Renderer> { + ) -> Column<'static, Message, StyleType> { match self { Self::Null(l) | Self::Ethernet(l) diff --git a/src/notifications/types/sound.rs b/src/notifications/types/sound.rs index a0c16d45..5a60b6fe 100644 --- a/src/notifications/types/sound.rs +++ b/src/notifications/types/sound.rs @@ -3,7 +3,7 @@ use std::thread; use iced::alignment::{Horizontal, Vertical}; use iced::widget::Text; -use iced::{Font, Length, Renderer}; +use iced::{Font, Length, Renderer, Theme}; use rodio::{Decoder, OutputStream, Sink}; use serde::{Deserialize, Serialize}; @@ -43,7 +43,7 @@ impl Sound { } } - pub fn get_text(self, font: Font) -> iced::widget::Text<'static, Renderer> { + pub fn get_text(self, font: Font) -> iced::widget::Text<'static, StyleType> { match self { Sound::Gulp => Text::new("Gulp").font(font), Sound::Pop => Text::new("Pop").font(font), diff --git a/src/report/types/report_sort_type.rs b/src/report/types/report_sort_type.rs index b435e9cc..d5a321aa 100644 --- a/src/report/types/report_sort_type.rs +++ b/src/report/types/report_sort_type.rs @@ -1,7 +1,7 @@ use std::fmt::Debug; use iced::widget::Text; -use iced::Renderer; +use iced::{Renderer, Theme}; use crate::gui::styles::button::ButtonType; use crate::gui::styles::types::style_type::StyleType; @@ -31,7 +31,7 @@ impl ReportSortType { } } - pub fn icon(self, report_col: &ReportCol) -> Text<'static, Renderer> { + pub fn icon(self, report_col: &ReportCol) -> Text<'static, StyleType> { match report_col { ReportCol::Bytes => self.byte_sort.icon(), ReportCol::Packets => self.packet_sort.icon(), diff --git a/src/report/types/sort_type.rs b/src/report/types/sort_type.rs index 3f514674..aefb0da7 100644 --- a/src/report/types/sort_type.rs +++ b/src/report/types/sort_type.rs @@ -2,7 +2,7 @@ use crate::gui::styles::button::ButtonType; use crate::gui::styles::types::style_type::StyleType; use crate::utils::types::icon::Icon; use iced::widget::Text; -use iced::Renderer; +use iced::{Renderer, Theme}; #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Default)] pub enum SortType { @@ -21,7 +21,7 @@ impl SortType { } } - pub fn icon(self) -> Text<'static, Renderer> { + pub fn icon(self) -> Text<'static, StyleType> { let mut size = 14; match self { SortType::Ascending => Icon::SortAscending, diff --git a/src/translations/translations.rs b/src/translations/translations.rs index 5e3579de..6d0a64a9 100644 --- a/src/translations/translations.rs +++ b/src/translations/translations.rs @@ -1,12 +1,12 @@ // EXTRA NEEDED CHARACTERS: Б use iced::widget::Text; -use iced::Renderer; +use iced::{Renderer, Theme}; use crate::translations::types::language::Language; use crate::StyleType; -pub fn choose_adapters_translation(language: Language) -> Text<'static, Renderer> { +pub fn choose_adapters_translation(language: Language) -> Text<'static, StyleType> { Text::new(match language { Language::EN => "Select network adapter to inspect", Language::IT => "Seleziona la scheda di rete da ispezionare", @@ -54,7 +54,7 @@ pub fn choose_adapters_translation(language: Language) -> Text<'static, Renderer // } // } -pub fn select_filters_translation(language: Language) -> Text<'static, Renderer> { +pub fn select_filters_translation(language: Language) -> Text<'static, StyleType> { Text::new(match language { Language::EN => "Select filters to be applied on network traffic", Language::IT => "Seleziona i filtri da applicare al traffico di rete", @@ -212,7 +212,7 @@ pub fn protocol_translation(language: Language) -> &'static str { } } -pub fn traffic_rate_translation(language: Language) -> Text<'static, Renderer> { +pub fn traffic_rate_translation(language: Language) -> Text<'static, StyleType> { Text::new(match language { Language::EN => "Traffic rate", Language::IT => "Intensità del traffico", @@ -236,7 +236,7 @@ pub fn traffic_rate_translation(language: Language) -> Text<'static, Renderer Text<'static, Renderer> { +// pub fn relevant_connections_translation(language: Language) -> Text<'static, StyleType>> { // Text::new(match language { // Language::EN => "Relevant connections:", // Language::IT => "Connessioni rilevanti:", @@ -282,7 +282,7 @@ pub fn settings_translation(language: Language) -> &'static str { } } -pub fn yes_translation(language: Language) -> Text<'static, Renderer> { +pub fn yes_translation(language: Language) -> Text<'static, StyleType> { Text::new(match language { Language::EN => "Yes", Language::IT => "Sì", @@ -305,7 +305,7 @@ pub fn yes_translation(language: Language) -> Text<'static, Renderer> }) } -pub fn ask_quit_translation(language: Language) -> Text<'static, Renderer> { +pub fn ask_quit_translation(language: Language) -> Text<'static, StyleType> { Text::new(match language { Language::EN => "Are you sure you want to quit this analysis?", Language::IT => "Sei sicuro di voler interrompere questa analisi?", @@ -353,7 +353,7 @@ pub fn quit_analysis_translation(language: Language) -> String { } } -pub fn ask_clear_all_translation(language: Language) -> Text<'static, Renderer> { +pub fn ask_clear_all_translation(language: Language) -> Text<'static, StyleType> { Text::new(match language { Language::EN => "Are you sure you want to clear notifications?", Language::IT => "Sei sicuro di voler eliminare le notifiche?", @@ -449,10 +449,7 @@ pub fn network_adapter_translation(language: Language) -> &'static str { } } -pub fn no_addresses_translation( - language: Language, - adapter: &str, -) -> Text<'static, Renderer> { +pub fn no_addresses_translation(language: Language, adapter: &str) -> Text<'static, StyleType> { let network_adapter_translation = network_adapter_translation(language); Text::new(match language { Language::EN => format!("No traffic can be observed because the adapter you selected has no active addresses...\n\n\ @@ -515,10 +512,7 @@ pub fn no_addresses_translation( }) } -pub fn waiting_translation( - language: Language, - adapter: &str, -) -> Text<'static, Renderer> { +pub fn waiting_translation(language: Language, adapter: &str) -> Text<'static, StyleType> { let network_adapter_translation = network_adapter_translation(language); Text::new(match language { Language::EN => format!("No traffic has been observed yet. Waiting for network packets...\n\n\ @@ -582,10 +576,7 @@ pub fn waiting_translation( }) } -pub fn some_observed_translation( - language: Language, - observed: u128, -) -> Text<'static, Renderer> { +pub fn some_observed_translation(language: Language, observed: u128) -> Text<'static, StyleType> { Text::new(match language { Language::EN => format!("Total intercepted packets: {observed}\n\n\ Filtered packets: 0\n\n\ @@ -733,7 +724,7 @@ pub fn of_total_translation(language: Language, percentage: &str) -> String { } } -// pub fn filtered_application_translation(language: Language) -> Text<'static, Renderer> { +// pub fn filtered_application_translation(language: Language) -> Text<'static,StyleType>> { // Text::new(match language { // Language::EN => "Filtered packets per application protocol:", // Language::IT => "Pacchetti filtrati per protocollo applicativo:", @@ -755,7 +746,7 @@ pub fn of_total_translation(language: Language, percentage: &str) -> String { // }) // } -// pub fn no_favorites_translation(language: Language) -> Text<'static, Renderer> { +// pub fn no_favorites_translation(language: Language) -> Text<'static, StyleType>> { // Text::new(match language { // Language::EN => "Nothing to show at the moment.\n\ // To add a connection to your favorites, click on the star symbol near the connection.", @@ -794,7 +785,7 @@ pub fn of_total_translation(language: Language, percentage: &str) -> String { // }) // } -pub fn error_translation(language: Language, error: &str) -> Text<'static, Renderer> { +pub fn error_translation(language: Language, error: &str) -> Text<'static, StyleType> { Text::new(match language { Language::EN => format!( "An error occurred! \n\n\ @@ -1119,7 +1110,7 @@ pub fn bytes_chart_translation(language: Language) -> &'static str { // } // } -pub fn notifications_title_translation(language: Language) -> Text<'static, Renderer> { +pub fn notifications_title_translation(language: Language) -> Text<'static, StyleType> { Text::new(match language { Language::EN => "Customize your notifications", Language::IT => "Personalizza le tue notifiche", @@ -1143,7 +1134,7 @@ pub fn notifications_title_translation(language: Language) -> Text<'static, Rend }) } -pub fn appearance_title_translation(language: Language) -> Text<'static, Renderer> { +pub fn appearance_title_translation(language: Language) -> Text<'static, StyleType> { Text::new(match language { Language::EN => "Choose your favorite theme", Language::IT => "Scegli il tuo tema preferito", @@ -1774,7 +1765,7 @@ pub fn favorite_transmitted_translation(language: Language) -> &'static str { } } -pub fn no_notifications_set_translation(language: Language) -> Text<'static, Renderer> { +pub fn no_notifications_set_translation(language: Language) -> Text<'static, StyleType> { Text::new(match language { Language::EN => "You haven't enabled notifications yet!\n\n\ After enabling them, this page will display a log of your notifications\n\n\ @@ -1836,9 +1827,7 @@ pub fn no_notifications_set_translation(language: Language) -> Text<'static, Ren }) } -pub fn no_notifications_received_translation( - language: Language, -) -> Text<'static, Renderer> { +pub fn no_notifications_received_translation(language: Language) -> Text<'static, StyleType> { Text::new(match language { Language::EN => { "Nothing to see at the moment...\n\n\ diff --git a/src/translations/translations_3.rs b/src/translations/translations_3.rs index b6ed4ca1..5fdb1840 100644 --- a/src/translations/translations_3.rs +++ b/src/translations/translations_3.rs @@ -1,7 +1,7 @@ #![allow(clippy::match_same_arms)] use iced::widget::Text; -use iced::Renderer; +use iced::{Renderer, Theme}; use crate::translations::translations::network_adapter_translation; use crate::{Language, StyleType}; @@ -105,7 +105,7 @@ pub fn link_type_translation(language: Language) -> &'static str { pub fn unsupported_link_type_translation( language: Language, adapter: &str, -) -> Text<'static, Renderer> { +) -> Text<'static, StyleType> { let mut string = match language { Language::EN => "The link type associated with this adapter is not supported by Sniffnet yet...", Language::ES => "La conexión asociada con este adaptador aún no esta implementada en Sniffnet...", diff --git a/src/translations/types/language.rs b/src/translations/types/language.rs index bfa62e60..87ee8dfe 100644 --- a/src/translations/types/language.rs +++ b/src/translations/types/language.rs @@ -2,7 +2,7 @@ use std::fmt; use iced::widget::svg::Handle; use iced::widget::Svg; -use iced::{Length, Renderer}; +use iced::{Length, Renderer, Theme}; use serde::{Deserialize, Serialize}; use crate::countries::flags_pictures::{ @@ -81,7 +81,7 @@ impl Language { Language::ZH, ]; - pub fn get_flag(self) -> Svg> { + pub fn get_flag(self) -> Svg { Svg::new(Handle::from_memory(Vec::from(match self { Language::ZH => CN, Language::DE => DE, diff --git a/src/utils/types/icon.rs b/src/utils/types/icon.rs index 6b2d6044..302d53e9 100644 --- a/src/utils/types/icon.rs +++ b/src/utils/types/icon.rs @@ -1,5 +1,5 @@ use iced::widget::Text; -use iced::Renderer; +use iced::{Renderer, Theme}; use crate::gui::styles::style_constants::ICONS; use crate::StyleType; @@ -85,11 +85,11 @@ impl Icon { } } - pub fn to_text(&self) -> iced::widget::Text<'static, Renderer> { + pub fn to_text(&self) -> iced::widget::Text<'static, StyleType> { Text::new(self.codepoint().to_string()).font(ICONS) } - pub fn get_hourglass(num: usize) -> iced::widget::Text<'static, Renderer> { + pub fn get_hourglass(num: usize) -> iced::widget::Text<'static, StyleType> { match num { 1 => Icon::Hourglass1.to_text(), 2 => Icon::Hourglass2.to_text(), From 5b51e74bfb47a97841a334c7f7a45c3a8b1871a4 Mon Sep 17 00:00:00 2001 From: Giuliano Bellini s294739 Date: Mon, 26 Feb 2024 23:54:59 +0100 Subject: [PATCH 02/12] fix shadows, header, footer --- src/configs/types/config_window.rs | 4 +-- src/gui/app.rs | 13 +++------ src/gui/components/button.rs | 4 ++- src/gui/components/footer.rs | 16 ++++++----- src/gui/components/header.rs | 35 ++++++++++------------- src/gui/styles/button.rs | 45 ++++++++++++++++++++++-------- src/gui/styles/checkbox.rs | 2 +- src/gui/styles/container.rs | 6 ++-- src/gui/styles/picklist.rs | 6 ++-- src/gui/styles/text_input.rs | 8 +++--- src/gui/styles/toggler.rs | 6 ++-- src/gui/types/message.rs | 2 -- src/gui/types/sniffer.rs | 4 +-- src/main.rs | 10 +++++-- 14 files changed, 90 insertions(+), 71 deletions(-) diff --git a/src/configs/types/config_window.rs b/src/configs/types/config_window.rs index cde2b0f7..f78fc51b 100644 --- a/src/configs/types/config_window.rs +++ b/src/configs/types/config_window.rs @@ -58,9 +58,9 @@ pub trait ToSize { impl ToSize for (f32, f32) { fn to_size(self) -> Size { - Size{ + Size { width: self.0, - height: self.1 + height: self.1, } } } diff --git a/src/gui/app.rs b/src/gui/app.rs index c04a3c96..2d2d977a 100644 --- a/src/gui/app.rs +++ b/src/gui/app.rs @@ -46,14 +46,7 @@ impl Application for Sniffer { type Flags = Sniffer; fn new(flags: Sniffer) -> (Sniffer, Command) { - ( - flags, - Command::batch(vec![ - // font::load(SARASA_MONO_BOLD_BYTES).map(Message::FontLoaded), - // font::load(SARASA_MONO_BYTES).map(Message::FontLoaded), - // font::load(ICONS_BYTES).map(Message::FontLoaded), - ]), - ) + (flags, Command::none()) } fn title(&self) -> String { @@ -135,7 +128,9 @@ impl Application for Sniffer { const NO_MODIFIER: Modifiers = Modifiers::empty(); let window_events_subscription = iced::event::listen_with(|event, _| match event { Window(Id::MAIN, window::Event::Focused) => Some(Message::WindowFocused), - Window(Id::MAIN, window::Event::Moved { x, y }) => Some(Message::WindowMoved(x as f32, y as f32)), + Window(Id::MAIN, window::Event::Moved { x, y }) => { + Some(Message::WindowMoved(x as f32, y as f32)) + } Window(Id::MAIN, window::Event::Resized { width, height }) => { Some(Message::WindowResized(width as f32, height as f32)) } diff --git a/src/gui/components/button.rs b/src/gui/components/button.rs index 6610ae15..762e26f2 100644 --- a/src/gui/components/button.rs +++ b/src/gui/components/button.rs @@ -1,6 +1,7 @@ #![allow(clippy::module_name_repetitions)] use iced::alignment::{Horizontal, Vertical}; +use iced::widget::text::LineHeight; use iced::widget::tooltip::Position; use iced::widget::{button, Text, Tooltip}; use iced::{Font, Length, Renderer, Theme}; @@ -23,7 +24,8 @@ pub fn button_hide( .font(font) .vertical_alignment(Vertical::Center) .horizontal_alignment(Horizontal::Center) - .size(15), + .size(15) + .line_height(LineHeight::Relative(1.0)), ) .padding(2) .height(Length::Fixed(20.0)) diff --git a/src/gui/components/footer.rs b/src/gui/components/footer.rs index c39976af..00b2e96d 100644 --- a/src/gui/components/footer.rs +++ b/src/gui/components/footer.rs @@ -3,6 +3,7 @@ use std::sync::{Arc, Mutex}; use iced::alignment::{Horizontal, Vertical}; +use iced::widget::text::LineHeight; use iced::widget::tooltip::Position; use iced::widget::{button, Container, Row, Text, Tooltip}; use iced::widget::{horizontal_space, Space}; @@ -33,7 +34,6 @@ pub fn footer( let footer_row = Row::new() .spacing(10) - .width(Length::Fill) .padding([0, 20]) .align_items(Alignment::Center) .push(release_details_row) @@ -50,9 +50,7 @@ pub fn footer( Container::new(footer_row) .height(Length::Fixed(45.0)) - .width(Length::Fill) .align_y(Vertical::Center) - .align_x(Horizontal::Center) .style(ContainerType::Gradient(color_gradient)) } @@ -62,7 +60,8 @@ fn get_button_website(font: Font) -> Tooltip<'static, Message, StyleType> { .to_text() .size(17) .horizontal_alignment(Horizontal::Center) - .vertical_alignment(Vertical::Center), + .vertical_alignment(Vertical::Center) + .line_height(LineHeight::Relative(1.0)), ) .height(Length::Fixed(30.0)) .width(Length::Fixed(30.0)) @@ -78,7 +77,8 @@ fn get_button_github(font: Font) -> Tooltip<'static, Message, StyleType> { .to_text() .size(26) .horizontal_alignment(Horizontal::Center) - .vertical_alignment(Vertical::Center), + .vertical_alignment(Vertical::Center) + .line_height(LineHeight::Relative(1.0)), ) .height(Length::Fixed(40.0)) .width(Length::Fixed(40.0)) @@ -95,7 +95,8 @@ fn get_button_sponsor(font: Font) -> Tooltip<'static, Message, StyleType> { .size(23) .style(TextType::Sponsor) .horizontal_alignment(Horizontal::Center) - .vertical_alignment(Vertical::Center), + .vertical_alignment(Vertical::Center) + .line_height(LineHeight::Relative(1.0)), ) .padding([2, 0, 0, 0]) .height(Length::Fixed(30.0)) @@ -129,7 +130,8 @@ fn get_release_details( .style(TextType::Danger) .size(28) .horizontal_alignment(Horizontal::Center) - .vertical_alignment(Vertical::Center), + .vertical_alignment(Vertical::Center) + .line_height(LineHeight::Relative(0.8)), ) .padding(0) .height(Length::Fixed(35.0)) diff --git a/src/gui/components/header.rs b/src/gui/components/header.rs index 828cc0ea..3a845218 100644 --- a/src/gui/components/header.rs +++ b/src/gui/components/header.rs @@ -3,7 +3,7 @@ use iced::alignment::{Horizontal, Vertical}; use iced::widget::text::LineHeight; use iced::widget::tooltip::Position; -use iced::widget::{button, Container, Row, Text, Tooltip}; +use iced::widget::{button, horizontal_space, Container, Row, Space, Text, Tooltip}; use iced::Length::FillPortion; use iced::{Alignment, Font, Length, Renderer, Theme}; @@ -24,37 +24,31 @@ pub fn header( ) -> Container<'static, Message, StyleType> { let logo = Icon::Sniffnet .to_text() - .horizontal_alignment(Horizontal::Center) .vertical_alignment(Vertical::Center) - .width(FillPortion(6)) .height(Length::Fill) - .line_height(LineHeight::Relative(1.0)) - .size(100); + .line_height(LineHeight::Relative(0.8)) + .size(95); Container::new( Row::new() - .height(Length::Fill) - .width(Length::Fill) + .padding([0, 20]) .align_items(Alignment::Center) .push(if back_button { Container::new(get_button_reset(font, language)) - .width(FillPortion(1)) - .align_x(Horizontal::Center) } else { - Container::new(Row::new()) - .width(FillPortion(1)) - .align_x(Horizontal::Center) + Container::new(Space::with_width(60)) }) + .push(horizontal_space()) .push(logo) - .push( - Container::new(get_button_settings(font, language, last_opened_setting)) - .width(FillPortion(1)) - .align_x(Horizontal::Center), - ), + .push(horizontal_space()) + .push(Container::new(get_button_settings( + font, + language, + last_opened_setting, + ))), ) - .height(Length::Fixed(95.0)) + .height(Length::Fixed(90.0)) .align_y(Vertical::Center) - .width(Length::Fill) .style(ContainerType::Gradient(color_gradient)) } @@ -64,7 +58,8 @@ fn get_button_reset(font: Font, language: Language) -> Tooltip<'static, Message, .to_text() .size(20) .horizontal_alignment(Horizontal::Center) - .vertical_alignment(Vertical::Center), + .vertical_alignment(Vertical::Center) + .line_height(LineHeight::Relative(1.0)), ) .padding(10) .height(Length::Fixed(40.0)) diff --git a/src/gui/styles/button.rs b/src/gui/styles/button.rs index 720907d3..d9e7555e 100644 --- a/src/gui/styles/button.rs +++ b/src/gui/styles/button.rs @@ -4,7 +4,7 @@ use iced::widget::button; use iced::widget::button::Appearance; -use iced::{Background, Border, Color, Vector}; +use iced::{Background, Border, Color, Shadow, Vector}; use crate::gui::styles::style_constants::{BORDER_BUTTON_RADIUS, BORDER_WIDTH}; use crate::gui::styles::types::gradient_type::{ @@ -59,10 +59,12 @@ impl button::StyleSheet for StyleType { )), _ => Background::Color(ext.buttons_color), }), - border: Border{ + border: Border { radius: match style { ButtonType::Neutral => 0.0.into(), - ButtonType::TabActive | ButtonType::TabInactive => [0.0, 0.0, 30.0, 30.0].into(), + ButtonType::TabActive | ButtonType::TabInactive => { + [0.0, 0.0, 30.0, 30.0].into() + } ButtonType::BorderedRound | ButtonType::BorderedRoundSelected => 12.0.into(), ButtonType::Starred | ButtonType::NotStarred => 100.0.into(), _ => BORDER_BUTTON_RADIUS.into(), @@ -101,7 +103,14 @@ impl button::StyleSheet for StyleType { ButtonType::Gradient(_) => colors.text_headers, _ => colors.text_body, }, - shadow: Default::default() + shadow: match style { + ButtonType::TabActive | ButtonType::TabInactive => Shadow { + color: Color::BLACK, + offset: Vector::new(3.0, 2.0), + blur_radius: 5.0, + }, + _ => Shadow::default(), + }, } } @@ -116,6 +125,19 @@ impl button::StyleSheet for StyleType { ButtonType::TabActive | ButtonType::TabInactive => Vector::new(3.0, 3.0), _ => Vector::new(0.0, 2.0), }, + shadow: match style { + ButtonType::Neutral | ButtonType::SortArrows | ButtonType::SortArrowActive => { + Shadow::default() + } + _ => Shadow { + color: Color::BLACK, + offset: match style { + ButtonType::TabActive | ButtonType::TabInactive => Vector::new(3.0, 3.0), + _ => Vector::new(0.0, 2.0), + }, + blur_radius: 5.0, + }, + }, background: Some(match style { ButtonType::Starred => Background::Color(colors.starred), ButtonType::SortArrows | ButtonType::SortArrowActive => { @@ -133,10 +155,12 @@ impl button::StyleSheet for StyleType { ), _ => Background::Color(mix_colors(colors.primary, ext.buttons_color)), }), - border: Border{ + border: Border { radius: match style { ButtonType::Neutral => 0.0.into(), - ButtonType::TabActive | ButtonType::TabInactive => [0.0, 0.0, 30.0, 30.0].into(), + ButtonType::TabActive | ButtonType::TabInactive => { + [0.0, 0.0, 30.0, 30.0].into() + } ButtonType::BorderedRound | ButtonType::BorderedRoundSelected => 12.0.into(), ButtonType::Starred | ButtonType::NotStarred => 100.0.into(), _ => BORDER_BUTTON_RADIUS.into(), @@ -166,7 +190,6 @@ impl button::StyleSheet for StyleType { ButtonType::SortArrowActive | ButtonType::SortArrows => colors.secondary, _ => colors.text_body, }, - shadow: Default::default() } } @@ -190,7 +213,7 @@ impl button::StyleSheet for StyleType { } _ => Background::Color(ext.buttons_color), }), - border: Border{ + border: Border { radius: BORDER_BUTTON_RADIUS.into(), width: BORDER_WIDTH, color: Color { @@ -203,7 +226,7 @@ impl button::StyleSheet for StyleType { a: ext.alpha_chart_badge, ..colors.text_headers }, - shadow: Default::default() + shadow: Shadow::default(), }, ButtonType::Standard => Appearance { shadow_offset: Vector::new(0.0, 0.0), @@ -211,7 +234,7 @@ impl button::StyleSheet for StyleType { a: ext.alpha_chart_badge, ..ext.buttons_color })), - border: Border{ + border: Border { radius: BORDER_BUTTON_RADIUS.into(), width: BORDER_WIDTH, color: Color { @@ -223,7 +246,7 @@ impl button::StyleSheet for StyleType { a: ext.alpha_chart_badge, ..colors.text_body }, - shadow: Default::default() + shadow: Default::default(), }, _ => button::StyleSheet::active(self, style), } diff --git a/src/gui/styles/checkbox.rs b/src/gui/styles/checkbox.rs index 72b8fb82..0897b649 100644 --- a/src/gui/styles/checkbox.rs +++ b/src/gui/styles/checkbox.rs @@ -40,7 +40,7 @@ impl iced::widget::checkbox::StyleSheet for StyleType { Appearance { background: Background::Color(ext.buttons_color), icon_color: colors.text_body, - border: Border{ + border: Border { radius: CHECKBOX_BORDER_RADIUS.into(), width: BORDER_WIDTH, color: colors.secondary, diff --git a/src/gui/styles/container.rs b/src/gui/styles/container.rs index 13c13bf6..b8816974 100644 --- a/src/gui/styles/container.rs +++ b/src/gui/styles/container.rs @@ -3,7 +3,7 @@ #![allow(clippy::module_name_repetitions)] use iced::widget::container::Appearance; -use iced::{Background, Border, Color}; +use iced::{Background, Border, Color, Shadow}; use crate::gui::styles::style_constants::{BORDER_ROUNDED_RADIUS, BORDER_WIDTH}; use crate::gui::styles::types::gradient_type::{get_gradient_headers, GradientType}; @@ -56,7 +56,7 @@ impl iced::widget::container::StyleSheet for StyleType { ContainerType::Modal => Background::Color(colors.primary), ContainerType::Standard => Background::Color(Color::TRANSPARENT), }), - border: Border{ + border: Border { radius: match style { ContainerType::BorderedRound => BORDER_ROUNDED_RADIUS.into(), ContainerType::Modal => { @@ -84,7 +84,7 @@ impl iced::widget::container::StyleSheet for StyleType { }, }, }, - shadow: Default::default() + shadow: Shadow::default(), } } } diff --git a/src/gui/styles/picklist.rs b/src/gui/styles/picklist.rs index 0c766654..12982fb4 100644 --- a/src/gui/styles/picklist.rs +++ b/src/gui/styles/picklist.rs @@ -26,7 +26,7 @@ impl iced::overlay::menu::StyleSheet for StyleType { iced::overlay::menu::Appearance { text_color: colors.text_body, background: Background::Color(ext.buttons_color), - border: Border{ + border: Border { width: BORDER_WIDTH, radius: PICKLIST_BORDER_RADIUS.into(), color: colors.secondary, @@ -48,7 +48,7 @@ impl pick_list::StyleSheet for StyleType { placeholder_color: colors.text_body, handle_color: colors.text_body, background: Background::Color(ext.buttons_color), - border: Border{ + border: Border { radius: PICKLIST_BORDER_RADIUS.into(), width: 0.0, color: Color::TRANSPARENT, @@ -64,7 +64,7 @@ impl pick_list::StyleSheet for StyleType { placeholder_color: colors.text_body, handle_color: colors.text_body, background: Background::Color(mix_colors(ext.buttons_color, colors.primary)), - border: Border{ + border: Border { radius: PICKLIST_BORDER_RADIUS.into(), width: BORDER_WIDTH, color: colors.secondary, diff --git a/src/gui/styles/text_input.rs b/src/gui/styles/text_input.rs index fe1f6e83..1863f5c3 100644 --- a/src/gui/styles/text_input.rs +++ b/src/gui/styles/text_input.rs @@ -32,7 +32,7 @@ impl iced::widget::text_input::StyleSheet for StyleType { ..ext.buttons_color }, }), - border: Border{ + border: Border { radius: TEXT_INPUT_BORDER_RADIUS.into(), width: BORDER_WIDTH, color: match style { @@ -53,7 +53,7 @@ impl iced::widget::text_input::StyleSheet for StyleType { let is_nightly = self.get_extension().is_nightly; Appearance { background: Background::Color(colors.primary), - border: Border{ + border: Border { radius: TEXT_INPUT_BORDER_RADIUS.into(), width: BORDER_WIDTH, color: match style { @@ -107,7 +107,7 @@ impl iced::widget::text_input::StyleSheet for StyleType { TextInputType::Badge => Color::TRANSPARENT, _ => ext.buttons_color, }), - border: Border{ + border: Border { radius: TEXT_INPUT_BORDER_RADIUS.into(), width: BORDER_WIDTH, color: match style { @@ -133,7 +133,7 @@ impl iced::widget::text_input::StyleSheet for StyleType { ..ext.buttons_color }, }), - border: Border{ + border: Border { radius: TEXT_INPUT_BORDER_RADIUS.into(), width: BORDER_WIDTH, color: match style { diff --git a/src/gui/styles/toggler.rs b/src/gui/styles/toggler.rs index c3c3d056..ebf9d20c 100644 --- a/src/gui/styles/toggler.rs +++ b/src/gui/styles/toggler.rs @@ -2,9 +2,9 @@ #![allow(clippy::module_name_repetitions)] +use crate::gui::styles::style_constants::BORDER_WIDTH; use iced::widget::toggler::Appearance; use iced::Color; -use crate::gui::styles::style_constants::BORDER_WIDTH; use crate::StyleType; @@ -37,7 +37,7 @@ impl iced::widget::toggler::StyleSheet for StyleType { colors.secondary } else { ext.buttons_color - } + }, } } @@ -61,7 +61,7 @@ impl iced::widget::toggler::StyleSheet for StyleType { colors.secondary } else { ext.buttons_color - } + }, } } } diff --git a/src/gui/types/message.rs b/src/gui/types/message.rs index 410ab6f8..938761d5 100644 --- a/src/gui/types/message.rs +++ b/src/gui/types/message.rs @@ -89,8 +89,6 @@ pub enum Message { ArrowPressed(bool), /// Emit when the main window be focused WindowFocused, - /// Result after loading a custom font - FontLoaded(Result<(), font::Error>), /// Enable or disable gradients GradientsSelection(GradientType), /// Set UI scale factor diff --git a/src/gui/types/sniffer.rs b/src/gui/types/sniffer.rs index ad3aadce..5741b5ab 100644 --- a/src/gui/types/sniffer.rs +++ b/src/gui/types/sniffer.rs @@ -6,8 +6,8 @@ use std::path::PathBuf; use std::sync::{Arc, Mutex}; use std::thread; -use iced::{window, Command}; use iced::window::Id; +use iced::{window, Command}; use pcap::Device; use rfd::FileHandle; @@ -317,7 +317,7 @@ impl Sniffer { Message::ServiceSortSelection(sort_type) => { self.service_sort_type = sort_type; } - Message::TickInit | Message::FontLoaded(_) => {} + Message::TickInit => {} } Command::none() } diff --git a/src/main.rs b/src/main.rs index e20ef155..02fdcab8 100644 --- a/src/main.rs +++ b/src/main.rs @@ -2,13 +2,13 @@ #![cfg_attr(not(debug_assertions), windows_subsystem = "windows")] +use std::borrow::Cow; use std::sync::{Arc, Mutex}; use std::{panic, process, thread}; -use std::borrow::Cow; #[cfg(target_os = "linux")] use iced::window::PlatformSpecific; -use iced::{window, Application, Font, Settings, Pixels}; +use iced::{window, Application, Font, Pixels, Settings}; use chart::types::chart_type::ChartType; use chart::types::traffic_chart::TrafficChart; @@ -110,7 +110,11 @@ pub fn main() -> iced::Result { ..Default::default() }, flags: Sniffer::new(&configs1, newer_release_available1), - fonts: vec![Cow::Borrowed(SARASA_MONO_BYTES), Cow::Borrowed(SARASA_MONO_BOLD_BYTES), Cow::Borrowed(ICONS_BYTES)], + fonts: vec![ + Cow::Borrowed(SARASA_MONO_BYTES), + Cow::Borrowed(SARASA_MONO_BOLD_BYTES), + Cow::Borrowed(ICONS_BYTES), + ], default_font: Font::with_name(FONT_FAMILY_NAME), default_text_size: Pixels(FONT_SIZE_BODY), antialiasing: false, From bda276f18ec7784e8e97decc94e903800a72b84e Mon Sep 17 00:00:00 2001 From: Giuliano Bellini s294739 Date: Tue, 27 Feb 2024 10:16:55 +0100 Subject: [PATCH 03/12] fix initial page, gradients --- src/gui/pages/initial_page.rs | 73 ++++++++++++++------------- src/gui/styles/button.rs | 6 +-- src/gui/styles/types/gradient_type.rs | 6 +-- 3 files changed, 43 insertions(+), 42 deletions(-) diff --git a/src/gui/pages/initial_page.rs b/src/gui/pages/initial_page.rs index a4b78aa3..3d4bfcbf 100644 --- a/src/gui/pages/initial_page.rs +++ b/src/gui/pages/initial_page.rs @@ -59,41 +59,43 @@ pub fn initial_page(sniffer: &Sniffer) -> Container { let port_active = &sniffer.filters.port_str; let col_port_filter = col_port_input(port_active, font, language); - let filters_pane = Column::new() - .width(FillPortion(6)) - .padding(10) - .spacing(15) - .push( - select_filters_translation(language) - .font(font) - .style(TextType::Title) - .size(FONT_SIZE_TITLE), - ) - .push( - Row::new() - .spacing(20) - .push(col_ip_buttons) - .push(col_protocol_buttons), - ) - .push( - Row::new() - .spacing(20) - .push(col_address_filter) - .push(col_port_filter), - ) - .push(Rule::horizontal(40)) - .push( - Container::new(button_start( - font, - language, - color_gradient, - &sniffer.filters, - )) - .width(Length::Fill) - .height(Length::Fill) - .align_y(Vertical::Center) - .align_x(Horizontal::Center), - ); + let filters_pane = Container::new( + Column::new() + .spacing(15) + .push( + select_filters_translation(language) + .font(font) + .style(TextType::Title) + .size(FONT_SIZE_TITLE), + ) + .push( + Row::new() + .spacing(20) + .push(col_ip_buttons) + .push(col_protocol_buttons), + ) + .push( + Row::new() + .spacing(20) + .push(col_address_filter) + .push(col_port_filter), + ) + .push(Rule::horizontal(40)) + .push( + Container::new(button_start( + font, + language, + color_gradient, + &sniffer.filters, + )) + .width(Length::Fill) + .height(Length::Fill) + .align_y(Vertical::Center) + .align_x(Horizontal::Center), + ), + ) + .width(FillPortion(6)) + .padding(10); let body = Column::new() .push(Space::with_height(Length::Fixed(5.0))) @@ -158,7 +160,6 @@ fn col_protocol_buttons( buttons_row = buttons_row.push( Button::new( Text::new(format!("{option} {check_symbol}")) - .width(Length::Fill) .horizontal_alignment(Horizontal::Center) .vertical_alignment(Vertical::Center) .font(font), diff --git a/src/gui/styles/button.rs b/src/gui/styles/button.rs index d9e7555e..99210442 100644 --- a/src/gui/styles/button.rs +++ b/src/gui/styles/button.rs @@ -107,7 +107,7 @@ impl button::StyleSheet for StyleType { ButtonType::TabActive | ButtonType::TabInactive => Shadow { color: Color::BLACK, offset: Vector::new(3.0, 2.0), - blur_radius: 5.0, + blur_radius: 4.0, }, _ => Shadow::default(), }, @@ -133,9 +133,9 @@ impl button::StyleSheet for StyleType { color: Color::BLACK, offset: match style { ButtonType::TabActive | ButtonType::TabInactive => Vector::new(3.0, 3.0), - _ => Vector::new(0.0, 2.0), + _ => Vector::new(1.0, 1.0), }, - blur_radius: 5.0, + blur_radius: 4.0, }, }, background: Some(match style { diff --git a/src/gui/styles/types/gradient_type.rs b/src/gui/styles/types/gradient_type.rs index 56cb32fa..9b960860 100644 --- a/src/gui/styles/types/gradient_type.rs +++ b/src/gui/styles/types/gradient_type.rs @@ -25,7 +25,7 @@ pub fn get_gradient_headers( Color::WHITE }; Gradient::Linear( - iced::gradient::Linear::new(Degrees(180.0)) + iced::gradient::Linear::new(Degrees(90.0)) .add_stop( 0.0, match gradient_type { @@ -59,7 +59,7 @@ pub fn get_gradient_buttons( Color::WHITE }; Gradient::Linear( - iced::gradient::Linear::new(Degrees(225.0)) + iced::gradient::Linear::new(Degrees(135.0)) .add_stop( 0.0, Color { @@ -92,7 +92,7 @@ pub fn get_gradient_hovered_buttons( Color::WHITE }; Gradient::Linear( - iced::gradient::Linear::new(Degrees(225.0)) + iced::gradient::Linear::new(Degrees(135.0)) .add_stop(0.0, colors.secondary) .add_stop( 1.0, From 6d51ef9fb3a2bf3dbe43a8bc62ed37b83c57da76 Mon Sep 17 00:00:00 2001 From: Giuliano Bellini s294739 Date: Tue, 27 Feb 2024 13:12:40 +0100 Subject: [PATCH 04/12] fix upper overview page, and tabs --- src/chart/types/traffic_chart.rs | 13 +++++---- src/gui/components/tab.rs | 10 ++++--- src/gui/pages/overview_page.rs | 50 ++++++++++++++++++-------------- 3 files changed, 41 insertions(+), 32 deletions(-) diff --git a/src/chart/types/traffic_chart.rs b/src/chart/types/traffic_chart.rs index d974269b..bd428f1a 100644 --- a/src/chart/types/traffic_chart.rs +++ b/src/chart/types/traffic_chart.rs @@ -2,7 +2,7 @@ use iced::alignment::{Horizontal, Vertical}; use iced::widget::{Column, Container}; -use iced::{Element, Renderer, Theme}; +use iced::{Element, Length, Renderer, Theme}; use plotters::prelude::*; use plotters_iced::{Chart, ChartBuilder, ChartWidget, DrawingBackend}; use splines::Spline; @@ -64,7 +64,8 @@ impl TrafficChart { } pub fn view(&self) -> Element { - Container::new(Column::new().push(ChartWidget::new(self))) + Container::new(ChartWidget::new(self)) + .height(Length::Shrink) .align_x(Horizontal::Left) .align_y(Vertical::Bottom) .into() @@ -161,10 +162,10 @@ impl Chart for TrafficChart { } chart_builder - .margin_right(30) - .margin_bottom(0) - .set_label_area_size(LabelAreaPosition::Left, 60) - .set_label_area_size(LabelAreaPosition::Bottom, 50); + .margin_right(25) + .margin_top(6) + .set_label_area_size(LabelAreaPosition::Left, 55) + .set_label_area_size(LabelAreaPosition::Bottom, 40); let x_axis_range = self.x_axis_range(); let y_axis_range = self.y_axis_range(); diff --git a/src/gui/components/tab.rs b/src/gui/components/tab.rs index 6334f901..94d765d7 100644 --- a/src/gui/components/tab.rs +++ b/src/gui/components/tab.rs @@ -71,8 +71,9 @@ fn new_page_tab( unread: Option, ) -> Button<'static, Message, StyleType> { let mut content = Row::new() + .height(Length::Fill) .align_items(Alignment::Center) - .push(Space::with_width(Length::FillPortion(1))) + .push(horizontal_space()) .push( page.icon() .size(15) @@ -112,7 +113,7 @@ fn new_page_tab( } } - content = content.push(Space::with_width(Length::FillPortion(1))); + content = content.push(horizontal_space()); button(content) .height(Length::Fixed(if active { 35.0 } else { 30.0 })) @@ -133,8 +134,9 @@ fn new_settings_tab( font: Font, ) -> Button<'static, Message, StyleType> { let content = Row::new() + .height(Length::Fill) .align_items(Alignment::Center) - .push(Space::with_width(Length::FillPortion(1))) + .push(horizontal_space()) .push( page.icon() .size(15) @@ -159,7 +161,7 @@ fn new_settings_tab( .horizontal_alignment(alignment::Horizontal::Center) .vertical_alignment(alignment::Vertical::Center), ) - .push(Space::with_width(Length::FillPortion(1))); + .push(horizontal_space()); button(content) .height(Length::Fixed(if active { 35.0 } else { 30.0 })) diff --git a/src/gui/pages/overview_page.rs b/src/gui/pages/overview_page.rs index 578e6e40..a986b133 100644 --- a/src/gui/pages/overview_page.rs +++ b/src/gui/pages/overview_page.rs @@ -5,9 +5,11 @@ use iced::alignment::{Horizontal, Vertical}; use iced::widget::scrollable::Direction; +use iced::widget::text::LineHeight; use iced::widget::tooltip::Position; use iced::widget::{ - button, lazy, Button, Column, Container, Row, Rule, Scrollable, Space, Text, Tooltip, + button, horizontal_space, lazy, Button, Column, Container, Row, Rule, Scrollable, Space, Text, + Tooltip, }; use iced::Length::{Fill, FillPortion, Fixed}; use iced::{Alignment, Font, Length, Renderer, Theme}; @@ -242,15 +244,11 @@ fn body_pcap_error( } fn lazy_row_report(sniffer: &Sniffer) -> Container<'static, Message, StyleType> { - let mut row_report = Row::new() - .padding([0, 10, 5, 10]) - .height(Length::Fill) - .width(Length::Fill); - let col_host = col_host(840.0, sniffer); let col_service = col_service(250.0, sniffer); - row_report = row_report + let row_report = Row::new() + .padding([0, 10, 5, 10]) .push(col_host) .push(Rule::vertical(40)) .push(col_service); @@ -301,7 +299,7 @@ fn col_host(width: f32, sniffer: &Sniffer) -> Column<'static, Message, StyleType }) .font(font), ) - .push(Space::with_width(Length::FillPortion(1))) + .push(horizontal_space()) .push( Text::new(if chart_type.eq(&ChartType::Packets) { data_info_host.data_info.tot_packets().to_string() @@ -356,14 +354,15 @@ fn col_host(width: f32, sniffer: &Sniffer) -> Column<'static, Message, StyleType .style(TextType::Title) .size(FONT_SIZE_TITLE), ) - .push(Space::with_width(Length::Fill)) + .push(horizontal_space()) .push(sort_arrows( sniffer.host_sort_type, Message::HostSortSelection, )), ) .push( - Scrollable::new(Container::new(scroll_host).width(Length::Fill)) + Scrollable::new(scroll_host) + .width(Length::Fill) .direction(Direction::Vertical(ScrollbarType::properties())), ) } @@ -395,7 +394,7 @@ fn col_service(width: f32, sniffer: &Sniffer) -> Column<'static, Message, StyleT .push( Row::new() .push(Text::new(service.to_string()).font(font)) - .push(Space::with_width(Length::FillPortion(1))) + .push(horizontal_space()) .push( Text::new(if chart_type.eq(&ChartType::Packets) { data_info.tot_packets().to_string() @@ -446,7 +445,8 @@ fn col_service(width: f32, sniffer: &Sniffer) -> Column<'static, Message, StyleT )), ) .push( - Scrollable::new(Container::new(scroll_service).width(Length::Fill)) + Scrollable::new(scroll_service) + .width(Length::Fill) .direction(Direction::Vertical(ScrollbarType::properties())), ) } @@ -487,15 +487,16 @@ fn lazy_col_info( .height(Length::Fixed(120.0)) .push( Scrollable::new(col_device) - .width(Length::FillPortion(1)) + .width(Length::Fill) .direction(Direction::Horizontal(ScrollbarType::properties())), ) - .push(Rule::vertical(25)) + .push(Container::new(Rule::vertical(25)).height(Length::Shrink)) .push(col_data_representation.width(Length::FillPortion(1))), ) .push(Rule::horizontal(15)) .push( Scrollable::new(col_bytes_packets) + .height(Length::Fill) .width(Length::Fill) .direction(Direction::Vertical(ScrollbarType::properties())), ); @@ -503,7 +504,6 @@ fn lazy_col_info( Container::new(content) .width(Length::Fixed(400.0)) .padding([10, 5, 5, 5]) - .height(Length::Fill) .align_x(Horizontal::Center) .style(ContainerType::BorderedRound) } @@ -525,7 +525,7 @@ fn container_chart(sniffer: &Sniffer, font: Font) -> Container Date: Thu, 29 Feb 2024 21:36:24 +0100 Subject: [PATCH 05/12] update deps to use iced patch and minor shadows improvements --- Cargo.lock | 171 +++++++++++++++++++-------------------- src/gui/styles/button.rs | 13 +-- 2 files changed, 93 insertions(+), 91 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 36e95967..bdb0c216 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -35,9 +35,9 @@ checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" [[package]] name = "ahash" -version = "0.8.9" +version = "0.8.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d713b3834d76b85304d4d525563c1276e2e30dc97cc67bfb4585a4a29fc2c89f" +checksum = "8b79b82693f705137f8fb9b37871d99e4f9a7df12b917eed79c3d3954830a60b" dependencies = [ "cfg-if", "getrandom", @@ -229,7 +229,7 @@ dependencies = [ "regex", "rustc-hash", "shlex", - "syn 2.0.50", + "syn 2.0.52", ] [[package]] @@ -307,7 +307,7 @@ checksum = "965ab7eb5f8f97d2a083c799f3a1b994fc397b2fe2da5d1da1626ce15a39f2b1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.52", ] [[package]] @@ -413,7 +413,7 @@ dependencies = [ "android-tzdata", "iana-time-zone", "num-traits", - "windows-targets 0.52.3", + "windows-targets 0.52.4", ] [[package]] @@ -703,12 +703,12 @@ checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" [[package]] name = "ctor" -version = "0.2.6" +version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30d2b3721e861707777e3195b0158f950ae6dc4a27e4d02ff9f67e3eb3de199e" +checksum = "ad291aa74992b9b7a7e88c38acbbf6ad7e107f1d90ee8775b7bc1fc3394f485c" dependencies = [ "quote", - "syn 2.0.50", + "syn 2.0.52", ] [[package]] @@ -916,9 +916,9 @@ dependencies = [ [[package]] name = "error-code" -version = "3.1.0" +version = "3.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26a147e1a6641a55d994b3e4e9fa4d9b180c8d652c09b363af8c9bf1b8e04139" +checksum = "a0474425d51df81997e2f90a21591180b38eccf27292d755f3e30750225c175b" [[package]] name = "etagere" @@ -1059,7 +1059,7 @@ checksum = "1a5c6c585bc94aaf2c7b51dd4c2ba22680844aba4c687be581871a6f518c5742" dependencies = [ "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.52", ] [[package]] @@ -1140,7 +1140,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.52", ] [[package]] @@ -1437,9 +1437,9 @@ dependencies = [ [[package]] name = "half" -version = "2.3.1" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc52e53916c08643f1b56ec082790d1e86a32e58dc5268f897f313fbae7b4872" +checksum = "b5eceaaeec696539ddaf7b333340f1af35a5aa87ae3e4f3ead0532f72affab2e" dependencies = [ "cfg-if", "crunchy", @@ -1478,9 +1478,9 @@ checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" [[package]] name = "hermit-abi" -version = "0.3.8" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "379dada1584ad501b383485dd706b8afb7a70fcbc7f4da7d780638a5a6124a60" +checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" [[package]] name = "hexf-parse" @@ -1612,9 +1612,9 @@ dependencies = [ [[package]] name = "iced_core" -version = "0.12.1" +version = "0.12.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8f68104cc550807c6c350c13095b1866f08e53c951b540eb122eee67d86b0ab" +checksum = "360b9089214c576de6bc8a46a6864472e10f1f6bc56ff72c42a4d7e192285c91" dependencies = [ "bitflags 2.4.2", "glam", @@ -1740,9 +1740,9 @@ dependencies = [ [[package]] name = "iced_widget" -version = "0.12.1" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86d9065d7880c1156651a54f88366d29e21ed9fd42860b8119e93dcb8f519080" +checksum = "7e01b2212adecf1cb80e2267f302c0e0c263e55f97812056949199ccf9f0b908" dependencies = [ "iced_renderer", "iced_runtime", @@ -1755,9 +1755,9 @@ dependencies = [ [[package]] name = "iced_winit" -version = "0.12.1" +version = "0.12.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2cb4d4e2566f4f5ebf5d818cb57a881fa13972db39d717ebfd9a28acb3be3dd" +checksum = "63f66831d0e399b93f631739121a6171780d344b275d56808b9504d8ca75c7d2" dependencies = [ "iced_graphics", "iced_runtime", @@ -2057,9 +2057,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.20" +version = "0.4.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" +checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" [[package]] name = "lru" @@ -2417,7 +2417,7 @@ dependencies = [ "proc-macro-crate 3.1.0", "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.52", ] [[package]] @@ -2542,7 +2542,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.52", ] [[package]] @@ -2600,7 +2600,7 @@ dependencies = [ "proc-macro2", "proc-macro2-diagnostics", "quote", - "syn 2.0.50", + "syn 2.0.52", ] [[package]] @@ -2632,7 +2632,7 @@ checksum = "e8890702dbec0bad9116041ae586f84805b13eecd1d8b1df27c29998a9969d6d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.52", ] [[package]] @@ -2762,7 +2762,7 @@ dependencies = [ "phf_shared", "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.52", ] [[package]] @@ -2898,7 +2898,7 @@ checksum = "af066a9c399a26e020ada66a034357a868728e72cd426f3adcd35f80d88d88c8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.52", "version_check", "yansi", ] @@ -2950,9 +2950,9 @@ checksum = "9c8a99fddc9f0ba0a85884b8d14e3592853e787d581ca1816c91349b10e4eeab" [[package]] name = "rangemap" -version = "1.5.0" +version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "795915a3930a5d6bafd9053d37602fea3e61be2e5d4d788983a8ba9654c1c6f2" +checksum = "f60fcc7d6849342eff22c4350c8b9a989ee8ceabc4b481253e8946b9fe83d684" [[package]] name = "raw-window-handle" @@ -2974,9 +2974,9 @@ checksum = "3b42e27ef78c35d3998403c1d26f3efd9e135d3e5121b0a4845cc5cc27547f4f" [[package]] name = "read-fonts" -version = "0.15.5" +version = "0.15.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c044ab88c43e2eae05b34a17fc13598736679fdb03d71b49fcfe114443ec8a86" +checksum = "17ea23eedb4d938031b6d4343222444608727a6aa68ec355e13588d9947ffe92" dependencies = [ "font-types", ] @@ -3218,7 +3218,7 @@ dependencies = [ "regex", "relative-path", "rustc_version", - "syn 2.0.50", + "syn 2.0.52", "unicode-ident", ] @@ -3447,7 +3447,7 @@ checksum = "7eb0b34b42edc17f6b7cac84a52a1c5f0e1bb2227e997ca9011ea3dd34e8610b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.52", ] [[package]] @@ -3511,7 +3511,7 @@ checksum = "b93fb4adc70021ac1b47f7d45e8cc4169baaa7ea58483bc5b721d19a26202212" dependencies = [ "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.52", ] [[package]] @@ -3747,9 +3747,9 @@ dependencies = [ [[package]] name = "symphonia" -version = "0.5.3" +version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62e48dba70095f265fdb269b99619b95d04c89e619538138383e63310b14d941" +checksum = "815c942ae7ee74737bb00f965fa5b5a2ac2ce7b6c01c0cc169bbeaf7abd5f5a9" dependencies = [ "lazy_static", "symphonia-bundle-mp3", @@ -3759,11 +3759,10 @@ dependencies = [ [[package]] name = "symphonia-bundle-mp3" -version = "0.5.3" +version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f31d7fece546f1e6973011a9eceae948133bbd18fd3d52f6073b1e38ae6368a" +checksum = "c01c2aae70f0f1fb096b6f0ff112a930b1fb3626178fba3ae68b09dce71706d4" dependencies = [ - "bitflags 1.3.2", "lazy_static", "log", "symphonia-core", @@ -3772,9 +3771,9 @@ dependencies = [ [[package]] name = "symphonia-core" -version = "0.5.3" +version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7c73eb88fee79705268cc7b742c7bc93a7b76e092ab751d0833866970754142" +checksum = "798306779e3dc7d5231bd5691f5a813496dc79d3f56bf82e25789f2094e022c3" dependencies = [ "arrayvec", "bitflags 1.3.2", @@ -3785,9 +3784,9 @@ dependencies = [ [[package]] name = "symphonia-metadata" -version = "0.5.3" +version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89c3e1937e31d0e068bbe829f66b2f2bfaa28d056365279e0ef897172c3320c0" +checksum = "bc622b9841a10089c5b18e99eb904f4341615d5aa55bbf4eedde1be721a4023c" dependencies = [ "encoding_rs", "lazy_static", @@ -3808,9 +3807,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.50" +version = "2.0.52" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74f1bdc9872430ce9b75da68329d1c1746faf50ffac5f19e02b71e37ff881ffb" +checksum = "b699d15b36d1f02c3e7c69f8ffef53de37aefae075d8488d4ba1a7788d574a07" dependencies = [ "proc-macro2", "quote", @@ -3874,9 +3873,9 @@ checksum = "e1fc403891a21bcfb7c37834ba66a547a8f402146eba7265b5a6d88059c9ff2f" [[package]] name = "tempfile" -version = "3.10.0" +version = "3.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a365e8cd18e44762ef95d87f284f4b5cd04107fec2ff3052bd6a3e6069669e67" +checksum = "85b77fafb263dd9d05cbeac119526425676db3784113aa9295c88498cbf8bff1" dependencies = [ "cfg-if", "fastrand", @@ -3910,7 +3909,7 @@ checksum = "a953cb265bef375dae3de6663da4d3804eee9682ea80d8e2542529b73c531c81" dependencies = [ "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.52", ] [[package]] @@ -4078,7 +4077,7 @@ dependencies = [ "serde", "serde_spanned", "toml_datetime", - "winnow 0.6.2", + "winnow 0.6.3", ] [[package]] @@ -4106,7 +4105,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.52", ] [[package]] @@ -4353,7 +4352,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.52", "wasm-bindgen-shared", ] @@ -4387,7 +4386,7 @@ checksum = "642f325be6301eb8107a83d12a8ac6c1e1c54345a7ef1a9261962dfefda09e66" dependencies = [ "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.52", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -4727,7 +4726,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e48a53791691ab099e5e2ad123536d0fff50652600abaf43bbf952894110d0be" dependencies = [ "windows-core", - "windows-targets 0.52.3", + "windows-targets 0.52.4", ] [[package]] @@ -4736,7 +4735,7 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" dependencies = [ - "windows-targets 0.52.3", + "windows-targets 0.52.4", ] [[package]] @@ -4776,7 +4775,7 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "windows-targets 0.52.3", + "windows-targets 0.52.4", ] [[package]] @@ -4811,17 +4810,17 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.52.3" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d380ba1dc7187569a8a9e91ed34b8ccfc33123bbacb8c0aed2d1ad7f3ef2dc5f" +checksum = "7dd37b7e5ab9018759f893a1952c9420d060016fc19a472b4bb20d1bdd694d1b" dependencies = [ - "windows_aarch64_gnullvm 0.52.3", - "windows_aarch64_msvc 0.52.3", - "windows_i686_gnu 0.52.3", - "windows_i686_msvc 0.52.3", - "windows_x86_64_gnu 0.52.3", - "windows_x86_64_gnullvm 0.52.3", - "windows_x86_64_msvc 0.52.3", + "windows_aarch64_gnullvm 0.52.4", + "windows_aarch64_msvc 0.52.4", + "windows_i686_gnu 0.52.4", + "windows_i686_msvc 0.52.4", + "windows_x86_64_gnu 0.52.4", + "windows_x86_64_gnullvm 0.52.4", + "windows_x86_64_msvc 0.52.4", ] [[package]] @@ -4838,9 +4837,9 @@ checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_gnullvm" -version = "0.52.3" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68e5dcfb9413f53afd9c8f86e56a7b4d86d9a2fa26090ea2dc9e40fba56c6ec6" +checksum = "bcf46cf4c365c6f2d1cc93ce535f2c8b244591df96ceee75d8e83deb70a9cac9" [[package]] name = "windows_aarch64_msvc" @@ -4862,9 +4861,9 @@ checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_aarch64_msvc" -version = "0.52.3" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8dab469ebbc45798319e69eebf92308e541ce46760b49b18c6b3fe5e8965b30f" +checksum = "da9f259dd3bcf6990b55bffd094c4f7235817ba4ceebde8e6d11cd0c5633b675" [[package]] name = "windows_i686_gnu" @@ -4886,9 +4885,9 @@ checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_gnu" -version = "0.52.3" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a4e9b6a7cac734a8b4138a4e1044eac3404d8326b6c0f939276560687a033fb" +checksum = "b474d8268f99e0995f25b9f095bc7434632601028cf86590aea5c8a5cb7801d3" [[package]] name = "windows_i686_msvc" @@ -4910,9 +4909,9 @@ checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_i686_msvc" -version = "0.52.3" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28b0ec9c422ca95ff34a78755cfa6ad4a51371da2a5ace67500cf7ca5f232c58" +checksum = "1515e9a29e5bed743cb4415a9ecf5dfca648ce85ee42e15873c3cd8610ff8e02" [[package]] name = "windows_x86_64_gnu" @@ -4934,9 +4933,9 @@ checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnu" -version = "0.52.3" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "704131571ba93e89d7cd43482277d6632589b18ecf4468f591fbae0a8b101614" +checksum = "5eee091590e89cc02ad514ffe3ead9eb6b660aedca2183455434b93546371a03" [[package]] name = "windows_x86_64_gnullvm" @@ -4952,9 +4951,9 @@ checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_gnullvm" -version = "0.52.3" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42079295511643151e98d61c38c0acc444e52dd42ab456f7ccfd5152e8ecf21c" +checksum = "77ca79f2451b49fa9e2af39f0747fe999fcda4f5e241b2898624dca97a1f2177" [[package]] name = "windows_x86_64_msvc" @@ -4976,15 +4975,15 @@ checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "windows_x86_64_msvc" -version = "0.52.3" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0770833d60a970638e989b3fa9fd2bb1aaadcf88963d1659fd7d9990196ed2d6" +checksum = "32b752e52a2da0ddfbdbcc6fceadfeede4c939ed16d13e648833a61dfb611ed8" [[package]] name = "winit" -version = "0.29.10" +version = "0.29.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c824f11941eeae66ec71111cc2674373c772f482b58939bb4066b642aa2ffcf" +checksum = "272be407f804517512fdf408f0fe6c067bf24659a913c61af97af176bfd5aa92" dependencies = [ "ahash", "android-activity", @@ -5039,9 +5038,9 @@ dependencies = [ [[package]] name = "winnow" -version = "0.6.2" +version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a4191c47f15cc3ec71fcb4913cb83d58def65dd3787610213c649283b5ce178" +checksum = "44e19b97e00a4d3db3cdb9b53c8c5f87151b5689b82cc86c2848cbdcccb2689b" dependencies = [ "memchr", ] @@ -5181,5 +5180,5 @@ checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.52", ] diff --git a/src/gui/styles/button.rs b/src/gui/styles/button.rs index 99210442..6eafc053 100644 --- a/src/gui/styles/button.rs +++ b/src/gui/styles/button.rs @@ -91,7 +91,7 @@ impl button::StyleSheet for StyleType { }, shadow_offset: match style { ButtonType::TabActive | ButtonType::TabInactive => Vector::new(3.0, 2.0), - _ => Vector::new(0.0, 0.0), + _ => Vector::default(), }, text_color: match style { ButtonType::Starred => Color::BLACK, @@ -133,9 +133,12 @@ impl button::StyleSheet for StyleType { color: Color::BLACK, offset: match style { ButtonType::TabActive | ButtonType::TabInactive => Vector::new(3.0, 3.0), - _ => Vector::new(1.0, 1.0), + _ => Vector::new(0.0, 2.0), + }, + blur_radius: match style { + ButtonType::TabActive | ButtonType::TabInactive => 4.0, + _ => 2.0, }, - blur_radius: 4.0, }, }, background: Some(match style { @@ -221,7 +224,7 @@ impl button::StyleSheet for StyleType { ..colors.secondary }, }, - shadow_offset: Vector::new(0.0, 0.0), + shadow_offset: Vector::default(), text_color: Color { a: ext.alpha_chart_badge, ..colors.text_headers @@ -229,7 +232,7 @@ impl button::StyleSheet for StyleType { shadow: Shadow::default(), }, ButtonType::Standard => Appearance { - shadow_offset: Vector::new(0.0, 0.0), + shadow_offset: Vector::default(), background: Some(Background::Color(Color { a: ext.alpha_chart_badge, ..ext.buttons_color From 944cc84bd7aa0a2ee75493b80d25be8800407d55 Mon Sep 17 00:00:00 2001 From: Giuliano Bellini s294739 Date: Thu, 7 Mar 2024 00:10:38 +0100 Subject: [PATCH 06/12] fix some inconsistencies --- Cargo.lock | 344 +++++++++++---------------- src/chart/types/traffic_chart.rs | 6 +- src/gui/app.rs | 2 +- src/gui/components/tab.rs | 17 +- src/gui/pages/initial_page.rs | 72 +++--- src/gui/pages/inspect_page.rs | 4 +- src/gui/pages/notifications_page.rs | 17 +- src/gui/pages/settings_style_page.rs | 1 + src/gui/styles/toggler.rs | 38 +-- 9 files changed, 220 insertions(+), 281 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index bdb0c216..e79ee2e5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -35,9 +35,9 @@ checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" [[package]] name = "ahash" -version = "0.8.10" +version = "0.8.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b79b82693f705137f8fb9b37871d99e4f9a7df12b917eed79c3d3954830a60b" +checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" dependencies = [ "cfg-if", "getrandom", @@ -69,14 +69,13 @@ checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" [[package]] name = "alsa" -version = "0.7.1" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2562ad8dcf0f789f65c6fdaad8a8a9708ed6b488e649da28c01656ad66b8b47" +checksum = "37fe60779335388a88c01ac6c3be40304d1e349de3ada3b15f7808bb90fa9dce" dependencies = [ "alsa-sys", - "bitflags 1.3.2", + "bitflags 2.4.2", "libc", - "nix 0.24.3", ] [[package]] @@ -99,14 +98,14 @@ dependencies = [ "bitflags 2.4.2", "cc", "cesu8", - "jni 0.21.1", + "jni", "jni-sys", "libc", "log", - "ndk 0.8.0", + "ndk", "ndk-context", - "ndk-sys 0.5.0+25.2.9519653", - "num_enum 0.7.2", + "ndk-sys", + "num_enum", "thiserror", ] @@ -354,10 +353,11 @@ dependencies = [ [[package]] name = "cc" -version = "1.0.88" +version = "1.0.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02f341c093d19155a6e41631ce5971aac4e9a868262212153124c15fa22d1cdc" +checksum = "a0ba8f7aaa012f30d5b2861462f6708eccd49c3c39863fe083a308035f63d723" dependencies = [ + "jobserver", "libc", ] @@ -406,9 +406,9 @@ checksum = "77e53693616d3075149f4ead59bdeecd204ac6b8192d8969757601b74bddf00f" [[package]] name = "chrono" -version = "0.4.34" +version = "0.4.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5bc015644b92d5890fab7489e49d21f879d5c990186827d42ec511919404f38b" +checksum = "8eaf5903dcbc0a39312feb77df2ff4c76387d591b9fc7b04a238dcf8bb62639a" dependencies = [ "android-tzdata", "iana-time-zone", @@ -424,7 +424,7 @@ checksum = "67523a3b4be3ce1989d607a828d036249522dd9c1c8de7f4dd2dae43a37369d1" dependencies = [ "glob", "libc", - "libloading 0.8.1", + "libloading 0.8.3", ] [[package]] @@ -564,9 +564,9 @@ dependencies = [ [[package]] name = "confy" -version = "0.6.0" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15d296c475c6ed4093824c28e222420831d27577aaaf0a1163a3b7fc35b248a5" +checksum = "45b1f4c00870f07dc34adcac82bb6a72cc5aabca8536ba1797e01df51d2ce9a0" dependencies = [ "directories", "serde", @@ -657,27 +657,25 @@ dependencies = [ [[package]] name = "cpal" -version = "0.15.2" +version = "0.15.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d959d90e938c5493000514b446987c07aed46c668faaa7d34d6c7a67b1a578c" +checksum = "873dab07c8f743075e57f524c583985fbaf745602acbe916a01539364369a779" dependencies = [ "alsa", "core-foundation-sys", "coreaudio-rs", "dasp_sample", - "jni 0.19.0", + "jni", "js-sys", "libc", "mach2", - "ndk 0.7.0", + "ndk", "ndk-context", "oboe", - "once_cell", - "parking_lot 0.12.1", "wasm-bindgen", "wasm-bindgen-futures", "web-sys", - "windows 0.46.0", + "windows 0.54.0", ] [[package]] @@ -717,7 +715,7 @@ version = "3.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b467862cc8610ca6fc9a1532d7777cee0804e678ab45410897b9396495994a0b" dependencies = [ - "nix 0.27.1", + "nix", "windows-sys 0.52.0", ] @@ -734,7 +732,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3e3d747f100290a1ca24b752186f61f6637e1deffe3bf6320de6fcb29510a307" dependencies = [ "bitflags 2.4.2", - "libloading 0.8.1", + "libloading 0.8.3", "winapi", ] @@ -796,7 +794,7 @@ version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "330c60081dcc4c72131f8eb70510f1ac07223e5d4163db481a04a0befcffa412" dependencies = [ - "libloading 0.8.1", + "libloading 0.8.3", ] [[package]] @@ -1464,7 +1462,7 @@ dependencies = [ "bitflags 2.4.2", "com", "libc", - "libloading 0.8.1", + "libloading 0.8.3", "thiserror", "widestring", "winapi", @@ -1490,9 +1488,9 @@ checksum = "dfa686283ad6dd069f105e5ab091b04c62850d3e4cf5d67debad1933f55023df" [[package]] name = "http" -version = "0.2.11" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8947b1a6fad4393052c7ba1f4cd97bed3e953a95c79c92ad9b051a04611d9fbb" +checksum = "601cbb57e577e2f5ef5be8e7b83f0f63994f25aa94d673e54a92d5c516d101f1" dependencies = [ "bytes", "fnv", @@ -1584,7 +1582,7 @@ dependencies = [ "iana-time-zone-haiku", "js-sys", "wasm-bindgen", - "windows-core", + "windows-core 0.52.0", ] [[package]] @@ -1612,9 +1610,9 @@ dependencies = [ [[package]] name = "iced_core" -version = "0.12.2" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "360b9089214c576de6bc8a46a6864472e10f1f6bc56ff72c42a4d7e192285c91" +checksum = "7d7e6bbd197f311ed3d8b71651876b0ce01318fde52cda862a9a7a4373c9b930" dependencies = [ "bitflags 2.4.2", "glam", @@ -1800,9 +1798,9 @@ checksum = "029d73f573d8e8d63e6d5020011d3255b28c3ba85d6cf870a07184ed23de9284" [[package]] name = "indexmap" -version = "2.2.3" +version = "2.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "233cf39063f058ea2caae4091bf4a3ef70a653afbc026f5c4a4135d114e3c177" +checksum = "7b0b929d511467233429c45a44ac1dcaa21ba0f5ba11e4879e6ed28ddb4f9df4" dependencies = [ "equivalent", "hashbrown", @@ -1856,34 +1854,6 @@ version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" -[[package]] -name = "jni" -version = "0.19.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6df18c2e3db7e453d3c6ac5b3e9d5182664d28788126d39b91f2d1e22b017ec" -dependencies = [ - "cesu8", - "combine", - "jni-sys", - "log", - "thiserror", - "walkdir", -] - -[[package]] -name = "jni" -version = "0.20.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "039022cdf4d7b1cf548d31f60ae783138e5fd42013f6271049d7df7afadef96c" -dependencies = [ - "cesu8", - "combine", - "jni-sys", - "log", - "thiserror", - "walkdir", -] - [[package]] name = "jni" version = "0.21.1" @@ -1906,6 +1876,15 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8eaf4bc02d17cbdd7ff4c7438cafcdf7fb9a4613313ad11b4f8fefe7d3fa0130" +[[package]] +name = "jobserver" +version = "0.1.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab46a6e9526ddef3ae7f787c06f0f2600639ba80ea3eade3d8e670a2230f51d6" +dependencies = [ + "libc", +] + [[package]] name = "jpeg-decoder" version = "0.3.1" @@ -1914,9 +1893,9 @@ checksum = "f5d4a7da358eff58addd2877a45865158f0d78c911d43a5784ceb7bbf52833b0" [[package]] name = "js-sys" -version = "0.3.68" +version = "0.3.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "406cda4b368d531c842222cf9d2600a9a4acce8d29423695379c6868a143a9ee" +checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d" dependencies = [ "wasm-bindgen", ] @@ -1928,7 +1907,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6aae1df220ece3c0ada96b8153459b67eebe9ae9212258bb0134ae60416fdf76" dependencies = [ "libc", - "libloading 0.8.1", + "libloading 0.8.3", "pkg-config", ] @@ -1997,12 +1976,12 @@ dependencies = [ [[package]] name = "libloading" -version = "0.8.1" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c571b676ddfc9a8c12f1f3d3085a7b163966a8fd8098a90640953ce5f6170161" +checksum = "0c2a198fb6b0eada2a8df47933734e6d35d350665a33a3593d7164fa52c75c19" dependencies = [ "cfg-if", - "windows-sys 0.48.0", + "windows-targets 0.52.4", ] [[package]] @@ -2215,9 +2194,9 @@ dependencies = [ [[package]] name = "mio" -version = "0.8.10" +version = "0.8.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f3d0b296e374a4e6f3c7b0a1f5a51d748a0d34c85e7dc48fc3fa9a87657fe09" +checksum = "a4a650543ca06a924e8b371db273b2756685faae30f8487da1b56505a8f78b0c" dependencies = [ "libc", "wasi", @@ -2226,9 +2205,9 @@ dependencies = [ [[package]] name = "naga" -version = "0.19.0" +version = "0.19.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8878eb410fc90853da3908aebfe61d73d26d4437ef850b70050461f939509899" +checksum = "50e3524642f53d9af419ab5e8dd29d3ba155708267667c2f3f06c88c9e130843" dependencies = [ "bit-set", "bitflags 2.4.2", @@ -2262,20 +2241,6 @@ dependencies = [ "tempfile", ] -[[package]] -name = "ndk" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "451422b7e4718271c8b5b3aadf5adedba43dc76312454b387e98fae0fc951aa0" -dependencies = [ - "bitflags 1.3.2", - "jni-sys", - "ndk-sys 0.4.1+23.1.7779620", - "num_enum 0.5.11", - "raw-window-handle 0.5.2", - "thiserror", -] - [[package]] name = "ndk" version = "0.8.0" @@ -2285,8 +2250,8 @@ dependencies = [ "bitflags 2.4.2", "jni-sys", "log", - "ndk-sys 0.5.0+25.2.9519653", - "num_enum 0.7.2", + "ndk-sys", + "num_enum", "raw-window-handle 0.6.0", "thiserror", ] @@ -2297,15 +2262,6 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "27b02d87554356db9e9a873add8782d4ea6e3e58ea071a9adb9a2e8ddb884a8b" -[[package]] -name = "ndk-sys" -version = "0.4.1+23.1.7779620" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3cf2aae958bd232cac5069850591667ad422d263686d75b52a065f9badeee5a3" -dependencies = [ - "jni-sys", -] - [[package]] name = "ndk-sys" version = "0.5.0+25.2.9519653" @@ -2315,17 +2271,6 @@ dependencies = [ "jni-sys", ] -[[package]] -name = "nix" -version = "0.24.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa52e972a9a719cecb6864fb88568781eb706bac2cd1d4f04a648542dbf78069" -dependencies = [ - "bitflags 1.3.2", - "cfg-if", - "libc", -] - [[package]] name = "nix" version = "0.27.1" @@ -2349,13 +2294,13 @@ dependencies = [ [[package]] name = "num-derive" -version = "0.3.3" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "876a53fff98e03a936a674b29568b0e605f06b29372c2489ff4de23f1949743d" +checksum = "ed3955f1a9c7c0c15e092f9c887db08b1fc683305fdf6eb6684f22555355e202" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.52", ] [[package]] @@ -2378,34 +2323,13 @@ dependencies = [ "libc", ] -[[package]] -name = "num_enum" -version = "0.5.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f646caf906c20226733ed5b1374287eb97e3c2a5c227ce668c1f2ce20ae57c9" -dependencies = [ - "num_enum_derive 0.5.11", -] - [[package]] name = "num_enum" version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "02339744ee7253741199f897151b38e72257d13802d4ee837285cc2990a90845" dependencies = [ - "num_enum_derive 0.7.2", -] - -[[package]] -name = "num_enum_derive" -version = "0.5.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcbff9bc912032c62bf65ef1d5aea88983b420f4f839db1e9b0c281a25c9c799" -dependencies = [ - "proc-macro-crate 1.3.1", - "proc-macro2", - "quote", - "syn 1.0.109", + "num_enum_derive", ] [[package]] @@ -2414,7 +2338,7 @@ version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "681030a937600a36906c185595136d26abfebb4aa9c65701cefcaf8578bb982b" dependencies = [ - "proc-macro-crate 3.1.0", + "proc-macro-crate", "proc-macro2", "quote", "syn 2.0.52", @@ -2492,12 +2416,12 @@ dependencies = [ [[package]] name = "oboe" -version = "0.5.0" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8868cc237ee02e2d9618539a23a8d228b9bb3fc2e7a5b11eed3831de77c395d0" +checksum = "e8b61bebd49e5d43f5f8cc7ee2891c16e0f41ec7954d36bcb6c14c5e0de867fb" dependencies = [ - "jni 0.20.0", - "ndk 0.7.0", + "jni", + "ndk", "ndk-context", "num-derive", "num-traits", @@ -2506,9 +2430,9 @@ dependencies = [ [[package]] name = "oboe-sys" -version = "0.5.0" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f44155e7fb718d3cfddcf70690b2b51ac4412f347cd9e4fbe511abe9cd7b5f2" +checksum = "6c8bb09a4a2b1d668170cfe0a7d5bc103f8999fb316c98099b6a9939c9f2e79d" dependencies = [ "cc", ] @@ -2862,16 +2786,6 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e8cf8e6a8aa66ce33f63993ffc4ea4271eb5b0530a9002db8455ea6050c77bfa" -[[package]] -name = "proc-macro-crate" -version = "1.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f4c021e1093a56626774e81216a4ce732a735e5bad4868a03f3ed65ca0c3919" -dependencies = [ - "once_cell", - "toml_edit 0.19.15", -] - [[package]] name = "proc-macro-crate" version = "3.1.0" @@ -3033,9 +2947,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.5" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5bb987efffd3c6d0d8f5f89510bb458559eab11e4f869acb20bf845e016259cd" +checksum = "86b83b8b9847f9bf95ef68afb0b8e6cdb80f498442f5179a29fad448fcc1eaea" dependencies = [ "aho-corasick", "memchr", @@ -3056,9 +2970,9 @@ checksum = "e898588f33fdd5b9420719948f9f2a32c922a246964576f71ba7f24f80610fbc" [[package]] name = "renderdoc-sys" -version = "1.0.0" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "216080ab382b992234dda86873c18d4c48358f5cfcb70fd693d7f6f2131b628b" +checksum = "19b30a45b0cd0bcca8037f3d0dc3421eaf95327a17cad11964fb8179b4fc4832" [[package]] name = "reqwest" @@ -3699,9 +3613,9 @@ dependencies = [ [[package]] name = "splines" -version = "4.3.1" +version = "4.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "228c4551e53c672e86439509545dd7ffcb966b6876c58b108e433a30e6117101" +checksum = "1c1e9ef455843d50fe69d0facee2d23a154f69d3e7fb3976eb0233a8cdef184e" [[package]] name = "static_assertions" @@ -3720,9 +3634,9 @@ dependencies = [ [[package]] name = "svg_fmt" -version = "0.4.1" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fb1df15f412ee2e9dfc1c504260fa695c1c3f10fe9f4a6ee2d2184d7d6450e2" +checksum = "f83ba502a3265efb76efb89b0a2f7782ad6f2675015d4ce37e4b547dda42b499" [[package]] name = "svgtypes" @@ -3946,7 +3860,7 @@ checksum = "d4098d49269baa034a8d1eae9bd63e9fa532148d772121dace3bcd6a6c98eb6d" dependencies = [ "as-raw-xcb-connection", "ctor", - "libloading 0.8.1", + "libloading 0.8.3", "tracing", ] @@ -4045,17 +3959,6 @@ dependencies = [ "serde", ] -[[package]] -name = "toml_edit" -version = "0.19.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" -dependencies = [ - "indexmap", - "toml_datetime", - "winnow 0.5.40", -] - [[package]] name = "toml_edit" version = "0.21.1" @@ -4077,7 +3980,7 @@ dependencies = [ "serde", "serde_spanned", "toml_datetime", - "winnow 0.6.3", + "winnow 0.6.5", ] [[package]] @@ -4308,9 +4211,9 @@ checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" [[package]] name = "walkdir" -version = "2.4.0" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d71d857dc86794ca4c280d616f7da00d2dbfd8cd788846559a6813e6aa4b54ee" +checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" dependencies = [ "same-file", "winapi-util", @@ -4333,9 +4236,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.91" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1e124130aee3fb58c5bdd6b639a0509486b0338acaaae0c84a5124b0f588b7f" +checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -4343,9 +4246,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.91" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9e7e1900c352b609c8488ad12639a311045f40a35491fb69ba8c12f758af70b" +checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da" dependencies = [ "bumpalo", "log", @@ -4358,9 +4261,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-futures" -version = "0.4.41" +version = "0.4.42" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "877b9c3f61ceea0e56331985743b13f3d25c406a7098d45180fb5f09bc19ed97" +checksum = "76bc14366121efc8dbb487ab05bcc9d346b3b5ec0eaa76e46594cabbe51762c0" dependencies = [ "cfg-if", "js-sys", @@ -4370,9 +4273,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.91" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b30af9e2d358182b5c7449424f017eba305ed32a7010509ede96cdc4696c46ed" +checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -4380,9 +4283,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.91" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "642f325be6301eb8107a83d12a8ac6c1e1c54345a7ef1a9261962dfefda09e66" +checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" dependencies = [ "proc-macro2", "quote", @@ -4393,9 +4296,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.91" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f186bd2dcf04330886ce82d6f33dd75a7bfcf69ecf5763b89fcde53b6ac9838" +checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" [[package]] name = "wasm-timer" @@ -4555,9 +4458,9 @@ checksum = "53a85b86a771b1c87058196170769dd264f66c0782acf1ae6cc51bfd64b39082" [[package]] name = "wgpu" -version = "0.19.1" +version = "0.19.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bfe9a310dcf2e6b85f00c46059aaeaf4184caa8e29a1ecd4b7a704c3482332d" +checksum = "a4b1213b52478a7631d6e387543ed8f642bc02c578ef4e3b49aca2a29a7df0cb" dependencies = [ "arrayvec", "cfg-if", @@ -4580,9 +4483,9 @@ dependencies = [ [[package]] name = "wgpu-core" -version = "0.19.0" +version = "0.19.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b15e451d4060ada0d99a64df44e4d590213496da7c4f245572d51071e8e30ed" +checksum = "f9f6b033c2f00ae0bc8ea872c5989777c60bc241aac4e58b24774faa8b391f78" dependencies = [ "arrayvec", "bit-vec", @@ -4606,9 +4509,9 @@ dependencies = [ [[package]] name = "wgpu-hal" -version = "0.19.1" +version = "0.19.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3bb47856236bfafc0bc591a925eb036ac19cd987624a447ff353e7a7e7e6f72" +checksum = "49f972c280505ab52ffe17e94a7413d9d54b58af0114ab226b9fc4999a47082e" dependencies = [ "android_system_properties", "arrayvec", @@ -4628,10 +4531,11 @@ dependencies = [ "js-sys", "khronos-egl", "libc", - "libloading 0.8.1", + "libloading 0.8.3", "log", "metal", "naga", + "ndk-sys", "objc", "once_cell", "parking_lot 0.12.1", @@ -4650,9 +4554,9 @@ dependencies = [ [[package]] name = "wgpu-types" -version = "0.19.0" +version = "0.19.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "895fcbeb772bfb049eb80b2d6e47f6c9af235284e9703c96fc0218a42ffd5af2" +checksum = "b671ff9fb03f78b46ff176494ee1ebe7d603393f42664be55b64dc8d53969805" dependencies = [ "bitflags 2.4.2", "js-sys", @@ -4712,20 +4616,21 @@ dependencies = [ [[package]] name = "windows" -version = "0.46.0" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cdacb41e6a96a052c6cb63a144f24900236121c6f63f4f8219fef5977ecb0c25" +checksum = "e48a53791691ab099e5e2ad123536d0fff50652600abaf43bbf952894110d0be" dependencies = [ - "windows-targets 0.42.2", + "windows-core 0.52.0", + "windows-targets 0.52.4", ] [[package]] name = "windows" -version = "0.52.0" +version = "0.54.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e48a53791691ab099e5e2ad123536d0fff50652600abaf43bbf952894110d0be" +checksum = "9252e5725dbed82865af151df558e754e4a3c2c30818359eb17465f1346a1b49" dependencies = [ - "windows-core", + "windows-core 0.54.0", "windows-targets 0.52.4", ] @@ -4738,6 +4643,25 @@ dependencies = [ "windows-targets 0.52.4", ] +[[package]] +name = "windows-core" +version = "0.54.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "12661b9c89351d684a50a8a643ce5f608e20243b9fb84687800163429f161d65" +dependencies = [ + "windows-result", + "windows-targets 0.52.4", +] + +[[package]] +name = "windows-result" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd19df78e5168dfb0aedc343d1d1b8d422ab2db6756d2dc3fef75035402a3f64" +dependencies = [ + "windows-targets 0.52.4", +] + [[package]] name = "windows-sys" version = "0.36.1" @@ -4981,9 +4905,9 @@ checksum = "32b752e52a2da0ddfbdbcc6fceadfeede4c939ed16d13e648833a61dfb611ed8" [[package]] name = "winit" -version = "0.29.11" +version = "0.29.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "272be407f804517512fdf408f0fe6c067bf24659a913c61af97af176bfd5aa92" +checksum = "a7a3db69ffbe53a9babec7804da7a90f21020fcce1f2f5e5291e2311245b993d" dependencies = [ "ahash", "android-activity", @@ -5000,8 +4924,8 @@ dependencies = [ "libc", "log", "memmap2 0.9.4", - "ndk 0.8.0", - "ndk-sys 0.5.0+25.2.9519653", + "ndk", + "ndk-sys", "objc2", "once_cell", "orbclient", @@ -5038,9 +4962,9 @@ dependencies = [ [[package]] name = "winnow" -version = "0.6.3" +version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44e19b97e00a4d3db3cdb9b53c8c5f87151b5689b82cc86c2848cbdcccb2689b" +checksum = "dffa400e67ed5a4dd237983829e66475f0a4a26938c4b04c21baede6262215b8" dependencies = [ "memchr", ] @@ -5084,7 +5008,7 @@ dependencies = [ "as-raw-xcb-connection", "gethostname", "libc", - "libloading 0.8.1", + "libloading 0.8.3", "once_cell", "rustix", "x11rb-protocol", @@ -5147,9 +5071,9 @@ checksum = "927da81e25be1e1a2901d59b81b37dd2efd1fc9c9345a55007f09bf5a2d3ee03" [[package]] name = "yansi" -version = "1.0.0-rc.1" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1367295b8f788d371ce2dbc842c7b709c73ee1364d30351dd300ec2203b12377" +checksum = "6c2861d76f58ec8fc95708b9b1e417f7b12fd72ad33c01fa6886707092dea0d3" [[package]] name = "yazi" diff --git a/src/chart/types/traffic_chart.rs b/src/chart/types/traffic_chart.rs index bd428f1a..01e2592b 100644 --- a/src/chart/types/traffic_chart.rs +++ b/src/chart/types/traffic_chart.rs @@ -64,11 +64,7 @@ impl TrafficChart { } pub fn view(&self) -> Element { - Container::new(ChartWidget::new(self)) - .height(Length::Shrink) - .align_x(Horizontal::Left) - .align_y(Vertical::Bottom) - .into() + Container::new(ChartWidget::new(self)).into() } pub fn change_kind(&mut self, kind: ChartType) { diff --git a/src/gui/app.rs b/src/gui/app.rs index 2d2d977a..9d96d7dd 100644 --- a/src/gui/app.rs +++ b/src/gui/app.rs @@ -154,7 +154,7 @@ impl Application for Sniffer { }, NO_MODIFIER => match key { Key::Named(Named::Enter) => Some(Message::ReturnKeyPressed), - Key::Named(Named::Backspace) => Some(Message::EscKeyPressed), + Key::Named(Named::Escape) => Some(Message::EscKeyPressed), Key::Named(Named::Tab) => Some(Message::SwitchPage(true)), _ => None, }, diff --git a/src/gui/components/tab.rs b/src/gui/components/tab.rs index 94d765d7..fa699693 100644 --- a/src/gui/components/tab.rs +++ b/src/gui/components/tab.rs @@ -1,6 +1,7 @@ //! Tab buttons to be used in the various pages just under the header use iced::alignment::Vertical; +use iced::widget::text::LineHeight; use iced::widget::{button, horizontal_space, Button, Container, Row, Space, Text}; use iced::{alignment, Alignment, Font, Length, Renderer, Theme}; @@ -101,12 +102,16 @@ fn new_page_tab( if let Some(num) = unread { if num > 0 { - let notifications_badge = - Container::new(Text::new(num.to_string()).font(font_headers).size(14)) - .align_y(Vertical::Center) - .padding([2, 4]) - .height(Length::Fixed(20.0)) - .style(ContainerType::Highlighted); + let notifications_badge = Container::new( + Text::new(num.to_string()) + .font(font_headers) + .size(14) + .line_height(LineHeight::Relative(1.0)), + ) + .align_y(Vertical::Center) + .padding([2, 4]) + .height(Length::Fixed(20.0)) + .style(ContainerType::Highlighted); content = content .push(Space::with_width(Length::Fixed(7.0))) .push(notifications_badge); diff --git a/src/gui/pages/initial_page.rs b/src/gui/pages/initial_page.rs index 3d4bfcbf..ee19a28e 100644 --- a/src/gui/pages/initial_page.rs +++ b/src/gui/pages/initial_page.rs @@ -59,43 +59,41 @@ pub fn initial_page(sniffer: &Sniffer) -> Container { let port_active = &sniffer.filters.port_str; let col_port_filter = col_port_input(port_active, font, language); - let filters_pane = Container::new( - Column::new() - .spacing(15) - .push( - select_filters_translation(language) - .font(font) - .style(TextType::Title) - .size(FONT_SIZE_TITLE), - ) - .push( - Row::new() - .spacing(20) - .push(col_ip_buttons) - .push(col_protocol_buttons), - ) - .push( - Row::new() - .spacing(20) - .push(col_address_filter) - .push(col_port_filter), - ) - .push(Rule::horizontal(40)) - .push( - Container::new(button_start( - font, - language, - color_gradient, - &sniffer.filters, - )) - .width(Length::Fill) - .height(Length::Fill) - .align_y(Vertical::Center) - .align_x(Horizontal::Center), - ), - ) - .width(FillPortion(6)) - .padding(10); + let filters_pane = Column::new() + .width(FillPortion(6)) + .padding(10) + .spacing(15) + .push( + select_filters_translation(language) + .font(font) + .style(TextType::Title) + .size(FONT_SIZE_TITLE), + ) + .push( + Row::new() + .spacing(20) + .push(col_ip_buttons) + .push(col_protocol_buttons), + ) + .push( + Row::new() + .spacing(20) + .push(col_address_filter) + .push(col_port_filter), + ) + .push(Rule::horizontal(40)) + .push( + Container::new(button_start( + font, + language, + color_gradient, + &sniffer.filters, + )) + .width(Length::Fill) + .height(Length::Fill) + .align_y(Vertical::Center) + .align_x(Horizontal::Center), + ); let body = Column::new() .push(Space::with_height(Length::Fixed(5.0))) diff --git a/src/gui/pages/inspect_page.rs b/src/gui/pages/inspect_page.rs index 1b127e1b..7609dc86 100644 --- a/src/gui/pages/inspect_page.rs +++ b/src/gui/pages/inspect_page.rs @@ -2,6 +2,7 @@ use std::cmp::min; use iced::alignment::{Horizontal, Vertical}; use iced::widget::scrollable::Direction; +use iced::widget::text::LineHeight; use iced::widget::text_input::Side; use iced::widget::tooltip::Position; use iced::widget::{button, text_input, Rule, Space, Toggler, Tooltip}; @@ -509,7 +510,8 @@ fn button_clear_filter( .font(font) .vertical_alignment(Vertical::Center) .horizontal_alignment(Horizontal::Center) - .size(15), + .size(15) + .line_height(LineHeight::Relative(1.0)), ) .padding(2) .height(Length::Fixed(20.0)) diff --git a/src/gui/pages/notifications_page.rs b/src/gui/pages/notifications_page.rs index 1b87d598..f8aefe44 100644 --- a/src/gui/pages/notifications_page.rs +++ b/src/gui/pages/notifications_page.rs @@ -1,5 +1,6 @@ use iced::alignment::{Horizontal, Vertical}; use iced::widget::scrollable::Direction; +use iced::widget::text::LineHeight; use iced::widget::tooltip::Position; use iced::widget::{button, Space}; use iced::widget::{lazy, Column, Container, Row, Scrollable, Text, Tooltip}; @@ -176,7 +177,10 @@ fn packets_notification_log( .spacing(30) .push( Tooltip::new( - Icon::PacketsThreshold.to_text().size(80), + Icon::PacketsThreshold + .to_text() + .size(80) + .line_height(LineHeight::Relative(1.0)), Text::new(packets_exceeded_translation(language)).font(font), Position::FollowCursor, ) @@ -254,7 +258,10 @@ fn bytes_notification_log( .height(Length::Fill) .push( Tooltip::new( - Icon::BytesThreshold.to_text().size(80), + Icon::BytesThreshold + .to_text() + .size(80) + .line_height(LineHeight::Relative(1.0)), Text::new(bytes_exceeded_translation(language)).font(font), Position::FollowCursor, ) @@ -335,7 +342,11 @@ fn favorite_notification_log( .height(Length::Fill) .push( Tooltip::new( - Icon::Star.to_text().size(80).style(TextType::Starred), + Icon::Star + .to_text() + .size(80) + .style(TextType::Starred) + .line_height(LineHeight::Relative(1.0)), Text::new(favorite_transmitted_translation(language)).font(font), Position::FollowCursor, ) diff --git a/src/gui/pages/settings_style_page.rs b/src/gui/pages/settings_style_page.rs index f6bf19fc..1a5a845d 100644 --- a/src/gui/pages/settings_style_page.rs +++ b/src/gui/pages/settings_style_page.rs @@ -333,6 +333,7 @@ fn lazy_custom_style_input( )); let mut content = Column::new() + .width(Length::Fill) .align_items(Alignment::Center) .spacing(5) .push(Text::new(custom_style_translation(language)).font(font)) diff --git a/src/gui/styles/toggler.rs b/src/gui/styles/toggler.rs index ebf9d20c..f588c7e0 100644 --- a/src/gui/styles/toggler.rs +++ b/src/gui/styles/toggler.rs @@ -20,19 +20,20 @@ impl iced::widget::toggler::StyleSheet for StyleType { fn active(&self, _: &Self::Style, is_active: bool) -> iced::widget::toggler::Appearance { let colors = self.get_palette(); let ext = self.get_extension(); + let bg_color = if is_active { + Color { + a: ext.alpha_chart_badge, + ..colors.secondary + } + } else { + ext.buttons_color + }; Appearance { - background: if is_active { - Color { - a: ext.alpha_chart_badge, - ..colors.secondary - } - } else { - ext.buttons_color - }, + background: bg_color, background_border_width: BORDER_WIDTH, + background_border_color: bg_color, foreground: colors.primary, foreground_border_width: BORDER_WIDTH, - background_border_color: ext.buttons_color, foreground_border_color: if is_active { colors.secondary } else { @@ -44,19 +45,20 @@ impl iced::widget::toggler::StyleSheet for StyleType { fn hovered(&self, _: &Self::Style, is_active: bool) -> iced::widget::toggler::Appearance { let colors = self.get_palette(); let ext = self.get_extension(); + let bg_color = if is_active { + Color { + a: ext.alpha_chart_badge, + ..colors.secondary + } + } else { + ext.buttons_color + }; Appearance { - background: if is_active { - Color { - a: ext.alpha_chart_badge, - ..colors.secondary - } - } else { - ext.buttons_color - }, + background: bg_color, background_border_width: BORDER_WIDTH, + background_border_color: colors.secondary, foreground: colors.primary, foreground_border_width: BORDER_WIDTH, - background_border_color: colors.secondary, foreground_border_color: if is_active { colors.secondary } else { From 7496a6c1966a93659029478ef49d2e9cc82999a9 Mon Sep 17 00:00:00 2001 From: Giuliano Bellini s294739 Date: Thu, 7 Mar 2024 21:24:02 +0100 Subject: [PATCH 07/12] fix old tests --- Cargo.lock | 767 ++++++++++++++++++++++++------- Cargo.toml | 100 ++-- src/chart/manage_chart_data.rs | 22 +- src/chart/types/traffic_chart.rs | 2 +- src/cli/mod.rs | 4 +- src/gui/types/sniffer.rs | 12 +- 6 files changed, 671 insertions(+), 236 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e79ee2e5..4692d96b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -167,15 +167,185 @@ dependencies = [ ] [[package]] -name = "atk-sys" -version = "0.18.0" +name = "ashpd" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "251e0b7d90e33e0ba930891a505a9a35ece37b2dd37a14f3ffc306c13b980009" +checksum = "1b22517ee647547c01a687cf9b76074e1c91334032a4324f7243c6ee0f949390" dependencies = [ - "glib-sys", - "gobject-sys", - "libc", - "system-deps", + "async-fs", + "async-net", + "enumflags2", + "futures-channel", + "futures-util", + "rand", + "serde", + "serde_repr", + "url", + "zbus", +] + +[[package]] +name = "async-broadcast" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "258b52a1aa741b9f09783b2d86cf0aeeb617bbf847f6933340a39644227acbdb" +dependencies = [ + "event-listener 5.2.0", + "event-listener-strategy 0.5.0", + "futures-core", + "pin-project-lite", +] + +[[package]] +name = "async-channel" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f28243a43d821d11341ab73c80bed182dc015c514b951616cf79bd4af39af0c3" +dependencies = [ + "concurrent-queue", + "event-listener 5.2.0", + "event-listener-strategy 0.5.0", + "futures-core", + "pin-project-lite", +] + +[[package]] +name = "async-executor" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17ae5ebefcc48e7452b4987947920dac9450be1110cadf34d1b8c116bdbaf97c" +dependencies = [ + "async-lock 3.3.0", + "async-task", + "concurrent-queue", + "fastrand", + "futures-lite", + "slab", +] + +[[package]] +name = "async-fs" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc19683171f287921f2405677dd2ed2549c3b3bda697a563ebc3a121ace2aba1" +dependencies = [ + "async-lock 3.3.0", + "blocking", + "futures-lite", +] + +[[package]] +name = "async-io" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f97ab0c5b00a7cdbe5a371b9a782ee7be1316095885c8a4ea1daf490eb0ef65" +dependencies = [ + "async-lock 3.3.0", + "cfg-if", + "concurrent-queue", + "futures-io", + "futures-lite", + "parking", + "polling", + "rustix", + "slab", + "tracing", + "windows-sys 0.52.0", +] + +[[package]] +name = "async-lock" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "287272293e9d8c41773cec55e365490fe034813a2f172f502d6ddcf75b2f582b" +dependencies = [ + "event-listener 2.5.3", +] + +[[package]] +name = "async-lock" +version = "3.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d034b430882f8381900d3fe6f0aaa3ad94f2cb4ac519b429692a1bc2dda4ae7b" +dependencies = [ + "event-listener 4.0.3", + "event-listener-strategy 0.4.0", + "pin-project-lite", +] + +[[package]] +name = "async-net" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b948000fad4873c1c9339d60f2623323a0cfd3816e5181033c6a5cb68b2accf7" +dependencies = [ + "async-io", + "blocking", + "futures-lite", +] + +[[package]] +name = "async-process" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "451e3cf68011bd56771c79db04a9e333095ab6349f7e47592b788e9b98720cc8" +dependencies = [ + "async-channel", + "async-io", + "async-lock 3.3.0", + "async-signal", + "blocking", + "cfg-if", + "event-listener 5.2.0", + "futures-lite", + "rustix", + "windows-sys 0.52.0", +] + +[[package]] +name = "async-recursion" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5fd55a5ba1179988837d24ab4c7cc8ed6efdeff578ede0416b4225a5fca35bd0" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.52", +] + +[[package]] +name = "async-signal" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e47d90f65a225c4527103a8d747001fc56e375203592b25ad103e1ca13124c5" +dependencies = [ + "async-io", + "async-lock 2.8.0", + "atomic-waker", + "cfg-if", + "futures-core", + "futures-io", + "rustix", + "signal-hook-registry", + "slab", + "windows-sys 0.48.0", +] + +[[package]] +name = "async-task" +version = "4.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fbb36e985947064623dbd357f727af08ffd077f93d696782f3c56365fa2e2799" + +[[package]] +name = "async-trait" +version = "0.1.77" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c980ee35e870bd1a4d2c8294d4c04d0499e67bca1e4b5cefcc693c2fa00caea9" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.52", ] [[package]] @@ -264,6 +434,15 @@ version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0d8c1fef690941d3e7788d328517591fecc684c084084702d6ff1641e993699a" +[[package]] +name = "block-buffer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +dependencies = [ + "generic-array", +] + [[package]] name = "block-sys" version = "0.2.1" @@ -283,6 +462,22 @@ dependencies = [ "objc2", ] +[[package]] +name = "blocking" +version = "1.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a37913e8dc4ddcc604f0c6d3bf2887c995153af3611de9e23c352b44c1b9118" +dependencies = [ + "async-channel", + "async-lock 3.3.0", + "async-task", + "fastrand", + "futures-io", + "futures-lite", + "piper", + "tracing", +] + [[package]] name = "bumpalo" version = "3.15.3" @@ -315,16 +510,6 @@ version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" -[[package]] -name = "cairo-sys-rs" -version = "0.18.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "685c9fa8e590b8b3d678873528d83411db17242a73fccaed827770ea0fedda51" -dependencies = [ - "libc", - "system-deps", -] - [[package]] name = "calloop" version = "0.12.4" @@ -353,9 +538,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.0.89" +version = "1.0.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0ba8f7aaa012f30d5b2861462f6708eccd49c3c39863fe083a308035f63d723" +checksum = "8cd6604a82acf3039f1144f54b8eb34e91ffba622051189e71b781822d5ee1f5" dependencies = [ "jobserver", "libc", @@ -376,16 +561,6 @@ dependencies = [ "nom", ] -[[package]] -name = "cfg-expr" -version = "0.15.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa50868b64a9a6fda9d593ce778849ea8715cd2a3d2cc17ffdb4a2f2f2f1961d" -dependencies = [ - "smallvec", - "target-lexicon", -] - [[package]] name = "cfg-if" version = "1.0.0" @@ -678,6 +853,15 @@ dependencies = [ "windows 0.54.0", ] +[[package]] +name = "cpufeatures" +version = "0.2.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504" +dependencies = [ + "libc", +] + [[package]] name = "crc32fast" version = "1.4.0" @@ -699,6 +883,16 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" +[[package]] +name = "crypto-common" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" +dependencies = [ + "generic-array", + "typenum", +] + [[package]] name = "ctor" version = "0.2.7" @@ -715,7 +909,7 @@ version = "3.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b467862cc8610ca6fc9a1532d7777cee0804e678ab45410897b9396495994a0b" dependencies = [ - "nix", + "nix 0.27.1", "windows-sys 0.52.0", ] @@ -761,6 +955,27 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5c297a1c74b71ae29df00c3e22dd9534821d60eb9af5a0192823fa2acea70c2a" +[[package]] +name = "derivative" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "digest" +version = "0.10.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" +dependencies = [ + "block-buffer", + "crypto-common", +] + [[package]] name = "directories" version = "5.0.1" @@ -875,6 +1090,33 @@ dependencies = [ "cfg-if", ] +[[package]] +name = "endi" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a3d8a32ae18130a3c84dd492d4215c3d913c3b07c6b63c2eb3eb7ff1101ab7bf" + +[[package]] +name = "enumflags2" +version = "0.7.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3278c9d5fb675e0a51dabcf4c0d355f692b064171535ba72361be1528a9d8e8d" +dependencies = [ + "enumflags2_derive", + "serde", +] + +[[package]] +name = "enumflags2_derive" +version = "0.7.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c785274071b1b420972453b306eeca06acf4633829db4223b58a2a8c5953bc4" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.52", +] + [[package]] name = "equivalent" version = "1.0.1" @@ -946,6 +1188,54 @@ dependencies = [ "num-traits", ] +[[package]] +name = "event-listener" +version = "2.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" + +[[package]] +name = "event-listener" +version = "4.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67b215c49b2b248c855fb73579eb1f4f26c38ffdc12973e20e07b91d78d5646e" +dependencies = [ + "concurrent-queue", + "parking", + "pin-project-lite", +] + +[[package]] +name = "event-listener" +version = "5.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b5fb89194fa3cad959b833185b3063ba881dbfc7030680b314250779fb4cc91" +dependencies = [ + "concurrent-queue", + "parking", + "pin-project-lite", +] + +[[package]] +name = "event-listener-strategy" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "958e4d70b6d5e81971bebec42271ec641e7ff4e170a6fa605f2b8a8b65cb97d3" +dependencies = [ + "event-listener 4.0.3", + "pin-project-lite", +] + +[[package]] +name = "event-listener-strategy" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "feedafcaa9b749175d5ac357452a9d41ea2911da598fde46ce1fe02c37751291" +dependencies = [ + "event-listener 5.2.0", + "pin-project-lite", +] + [[package]] name = "fast-srgb8" version = "1.0.0" @@ -1130,6 +1420,19 @@ version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" +[[package]] +name = "futures-lite" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "445ba825b27408685aaecefd65178908c36c6e96aaf6d8599419d46e624192ba" +dependencies = [ + "fastrand", + "futures-core", + "futures-io", + "parking", + "pin-project-lite", +] + [[package]] name = "futures-macro" version = "0.3.30" @@ -1178,33 +1481,13 @@ dependencies = [ ] [[package]] -name = "gdk-pixbuf-sys" -version = "0.18.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f9839ea644ed9c97a34d129ad56d38a25e6756f99f3a88e15cd39c20629caf7" -dependencies = [ - "gio-sys", - "glib-sys", - "gobject-sys", - "libc", - "system-deps", -] - -[[package]] -name = "gdk-sys" -version = "0.18.0" +name = "generic-array" +version = "0.14.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31ff856cb3386dae1703a920f803abafcc580e9b5f711ca62ed1620c25b51ff2" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" dependencies = [ - "cairo-sys-rs", - "gdk-pixbuf-sys", - "gio-sys", - "glib-sys", - "gobject-sys", - "libc", - "pango-sys", - "pkg-config", - "system-deps", + "typenum", + "version_check", ] [[package]] @@ -1244,19 +1527,6 @@ version = "0.28.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" -[[package]] -name = "gio-sys" -version = "0.18.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37566df850baf5e4cb0dfb78af2e4b9898d817ed9263d1090a2df958c64737d2" -dependencies = [ - "glib-sys", - "gobject-sys", - "libc", - "system-deps", - "winapi", -] - [[package]] name = "gl_generator" version = "0.14.0" @@ -1274,16 +1544,6 @@ version = "0.25.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "151665d9be52f9bb40fc7966565d39666f2d1e69233571b71b87791c7e0528b3" -[[package]] -name = "glib-sys" -version = "0.18.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "063ce2eb6a8d0ea93d2bf8ba1957e78dbab6be1c2220dd3daca57d5a9d869898" -dependencies = [ - "libc", - "system-deps", -] - [[package]] name = "glob" version = "0.3.1" @@ -1323,17 +1583,6 @@ dependencies = [ "wgpu", ] -[[package]] -name = "gobject-sys" -version = "0.18.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0850127b514d1c4a4654ead6dedadb18198999985908e6ffe4436f53c785ce44" -dependencies = [ - "glib-sys", - "libc", - "system-deps", -] - [[package]] name = "gpu-alloc" version = "0.6.0" @@ -1386,24 +1635,6 @@ dependencies = [ "bitflags 2.4.2", ] -[[package]] -name = "gtk-sys" -version = "0.18.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "771437bf1de2c1c0b496c11505bdf748e26066bbe942dfc8f614c9460f6d7722" -dependencies = [ - "atk-sys", - "cairo-sys-rs", - "gdk-pixbuf-sys", - "gdk-sys", - "gio-sys", - "glib-sys", - "gobject-sys", - "libc", - "pango-sys", - "system-deps", -] - [[package]] name = "guillotiere" version = "0.6.2" @@ -1480,6 +1711,12 @@ version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + [[package]] name = "hexf-parse" version = "0.2.1" @@ -1619,7 +1856,7 @@ dependencies = [ "log", "num-traits", "palette", - "raw-window-handle 0.6.0", + "raw-window-handle", "smol_str", "thiserror", "web-time", @@ -1655,7 +1892,7 @@ dependencies = [ "log", "lyon_path", "once_cell", - "raw-window-handle 0.6.0", + "raw-window-handle", "rustc-hash", "thiserror", "unicode-segmentation", @@ -1683,7 +1920,7 @@ checksum = "a79f852c01cc6d61663c94379cb3974ac3ad315a28c504e847d573e094f46822" dependencies = [ "iced_core", "iced_futures", - "raw-window-handle 0.6.0", + "raw-window-handle", "thiserror", ] @@ -2155,6 +2392,15 @@ dependencies = [ "libc", ] +[[package]] +name = "memoffset" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a634b1c61a95585bd15607c6ab0c4e5b226e695ff2800ba0cdccddf208c406c" +dependencies = [ + "autocfg", +] + [[package]] name = "metal" version = "0.27.0" @@ -2252,7 +2498,7 @@ dependencies = [ "log", "ndk-sys", "num_enum", - "raw-window-handle 0.6.0", + "raw-window-handle", "thiserror", ] @@ -2282,6 +2528,19 @@ dependencies = [ "libc", ] +[[package]] +name = "nix" +version = "0.28.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab2156c4fce2f8df6c499cc1c763e4394b7482525bf2a9701c9d79d215f519e4" +dependencies = [ + "bitflags 2.4.2", + "cfg-if", + "cfg_aliases 0.1.1", + "libc", + "memoffset", +] + [[package]] name = "nom" version = "7.1.3" @@ -2502,6 +2761,16 @@ dependencies = [ "libredox 0.0.2", ] +[[package]] +name = "ordered-stream" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9aa2b01e1d916879f73a53d01d1d6cee68adbb31d6d9177a8cfce093cced1d50" +dependencies = [ + "futures-core", + "pin-project-lite", +] + [[package]] name = "ouroboros" version = "0.18.3" @@ -2560,16 +2829,10 @@ dependencies = [ ] [[package]] -name = "pango-sys" -version = "0.18.0" +name = "parking" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "436737e391a843e5933d6d9aa102cb126d501e815b83601365a948a518555dc5" -dependencies = [ - "glib-sys", - "gobject-sys", - "libc", - "system-deps", -] +checksum = "bb813b8af86854136c6922af0598d719255ecb2179515e6e7730d468f05c9cae" [[package]] name = "parking_lot" @@ -2716,6 +2979,17 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" +[[package]] +name = "piper" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "668d31b1c4eba19242f2088b2bf3316b82ca31082a8335764db4e083db7485d4" +dependencies = [ + "atomic-waker", + "fastrand", + "futures-io", +] + [[package]] name = "pkg-config" version = "0.3.30" @@ -2780,6 +3054,18 @@ dependencies = [ "windows-sys 0.52.0", ] +[[package]] +name = "pollster" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22686f4785f02a4fcc856d3b3bb19bf6c8160d103f7a99cc258bddd0251dc7f2" + +[[package]] +name = "ppv-lite86" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" + [[package]] name = "presser" version = "0.3.1" @@ -2847,6 +3133,18 @@ version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" dependencies = [ + "libc", + "rand_chacha", + "rand_core", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", "rand_core", ] @@ -2855,6 +3153,9 @@ name = "rand_core" version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom", +] [[package]] name = "range-alloc" @@ -2868,12 +3169,6 @@ version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f60fcc7d6849342eff22c4350c8b9a989ee8ceabc4b481253e8946b9fe83d684" -[[package]] -name = "raw-window-handle" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2ff9a1f06a88b01621b7ae906ef0211290d1c8a168a15542486a8f61c0833b9" - [[package]] name = "raw-window-handle" version = "0.6.0" @@ -3037,21 +3332,21 @@ dependencies = [ [[package]] name = "rfd" -version = "0.13.0" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0d8ab342bcc5436e04d3a4c1e09e17d74958bfaddf8d5fad6f85607df0f994f" +checksum = "373d2fc6310e2d14943d4e66ebed5b774a2b6b3b1610e7377edf124fb2760d6b" dependencies = [ + "ashpd", "block", "dispatch", - "glib-sys", - "gobject-sys", - "gtk-sys", "js-sys", "log", "objc", "objc-foundation", "objc_id", - "raw-window-handle 0.5.2", + "pollster", + "raw-window-handle", + "urlencoding", "wasm-bindgen", "wasm-bindgen-futures", "web-sys", @@ -3375,6 +3670,17 @@ dependencies = [ "serde", ] +[[package]] +name = "serde_repr" +version = "0.1.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b2e6b945e9d3df726b65d6ee24060aff8e3533d431f677a9695db04eff9dfdb" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.52", +] + [[package]] name = "serde_spanned" version = "0.6.5" @@ -3428,12 +3734,32 @@ dependencies = [ "syn 2.0.52", ] +[[package]] +name = "sha1" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3bf829a2d51ab4a5ddf1352d8470c140cadc8301b2ae1789db023f01cedd6ba" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest", +] + [[package]] name = "shlex" version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" +[[package]] +name = "signal-hook-registry" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d8229b473baa5980ac72ef434c4415e70c4b5e71b423043adb4ba059f89c99a1" +dependencies = [ + "libc", +] + [[package]] name = "simd-adler32" version = "0.3.7" @@ -3583,7 +3909,7 @@ dependencies = [ "log", "memmap2 0.9.4", "objc", - "raw-window-handle 0.6.0", + "raw-window-handle", "redox_syscall 0.4.1", "rustix", "tiny-xlib", @@ -3613,9 +3939,9 @@ dependencies = [ [[package]] name = "splines" -version = "4.3.2" +version = "4.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c1e9ef455843d50fe69d0facee2d23a154f69d3e7fb3976eb0233a8cdef184e" +checksum = "228c4551e53c672e86439509545dd7ffcb966b6876c58b108e433a30e6117101" [[package]] name = "static_assertions" @@ -3766,25 +4092,6 @@ dependencies = [ "libc", ] -[[package]] -name = "system-deps" -version = "6.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a2d580ff6a20c55dfb86be5f9c238f67835d0e81cbdea8bf5680e0897320331" -dependencies = [ - "cfg-expr", - "heck", - "pkg-config", - "toml 0.8.10", - "version-compare", -] - -[[package]] -name = "target-lexicon" -version = "0.12.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1fc403891a21bcfb7c37834ba66a547a8f402146eba7265b5a6d88059c9ff2f" - [[package]] name = "tempfile" version = "3.10.1" @@ -4038,6 +4345,23 @@ version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "17f77d76d837a7830fe1d4f12b7b4ba4192c1888001c7164257e4bc6d21d96b4" +[[package]] +name = "typenum" +version = "1.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" + +[[package]] +name = "uds_windows" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "89daebc3e6fd160ac4aa9fc8b3bf71e1f74fbf92367ae71fb83a037e8bf164b9" +dependencies = [ + "memoffset", + "tempfile", + "winapi", +] + [[package]] name = "unicode-bidi" version = "0.3.15" @@ -4128,8 +4452,15 @@ dependencies = [ "form_urlencoded", "idna", "percent-encoding", + "serde", ] +[[package]] +name = "urlencoding" +version = "2.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "daf8dba3b7eb870caf1ddeed7bc9d2a049f3cfdfae7cb521b087cc33ae4c49da" + [[package]] name = "usvg" version = "0.36.0" @@ -4197,12 +4528,6 @@ version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" -[[package]] -name = "version-compare" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "579a42fc0b8e0c63b76519a339be31bed574929511fa53c1a3acae26eb258f29" - [[package]] name = "version_check" version = "0.9.4" @@ -4470,7 +4795,7 @@ dependencies = [ "naga", "parking_lot 0.12.1", "profiling", - "raw-window-handle 0.6.0", + "raw-window-handle", "smallvec", "static_assertions", "wasm-bindgen", @@ -4498,7 +4823,7 @@ dependencies = [ "once_cell", "parking_lot 0.12.1", "profiling", - "raw-window-handle 0.6.0", + "raw-window-handle", "rustc-hash", "smallvec", "thiserror", @@ -4541,7 +4866,7 @@ dependencies = [ "parking_lot 0.12.1", "profiling", "range-alloc", - "raw-window-handle 0.6.0", + "raw-window-handle", "renderdoc-sys", "rustc-hash", "smallvec", @@ -4610,7 +4935,7 @@ dependencies = [ "clipboard_macos", "clipboard_wayland", "clipboard_x11", - "raw-window-handle 0.6.0", + "raw-window-handle", "thiserror", ] @@ -4930,7 +5255,7 @@ dependencies = [ "once_cell", "orbclient", "percent-encoding", - "raw-window-handle 0.6.0", + "raw-window-handle", "redox_syscall 0.3.5", "rustix", "sctk-adwaita", @@ -5026,6 +5351,16 @@ version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a0ccd7b4a5345edfcd0c3535718a4e9ff7798ffc536bb5b5a0e26ff84732911" +[[package]] +name = "xdg-home" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "21e5a325c3cb8398ad6cf859c1135b25dd29e186679cf2da7581d9679f63b38e" +dependencies = [ + "libc", + "winapi", +] + [[package]] name = "xkbcommon-dl" version = "0.4.2" @@ -5081,6 +5416,70 @@ version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c94451ac9513335b5e23d7a8a2b61a7102398b8cca5160829d313e84c9d98be1" +[[package]] +name = "zbus" +version = "4.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9ff46f2a25abd690ed072054733e0bc3157e3d4c45f41bd183dce09c2ff8ab9" +dependencies = [ + "async-broadcast", + "async-executor", + "async-fs", + "async-io", + "async-lock 3.3.0", + "async-process", + "async-recursion", + "async-task", + "async-trait", + "blocking", + "derivative", + "enumflags2", + "event-listener 5.2.0", + "futures-core", + "futures-sink", + "futures-util", + "hex", + "nix 0.28.0", + "ordered-stream", + "rand", + "serde", + "serde_repr", + "sha1", + "static_assertions", + "tracing", + "uds_windows", + "windows-sys 0.52.0", + "xdg-home", + "zbus_macros", + "zbus_names", + "zvariant", +] + +[[package]] +name = "zbus_macros" +version = "4.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e0e3852c93dcdb49c9462afe67a2a468f7bd464150d866e861eaf06208633e0" +dependencies = [ + "proc-macro-crate", + "proc-macro2", + "quote", + "regex", + "syn 1.0.109", + "zvariant_utils", +] + +[[package]] +name = "zbus_names" +version = "3.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4b9b1fef7d021261cc16cba64c351d291b715febe0fa10dc3a443ac5a5022e6c" +dependencies = [ + "serde", + "static_assertions", + "zvariant", +] + [[package]] name = "zeno" version = "0.2.3" @@ -5106,3 +5505,41 @@ dependencies = [ "quote", "syn 2.0.52", ] + +[[package]] +name = "zvariant" +version = "4.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c1b3ca6db667bfada0f1ebfc94b2b1759ba25472ee5373d4551bb892616389a" +dependencies = [ + "endi", + "enumflags2", + "serde", + "static_assertions", + "url", + "zvariant_derive", +] + +[[package]] +name = "zvariant_derive" +version = "4.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7a4b236063316163b69039f77ce3117accb41a09567fd24c168e43491e521bc" +dependencies = [ + "proc-macro-crate", + "proc-macro2", + "quote", + "syn 1.0.109", + "zvariant_utils", +] + +[[package]] +name = "zvariant_utils" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00bedb16a193cc12451873fee2a1bc6550225acece0e36f333e68326c73c8172" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] diff --git a/Cargo.toml b/Cargo.toml index 86505799..6bcf5d2f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,16 +1,16 @@ [package] -name = "sniffnet" -version = "1.2.2" -authors = [ "Giuliano Bellini " ] -edition = "2021" +name = "sniffnet" +version = "1.2.2" +authors = ["Giuliano Bellini "] +edition = "2021" description = "Application to comfortably monitor your network traffic" -readme = "README.md" -homepage = "https://sniffnet.net" -repository = "https://github.com/GyulyVGC/sniffnet" -license = "MIT OR Apache-2.0" -keywords = [ "filter", "network", "packet", "sniffer", "gui" ] -categories = [ "visualization", "gui", "network-programming" ] -include = [ +readme = "README.md" +homepage = "https://sniffnet.net" +repository = "https://github.com/GyulyVGC/sniffnet" +license = "MIT OR Apache-2.0" +keywords = ["filter", "network", "packet", "sniffer", "gui"] +categories = ["visualization", "gui", "network-programming"] +include = [ "/src/**/*.rs", "/LICENSE-MIT", "/LICENSE-APACHE", @@ -51,7 +51,7 @@ dns-lookup = "2.0.4" toml = "0.8.10" once_cell = "1.19.0" ctrlc = { version = "3.4.2", features = ["termination"] } -rfd = "0.13.0" +rfd = "0.14.0" phf = "0.11.2" phf_shared = "0.11.2" splines = "4.3.1" @@ -114,31 +114,31 @@ pre-build = [ #═══════════════════════════════════════════════════════════════════════════════════════════════════════════════════════ [package.metadata.deb] -section="Network" -license-file="resources/packaging/LICENSE" -extended-description-file="resources/packaging/linux/description.txt" -maintainer-scripts="resources/packaging/linux/scripts/" +section = "Network" +license-file = "resources/packaging/LICENSE" +extended-description-file = "resources/packaging/linux/description.txt" +maintainer-scripts = "resources/packaging/linux/scripts/" depends = "libasound2, libpcap0.8, libfontconfig1" assets = [ ["target/release/sniffnet", "/usr/bin/", "755"], ["resources/packaging/linux/sniffnet.desktop", "/usr/share/applications/", "644"], - ["resources/packaging/linux/graphics/sniffnet_8x8.png", "/usr/share/icons/hicolor/8x8/apps/sniffnet.png", "644"], - ["resources/packaging/linux/graphics/sniffnet_16x16.png", "/usr/share/icons/hicolor/16x16/apps/sniffnet.png", "644"], - ["resources/packaging/linux/graphics/sniffnet_22x22.png", "/usr/share/icons/hicolor/22x22/apps/sniffnet.png", "644"], - ["resources/packaging/linux/graphics/sniffnet_24x24.png", "/usr/share/icons/hicolor/24x24/apps/sniffnet.png", "644"], - ["resources/packaging/linux/graphics/sniffnet_32x32.png", "/usr/share/icons/hicolor/32x32/apps/sniffnet.png", "644"], - ["resources/packaging/linux/graphics/sniffnet_36x36.png", "/usr/share/icons/hicolor/36x36/apps/sniffnet.png", "644"], - ["resources/packaging/linux/graphics/sniffnet_42x42.png", "/usr/share/icons/hicolor/42x42/apps/sniffnet.png", "644"], - ["resources/packaging/linux/graphics/sniffnet_48x48.png", "/usr/share/icons/hicolor/48x48/apps/sniffnet.png", "644"], - ["resources/packaging/linux/graphics/sniffnet_64x64.png", "/usr/share/icons/hicolor/64x64/apps/sniffnet.png", "644"], - ["resources/packaging/linux/graphics/sniffnet_72x72.png", "/usr/share/icons/hicolor/72x72/apps/sniffnet.png", "644"], - ["resources/packaging/linux/graphics/sniffnet_96x96.png", "/usr/share/icons/hicolor/96x96/apps/sniffnet.png", "644"], - ["resources/packaging/linux/graphics/sniffnet_128x128.png", "/usr/share/icons/hicolor/128x128/apps/sniffnet.png", "644"], - ["resources/packaging/linux/graphics/sniffnet_160x160.png", "/usr/share/icons/hicolor/160x160/apps/sniffnet.png", "644"], - ["resources/packaging/linux/graphics/sniffnet_192x192.png", "/usr/share/icons/hicolor/192x192/apps/sniffnet.png", "644"], - ["resources/packaging/linux/graphics/sniffnet_256x256.png", "/usr/share/icons/hicolor/256x256/apps/sniffnet.png", "644"], - ["resources/packaging/linux/graphics/sniffnet_384x384.png", "/usr/share/icons/hicolor/384x384/apps/sniffnet.png", "644"], - ["resources/packaging/linux/graphics/sniffnet_512x512.png", "/usr/share/icons/hicolor/512x512/apps/sniffnet.png", "644"], + ["resources/packaging/linux/graphics/sniffnet_8x8.png", "/usr/share/icons/hicolor/8x8/apps/sniffnet.png", "644"], + ["resources/packaging/linux/graphics/sniffnet_16x16.png", "/usr/share/icons/hicolor/16x16/apps/sniffnet.png", "644"], + ["resources/packaging/linux/graphics/sniffnet_22x22.png", "/usr/share/icons/hicolor/22x22/apps/sniffnet.png", "644"], + ["resources/packaging/linux/graphics/sniffnet_24x24.png", "/usr/share/icons/hicolor/24x24/apps/sniffnet.png", "644"], + ["resources/packaging/linux/graphics/sniffnet_32x32.png", "/usr/share/icons/hicolor/32x32/apps/sniffnet.png", "644"], + ["resources/packaging/linux/graphics/sniffnet_36x36.png", "/usr/share/icons/hicolor/36x36/apps/sniffnet.png", "644"], + ["resources/packaging/linux/graphics/sniffnet_42x42.png", "/usr/share/icons/hicolor/42x42/apps/sniffnet.png", "644"], + ["resources/packaging/linux/graphics/sniffnet_48x48.png", "/usr/share/icons/hicolor/48x48/apps/sniffnet.png", "644"], + ["resources/packaging/linux/graphics/sniffnet_64x64.png", "/usr/share/icons/hicolor/64x64/apps/sniffnet.png", "644"], + ["resources/packaging/linux/graphics/sniffnet_72x72.png", "/usr/share/icons/hicolor/72x72/apps/sniffnet.png", "644"], + ["resources/packaging/linux/graphics/sniffnet_96x96.png", "/usr/share/icons/hicolor/96x96/apps/sniffnet.png", "644"], + ["resources/packaging/linux/graphics/sniffnet_128x128.png", "/usr/share/icons/hicolor/128x128/apps/sniffnet.png", "644"], + ["resources/packaging/linux/graphics/sniffnet_160x160.png", "/usr/share/icons/hicolor/160x160/apps/sniffnet.png", "644"], + ["resources/packaging/linux/graphics/sniffnet_192x192.png", "/usr/share/icons/hicolor/192x192/apps/sniffnet.png", "644"], + ["resources/packaging/linux/graphics/sniffnet_256x256.png", "/usr/share/icons/hicolor/256x256/apps/sniffnet.png", "644"], + ["resources/packaging/linux/graphics/sniffnet_384x384.png", "/usr/share/icons/hicolor/384x384/apps/sniffnet.png", "644"], + ["resources/packaging/linux/graphics/sniffnet_512x512.png", "/usr/share/icons/hicolor/512x512/apps/sniffnet.png", "644"], ["resources/packaging/linux/graphics/sniffnet_1024x1024.png", "/usr/share/icons/hicolor/1024x1024/apps/sniffnet.png", "644"] ] @@ -150,23 +150,23 @@ pre_uninstall_script = "setcap '' /usr/bin/sniffnet" assets = [ { source = "target/release/sniffnet", dest = "/usr/bin/", mode = "755" }, { source = "resources/packaging/linux/sniffnet.desktop", dest = "/usr/share/applications/", mode = "644" }, - { source = "resources/packaging/linux/graphics/sniffnet_8x8.png", dest = "/usr/share/icons/hicolor/8x8/apps/sniffnet.png", mode = "644" }, - { source = "resources/packaging/linux/graphics/sniffnet_16x16.png", dest = "/usr/share/icons/hicolor/16x16/apps/sniffnet.png", mode = "644" }, - { source = "resources/packaging/linux/graphics/sniffnet_22x22.png", dest = "/usr/share/icons/hicolor/22x22/apps/sniffnet.png", mode = "644" }, - { source = "resources/packaging/linux/graphics/sniffnet_24x24.png", dest = "/usr/share/icons/hicolor/24x24/apps/sniffnet.png", mode = "644" }, - { source = "resources/packaging/linux/graphics/sniffnet_32x32.png", dest = "/usr/share/icons/hicolor/32x32/apps/sniffnet.png", mode = "644" }, - { source = "resources/packaging/linux/graphics/sniffnet_36x36.png", dest = "/usr/share/icons/hicolor/36x36/apps/sniffnet.png", mode = "644" }, - { source = "resources/packaging/linux/graphics/sniffnet_42x42.png", dest = "/usr/share/icons/hicolor/42x42/apps/sniffnet.png", mode = "644" }, - { source = "resources/packaging/linux/graphics/sniffnet_48x48.png", dest = "/usr/share/icons/hicolor/48x48/apps/sniffnet.png", mode = "644" }, - { source = "resources/packaging/linux/graphics/sniffnet_64x64.png", dest = "/usr/share/icons/hicolor/64x64/apps/sniffnet.png", mode = "644" }, - { source = "resources/packaging/linux/graphics/sniffnet_72x72.png", dest = "/usr/share/icons/hicolor/72x72/apps/sniffnet.png", mode = "644" }, - { source = "resources/packaging/linux/graphics/sniffnet_96x96.png", dest = "/usr/share/icons/hicolor/96x96/apps/sniffnet.png", mode = "644" }, - { source = "resources/packaging/linux/graphics/sniffnet_128x128.png", dest = "/usr/share/icons/hicolor/128x128/apps/sniffnet.png", mode = "644" }, - { source = "resources/packaging/linux/graphics/sniffnet_160x160.png", dest = "/usr/share/icons/hicolor/160x160/apps/sniffnet.png", mode = "644" }, - { source = "resources/packaging/linux/graphics/sniffnet_192x192.png", dest = "/usr/share/icons/hicolor/192x192/apps/sniffnet.png", mode = "644" }, - { source = "resources/packaging/linux/graphics/sniffnet_256x256.png", dest = "/usr/share/icons/hicolor/256x256/apps/sniffnet.png", mode = "644" }, - { source = "resources/packaging/linux/graphics/sniffnet_384x384.png", dest = "/usr/share/icons/hicolor/384x384/apps/sniffnet.png", mode = "644" }, - { source = "resources/packaging/linux/graphics/sniffnet_512x512.png", dest = "/usr/share/icons/hicolor/512x512/apps/sniffnet.png", mode = "644" }, + { source = "resources/packaging/linux/graphics/sniffnet_8x8.png", dest = "/usr/share/icons/hicolor/8x8/apps/sniffnet.png", mode = "644" }, + { source = "resources/packaging/linux/graphics/sniffnet_16x16.png", dest = "/usr/share/icons/hicolor/16x16/apps/sniffnet.png", mode = "644" }, + { source = "resources/packaging/linux/graphics/sniffnet_22x22.png", dest = "/usr/share/icons/hicolor/22x22/apps/sniffnet.png", mode = "644" }, + { source = "resources/packaging/linux/graphics/sniffnet_24x24.png", dest = "/usr/share/icons/hicolor/24x24/apps/sniffnet.png", mode = "644" }, + { source = "resources/packaging/linux/graphics/sniffnet_32x32.png", dest = "/usr/share/icons/hicolor/32x32/apps/sniffnet.png", mode = "644" }, + { source = "resources/packaging/linux/graphics/sniffnet_36x36.png", dest = "/usr/share/icons/hicolor/36x36/apps/sniffnet.png", mode = "644" }, + { source = "resources/packaging/linux/graphics/sniffnet_42x42.png", dest = "/usr/share/icons/hicolor/42x42/apps/sniffnet.png", mode = "644" }, + { source = "resources/packaging/linux/graphics/sniffnet_48x48.png", dest = "/usr/share/icons/hicolor/48x48/apps/sniffnet.png", mode = "644" }, + { source = "resources/packaging/linux/graphics/sniffnet_64x64.png", dest = "/usr/share/icons/hicolor/64x64/apps/sniffnet.png", mode = "644" }, + { source = "resources/packaging/linux/graphics/sniffnet_72x72.png", dest = "/usr/share/icons/hicolor/72x72/apps/sniffnet.png", mode = "644" }, + { source = "resources/packaging/linux/graphics/sniffnet_96x96.png", dest = "/usr/share/icons/hicolor/96x96/apps/sniffnet.png", mode = "644" }, + { source = "resources/packaging/linux/graphics/sniffnet_128x128.png", dest = "/usr/share/icons/hicolor/128x128/apps/sniffnet.png", mode = "644" }, + { source = "resources/packaging/linux/graphics/sniffnet_160x160.png", dest = "/usr/share/icons/hicolor/160x160/apps/sniffnet.png", mode = "644" }, + { source = "resources/packaging/linux/graphics/sniffnet_192x192.png", dest = "/usr/share/icons/hicolor/192x192/apps/sniffnet.png", mode = "644" }, + { source = "resources/packaging/linux/graphics/sniffnet_256x256.png", dest = "/usr/share/icons/hicolor/256x256/apps/sniffnet.png", mode = "644" }, + { source = "resources/packaging/linux/graphics/sniffnet_384x384.png", dest = "/usr/share/icons/hicolor/384x384/apps/sniffnet.png", mode = "644" }, + { source = "resources/packaging/linux/graphics/sniffnet_512x512.png", dest = "/usr/share/icons/hicolor/512x512/apps/sniffnet.png", mode = "644" }, { source = "resources/packaging/linux/graphics/sniffnet_1024x1024.png", dest = "/usr/share/icons/hicolor/1024x1024/apps/sniffnet.png", mode = "644" } ] diff --git a/src/chart/manage_chart_data.rs b/src/chart/manage_chart_data.rs index 9be4d35f..b0f721d3 100644 --- a/src/chart/manage_chart_data.rs +++ b/src/chart/manage_chart_data.rs @@ -83,6 +83,14 @@ mod tests { use crate::chart::manage_chart_data::{get_max, get_min, update_charts_data}; use crate::{ChartType, Language, RunTimeData, StyleType, TrafficChart}; + fn spline_from_vec(vec: Vec<(i32, i32)>) -> Spline { + Spline::from_vec( + vec.iter() + .map(|&(x, y)| Key::new(x as f32, y as f32, Interpolation::Cosine)) + .collect::>>(), + ) + } + #[test] fn test_chart_data_updates() { let sent_vec = vec![ @@ -116,12 +124,7 @@ mod tests { (27, -1000), (28, -1000), ]; - let sent = Spline::from_vec( - sent_vec - .iter() - .map(|&(x, y)| Key::new(x as f32, y as f32, Interpolation::Cosine)) - .collect(), - ); + let sent = spline_from_vec(sent_vec); let received_vec = vec![ (0, 1000), (1, 21000), @@ -153,12 +156,7 @@ mod tests { (27, 21000), (28, 21000), ]; - let received = Spline::from_vec( - received_vec - .iter() - .map(|&(x, y)| Key::new(x as f32, y as f32, Interpolation::Cosine)) - .collect(), - ); + let received = spline_from_vec(received_vec); let tot_sent = 1000 * 28 + 500; let tot_received = 21000 * 28 + 1000; let mut traffic_chart = TrafficChart { diff --git a/src/chart/types/traffic_chart.rs b/src/chart/types/traffic_chart.rs index 01e2592b..2335e522 100644 --- a/src/chart/types/traffic_chart.rs +++ b/src/chart/types/traffic_chart.rs @@ -282,7 +282,7 @@ mod tests { let spline = Spline::from_vec( vec.iter() .map(|&(x, y)| Key::new(x as f32, y as f32, Interpolation::Cosine)) - .collect(), + .collect::>>(), ); let eps = 0.001; diff --git a/src/cli/mod.rs b/src/cli/mod.rs index 34f587f6..ec041c67 100644 --- a/src/cli/mod.rs +++ b/src/cli/mod.rs @@ -88,8 +88,8 @@ mod tests { device_name: "hey-hey".to_string(), }, window: ConfigWindow { - position: (440, 99), - size: (452, 870), + position: (440.0, 99.0), + size: (452.0, 870.0), }, }; // we want to be sure that modified config is different from defaults diff --git a/src/gui/types/sniffer.rs b/src/gui/types/sniffer.rs index 5741b5ab..6b2e2195 100644 --- a/src/gui/types/sniffer.rs +++ b/src/gui/types/sniffer.rs @@ -1668,14 +1668,14 @@ mod tests { assert_eq!( window_start, ConfigWindow { - position: (0, 0), - size: (1190, 670), + position: (0.0, 0.0), + size: (1190.0, 670.0), } ); // change window properties by sending messages - sniffer.update(Message::WindowMoved(-10, 555)); - sniffer.update(Message::WindowResized(1000, 999)); + sniffer.update(Message::WindowMoved(-10.0, 555.0)); + sniffer.update(Message::WindowResized(1000.0, 999.0)); // quit the app by sending a CloseRequested message sniffer.update(Message::CloseRequested); @@ -1692,8 +1692,8 @@ mod tests { assert_eq!( window_end, ConfigWindow { - position: (-10, 555), - size: (1000, 999), + position: (-10.0, 555.0), + size: (1000.0, 999.0), } ); } From f70c139f8d3ed1e2d376934869c0c31f9b2ddd8e Mon Sep 17 00:00:00 2001 From: Giuliano Bellini s294739 Date: Fri, 8 Mar 2024 13:37:28 +0100 Subject: [PATCH 08/12] fix warnings and clippy --- src/chart/types/traffic_chart.rs | 5 ++--- src/configs/types/config_window.rs | 22 +++++++++++--------- src/countries/country_utils.rs | 2 +- src/gui/app.rs | 12 +++-------- src/gui/components/button.rs | 2 +- src/gui/components/footer.rs | 4 ++-- src/gui/components/header.rs | 3 +-- src/gui/components/modal.rs | 19 +++++++---------- src/gui/components/tab.rs | 2 +- src/gui/pages/connection_details_page.rs | 2 +- src/gui/pages/initial_page.rs | 2 +- src/gui/pages/inspect_page.rs | 2 +- src/gui/pages/notifications_page.rs | 2 +- src/gui/pages/overview_page.rs | 2 +- src/gui/pages/settings_general_page.rs | 6 ++++-- src/gui/pages/settings_notifications_page.rs | 2 +- src/gui/pages/settings_style_page.rs | 10 ++++----- src/gui/pages/types/running_page.rs | 2 -- src/gui/pages/types/settings_page.rs | 2 -- src/gui/styles/button.rs | 2 +- src/gui/styles/scrollbar.rs | 5 +++-- src/gui/styles/text.rs | 2 +- src/gui/types/message.rs | 6 ++---- src/gui/types/sniffer.rs | 4 ++-- src/main.rs | 2 +- src/networking/types/my_link_type.rs | 2 +- src/notifications/types/sound.rs | 2 +- src/report/types/report_sort_type.rs | 1 - src/report/types/sort_type.rs | 1 - src/translations/translations.rs | 1 - src/translations/translations_3.rs | 1 - src/translations/types/language.rs | 2 +- src/utils/types/icon.rs | 1 - 33 files changed, 59 insertions(+), 76 deletions(-) diff --git a/src/chart/types/traffic_chart.rs b/src/chart/types/traffic_chart.rs index 2335e522..db7ed2a8 100644 --- a/src/chart/types/traffic_chart.rs +++ b/src/chart/types/traffic_chart.rs @@ -1,8 +1,7 @@ //! This module defines the behavior of the `TrafficChart` struct, used to display chart in GUI run page -use iced::alignment::{Horizontal, Vertical}; -use iced::widget::{Column, Container}; -use iced::{Element, Length, Renderer, Theme}; +use iced::widget::Container; +use iced::Element; use plotters::prelude::*; use plotters_iced::{Chart, ChartBuilder, ChartWidget, DrawingBackend}; use splines::Spline; diff --git a/src/configs/types/config_window.rs b/src/configs/types/config_window.rs index f78fc51b..d4012371 100644 --- a/src/configs/types/config_window.rs +++ b/src/configs/types/config_window.rs @@ -7,8 +7,8 @@ use crate::SNIFFNET_LOWERCASE; #[derive(Serialize, Deserialize, Copy, Clone, PartialEq, Debug)] pub struct ConfigWindow { - pub position: (f32, f32), - pub size: (f32, f32), + pub position: (i32, i32), + pub size: (u32, u32), } impl ConfigWindow { @@ -33,8 +33,8 @@ impl ConfigWindow { impl Default for ConfigWindow { fn default() -> Self { Self { - position: (0.0, 0.0), - size: (1190.0, 670.0), + position: (0, 0), + size: (1190, 670), } } } @@ -43,11 +43,12 @@ pub trait ToPosition { fn to_position(self) -> Position; } -impl ToPosition for (f32, f32) { +impl ToPosition for (i32, i32) { fn to_position(self) -> Position { + #[allow(clippy::cast_precision_loss)] Position::Specific(Point { - x: self.0, - y: self.1, + x: self.0 as f32, + y: self.1 as f32, }) } } @@ -56,11 +57,12 @@ pub trait ToSize { fn to_size(self) -> Size; } -impl ToSize for (f32, f32) { +impl ToSize for (u32, u32) { fn to_size(self) -> Size { + #[allow(clippy::cast_precision_loss)] Size { - width: self.0, - height: self.1, + width: self.0 as f32, + height: self.1 as f32, } } } diff --git a/src/countries/country_utils.rs b/src/countries/country_utils.rs index 2a293522..80d2900c 100644 --- a/src/countries/country_utils.rs +++ b/src/countries/country_utils.rs @@ -2,7 +2,7 @@ use iced::widget::svg::Handle; use iced::widget::tooltip::Position; use iced::widget::Tooltip; use iced::widget::{Svg, Text}; -use iced::{Font, Length, Renderer, Theme}; +use iced::{Font, Length}; use crate::countries::flags_pictures::{ AD, AE, AF, AG, AI, AL, AM, AO, AQ, AR, AS, AT, AU, AW, AX, AZ, BA, BB, BD, BE, BF, BG, BH, BI, diff --git a/src/gui/app.rs b/src/gui/app.rs index 9d96d7dd..6244be14 100644 --- a/src/gui/app.rs +++ b/src/gui/app.rs @@ -9,10 +9,7 @@ use iced::keyboard::{Event, Key, Modifiers}; use iced::widget::Column; use iced::window::Id; use iced::Event::{Keyboard, Window}; -use iced::{ - executor, font, subscription, window, Application, Command, Element, Renderer, Subscription, - Theme, -}; +use iced::{executor, window, Application, Command, Element, Subscription}; use crate::gui::components::footer::footer; use crate::gui::components::header::header; @@ -28,7 +25,6 @@ use crate::gui::pages::settings_notifications_page::settings_notifications_page; use crate::gui::pages::settings_style_page::settings_style_page; use crate::gui::pages::types::running_page::RunningPage; use crate::gui::pages::types::settings_page::SettingsPage; -use crate::gui::styles::style_constants::{ICONS_BYTES, SARASA_MONO_BOLD_BYTES, SARASA_MONO_BYTES}; use crate::gui::types::message::Message; use crate::gui::types::sniffer::Sniffer; use crate::{ConfigSettings, StyleType, SNIFFNET_TITLECASE}; @@ -128,11 +124,9 @@ impl Application for Sniffer { const NO_MODIFIER: Modifiers = Modifiers::empty(); let window_events_subscription = iced::event::listen_with(|event, _| match event { Window(Id::MAIN, window::Event::Focused) => Some(Message::WindowFocused), - Window(Id::MAIN, window::Event::Moved { x, y }) => { - Some(Message::WindowMoved(x as f32, y as f32)) - } + Window(Id::MAIN, window::Event::Moved { x, y }) => Some(Message::WindowMoved(x, y)), Window(Id::MAIN, window::Event::Resized { width, height }) => { - Some(Message::WindowResized(width as f32, height as f32)) + Some(Message::WindowResized(width, height)) } Window(Id::MAIN, window::Event::CloseRequested) => Some(Message::CloseRequested), _ => None, diff --git a/src/gui/components/button.rs b/src/gui/components/button.rs index 762e26f2..9f8ffac4 100644 --- a/src/gui/components/button.rs +++ b/src/gui/components/button.rs @@ -4,7 +4,7 @@ use iced::alignment::{Horizontal, Vertical}; use iced::widget::text::LineHeight; use iced::widget::tooltip::Position; use iced::widget::{button, Text, Tooltip}; -use iced::{Font, Length, Renderer, Theme}; +use iced::{Font, Length}; use crate::gui::styles::container::ContainerType; use crate::gui::types::message::Message; diff --git a/src/gui/components/footer.rs b/src/gui/components/footer.rs index 00b2e96d..1a7d8484 100644 --- a/src/gui/components/footer.rs +++ b/src/gui/components/footer.rs @@ -5,9 +5,9 @@ use std::sync::{Arc, Mutex}; use iced::alignment::{Horizontal, Vertical}; use iced::widget::text::LineHeight; use iced::widget::tooltip::Position; +use iced::widget::Space; use iced::widget::{button, Container, Row, Text, Tooltip}; -use iced::widget::{horizontal_space, Space}; -use iced::{Alignment, Font, Length, Renderer, Theme}; +use iced::{Alignment, Font, Length}; use crate::gui::styles::button::ButtonType; use crate::gui::styles::container::ContainerType; diff --git a/src/gui/components/header.rs b/src/gui/components/header.rs index 3a845218..3db8774d 100644 --- a/src/gui/components/header.rs +++ b/src/gui/components/header.rs @@ -4,8 +4,7 @@ use iced::alignment::{Horizontal, Vertical}; use iced::widget::text::LineHeight; use iced::widget::tooltip::Position; use iced::widget::{button, horizontal_space, Container, Row, Space, Text, Tooltip}; -use iced::Length::FillPortion; -use iced::{Alignment, Font, Length, Renderer, Theme}; +use iced::{Alignment, Font, Length}; use crate::gui::pages::types::settings_page::SettingsPage; use crate::gui::styles::container::ContainerType; diff --git a/src/gui/components/modal.rs b/src/gui/components/modal.rs index b4eb2bbe..4454ca3f 100644 --- a/src/gui/components/modal.rs +++ b/src/gui/components/modal.rs @@ -4,11 +4,8 @@ use iced::advanced::renderer; use iced::advanced::widget::{self, Widget}; use iced::advanced::{self, Clipboard, Shell}; use iced::alignment::{Alignment, Horizontal, Vertical}; -use iced::widget::{button, horizontal_space, Column, Container, Row, Space, Text}; -use iced::{ - event, mouse, Border, Color, Element, Event, Font, Length, Point, Rectangle, Renderer, Size, - Theme, Vector, -}; +use iced::widget::{button, Column, Container, Row, Space, Text}; +use iced::{event, mouse, Color, Element, Event, Font, Length, Point, Rectangle, Size, Vector}; use crate::gui::components::button::button_hide; use crate::gui::styles::button::ButtonType; @@ -139,10 +136,10 @@ fn confirm_button_row( ) } -/// A widget that centers a modal element over some base element +/// A widget that centers an overlay element over some base element pub struct Modal<'a, Message, Theme, Renderer> { base: Element<'a, Message, Theme, Renderer>, - modal: Element<'a, Message, Theme, Renderer>, + overlay: Element<'a, Message, Theme, Renderer>, on_blur: Option, } @@ -154,7 +151,7 @@ impl<'a, Message, Theme, Renderer> Modal<'a, Message, Theme, Renderer> { ) -> Self { Self { base: base.into(), - modal: modal.into(), + overlay: modal.into(), on_blur: None, } } @@ -178,12 +175,12 @@ where fn children(&self) -> Vec { vec![ widget::Tree::new(&self.base), - widget::Tree::new(&self.modal), + widget::Tree::new(&self.overlay), ] } fn diff(&self, tree: &mut widget::Tree) { - tree.diff_children(&[&self.base, &self.modal]); + tree.diff_children(&[&self.base, &self.overlay]); } fn size(&self) -> Size { @@ -254,7 +251,7 @@ where ) -> Option> { Some(overlay::Element::new(Box::new(Overlay { position: layout.position() + translation, - content: &mut self.modal, + content: &mut self.overlay, tree: &mut state.children[1], size: layout.bounds().size(), on_blur: self.on_blur.clone(), diff --git a/src/gui/components/tab.rs b/src/gui/components/tab.rs index fa699693..62a85695 100644 --- a/src/gui/components/tab.rs +++ b/src/gui/components/tab.rs @@ -3,7 +3,7 @@ use iced::alignment::Vertical; use iced::widget::text::LineHeight; use iced::widget::{button, horizontal_space, Button, Container, Row, Space, Text}; -use iced::{alignment, Alignment, Font, Length, Renderer, Theme}; +use iced::{alignment, Alignment, Font, Length}; use crate::gui::pages::types::settings_page::SettingsPage; use crate::gui::styles::button::ButtonType; diff --git a/src/gui/pages/connection_details_page.rs b/src/gui/pages/connection_details_page.rs index 5c345135..a1d006e7 100644 --- a/src/gui/pages/connection_details_page.rs +++ b/src/gui/pages/connection_details_page.rs @@ -6,7 +6,7 @@ use iced::widget::tooltip::Position; use iced::widget::{button, lazy, Rule, Scrollable, Space}; use iced::widget::{Column, Container, Row, Text, Tooltip}; use iced::Length::Fixed; -use iced::{Alignment, Font, Length, Renderer, Theme}; +use iced::{Alignment, Font, Length}; use crate::countries::country_utils::{get_computer_tooltip, get_flag_tooltip}; use crate::countries::flags_pictures::FLAGS_WIDTH_BIG; diff --git a/src/gui/pages/initial_page.rs b/src/gui/pages/initial_page.rs index ee19a28e..0df0730f 100644 --- a/src/gui/pages/initial_page.rs +++ b/src/gui/pages/initial_page.rs @@ -11,7 +11,7 @@ use iced::widget::{ button, Button, Column, Container, Row, Rule, Scrollable, Space, Text, TextInput, Tooltip, }; use iced::Length::FillPortion; -use iced::{alignment, Font, Length, Renderer, Theme}; +use iced::{alignment, Font, Length}; use pcap::Device; use crate::gui::styles::button::ButtonType; diff --git a/src/gui/pages/inspect_page.rs b/src/gui/pages/inspect_page.rs index 7609dc86..50cab4c5 100644 --- a/src/gui/pages/inspect_page.rs +++ b/src/gui/pages/inspect_page.rs @@ -7,7 +7,7 @@ use iced::widget::text_input::Side; use iced::widget::tooltip::Position; use iced::widget::{button, text_input, Rule, Space, Toggler, Tooltip}; use iced::widget::{lazy, Button, Column, Container, Row, Scrollable, Text, TextInput}; -use iced::{alignment, Alignment, Font, Length, Pixels, Renderer, Theme}; +use iced::{alignment, Alignment, Font, Length, Pixels}; use crate::gui::components::tab::get_pages_tabs; use crate::gui::components::types::my_modal::MyModal; diff --git a/src/gui/pages/notifications_page.rs b/src/gui/pages/notifications_page.rs index f8aefe44..d117b2e8 100644 --- a/src/gui/pages/notifications_page.rs +++ b/src/gui/pages/notifications_page.rs @@ -5,7 +5,7 @@ use iced::widget::tooltip::Position; use iced::widget::{button, Space}; use iced::widget::{lazy, Column, Container, Row, Scrollable, Text, Tooltip}; use iced::Length::FillPortion; -use iced::{Alignment, Font, Length, Renderer, Theme}; +use iced::{Alignment, Font, Length}; use crate::countries::country_utils::get_flag_tooltip; use crate::countries::flags_pictures::FLAGS_WIDTH_BIG; diff --git a/src/gui/pages/overview_page.rs b/src/gui/pages/overview_page.rs index a986b133..9cd5cd7d 100644 --- a/src/gui/pages/overview_page.rs +++ b/src/gui/pages/overview_page.rs @@ -12,7 +12,7 @@ use iced::widget::{ Tooltip, }; use iced::Length::{Fill, FillPortion, Fixed}; -use iced::{Alignment, Font, Length, Renderer, Theme}; +use iced::{Alignment, Font, Length}; use crate::countries::country_utils::get_flag_tooltip; use crate::countries::flags_pictures::FLAGS_WIDTH_BIG; diff --git a/src/gui/pages/settings_general_page.rs b/src/gui/pages/settings_general_page.rs index 4dc8d86f..9a380936 100644 --- a/src/gui/pages/settings_general_page.rs +++ b/src/gui/pages/settings_general_page.rs @@ -1,10 +1,11 @@ use std::sync::Arc; use iced::alignment::{Horizontal, Vertical}; +use iced::widget::text::LineHeight; use iced::widget::tooltip::Position; use iced::widget::{button, Column, Container, PickList, Row, Rule, Slider, Space, Text, Tooltip}; use iced::Length::Fixed; -use iced::{Alignment, Font, Length, Renderer, Theme}; +use iced::{Alignment, Font, Length}; use crate::gui::components::button::button_open_file; use crate::gui::components::tab::get_settings_tabs; @@ -125,7 +126,8 @@ fn language_picklist(language: Language, font: Font) -> Container<'static, Messa .font(font) .vertical_alignment(Vertical::Center) .horizontal_alignment(Horizontal::Center) - .size(15), + .size(15) + .line_height(LineHeight::Relative(1.0)), ) .on_press(Message::OpenWebPage(WebPage::IssueLanguages)) .padding(2) diff --git a/src/gui/pages/settings_notifications_page.rs b/src/gui/pages/settings_notifications_page.rs index 47a1829c..92e98fe6 100644 --- a/src/gui/pages/settings_notifications_page.rs +++ b/src/gui/pages/settings_notifications_page.rs @@ -3,7 +3,7 @@ use iced::widget::scrollable::Direction; use iced::widget::{Button, Slider}; use iced::widget::{Checkbox, Column, Container, Row, Scrollable, Space, Text, TextInput}; use iced::Length::Fixed; -use iced::{Alignment, Font, Length, Renderer, Theme}; +use iced::{Alignment, Font, Length}; use crate::gui::components::button::button_hide; use crate::gui::components::tab::get_settings_tabs; diff --git a/src/gui/pages/settings_style_page.rs b/src/gui/pages/settings_style_page.rs index 1a5a845d..76c5cbc5 100644 --- a/src/gui/pages/settings_style_page.rs +++ b/src/gui/pages/settings_style_page.rs @@ -1,9 +1,9 @@ use iced::alignment::{Horizontal, Vertical}; use iced::widget::scrollable::Direction; -use iced::widget::{button, horizontal_space, lazy, Rule, Space}; +use iced::widget::{button, lazy, Rule, Space}; use iced::widget::{Button, Column, Container, Row, Scrollable, Text}; use iced::Length::Fixed; -use iced::{Alignment, Color, Element, Font, Length, Renderer, Theme}; +use iced::{Alignment, Color, Element, Font, Length}; use crate::gui::components::button::button_open_file; use crate::gui::components::tab::get_settings_tabs; @@ -75,7 +75,7 @@ pub fn settings_style_page(sniffer: &Sniffer) -> Container { yeti_night_translation(language).to_string(), Night, )) - .push(Space::with_width(Length::Fixed(15.0))) + .push(Space::with_width(Length::Fixed(10.0))) .push(get_palette_container( style, "Yeti Day".to_string(), @@ -92,7 +92,7 @@ pub fn settings_style_page(sniffer: &Sniffer) -> Container { deep_sea_translation(language).to_string(), DeepSea, )) - .push(Space::with_width(Length::Fixed(15.0))) + .push(Space::with_width(Length::Fixed(10.0))) .push(get_palette_container( style, "Mon Amour".to_string(), @@ -277,7 +277,7 @@ fn get_extra_palettes( children.extend([ Row::new() .push(first) - .push(Space::with_width(Length::Fixed(15.0))) + .push(Space::with_width(Length::Fixed(10.0))) .push(second) .into(), >>::into(Space::with_height( diff --git a/src/gui/pages/types/running_page.rs b/src/gui/pages/types/running_page.rs index 2a928b6a..23a84979 100644 --- a/src/gui/pages/types/running_page.rs +++ b/src/gui/pages/types/running_page.rs @@ -1,5 +1,3 @@ -use iced::{Renderer, Theme}; - use crate::gui::types::message::Message; use crate::translations::translations::{notifications_translation, overview_translation}; use crate::translations::translations_2::inspect_translation; diff --git a/src/gui/pages/types/settings_page.rs b/src/gui/pages/types/settings_page.rs index 1ec31fd5..969ba4c6 100644 --- a/src/gui/pages/types/settings_page.rs +++ b/src/gui/pages/types/settings_page.rs @@ -1,5 +1,3 @@ -use iced::{Renderer, Theme}; - use crate::gui::types::message::Message; use crate::translations::translations::{notifications_translation, style_translation}; use crate::translations::translations_3::general_translation; diff --git a/src/gui/styles/button.rs b/src/gui/styles/button.rs index 6eafc053..c2bd5e0a 100644 --- a/src/gui/styles/button.rs +++ b/src/gui/styles/button.rs @@ -249,7 +249,7 @@ impl button::StyleSheet for StyleType { a: ext.alpha_chart_badge, ..colors.text_body }, - shadow: Default::default(), + shadow: Shadow::default(), }, _ => button::StyleSheet::active(self, style), } diff --git a/src/gui/styles/scrollbar.rs b/src/gui/styles/scrollbar.rs index dc4d2f91..6e575cc4 100644 --- a/src/gui/styles/scrollbar.rs +++ b/src/gui/styles/scrollbar.rs @@ -2,6 +2,7 @@ #![allow(clippy::module_name_repetitions)] +use iced::widget::container; use iced::widget::scrollable::{Appearance, Properties}; use iced::widget::scrollable::{Scrollbar, Scroller}; use iced::{Background, Border, Color}; @@ -28,7 +29,7 @@ impl iced::widget::scrollable::StyleSheet for StyleType { fn active(&self, _: &Self::Style) -> Appearance { let ext = self.get_extension(); Appearance { - container: Default::default(), + container: container::Appearance::default(), scrollbar: Scrollbar { background: Some(Background::Color(Color::TRANSPARENT)), scroller: Scroller { @@ -56,7 +57,7 @@ impl iced::widget::scrollable::StyleSheet for StyleType { let colors = self.get_palette(); let ext = self.get_extension(); Appearance { - container: Default::default(), + container: container::Appearance::default(), scrollbar: Scrollbar { background: Some(Background::Color(Color { a: ext.alpha_round_borders, diff --git a/src/gui/styles/text.rs b/src/gui/styles/text.rs index 8e6a750e..63a1cf60 100644 --- a/src/gui/styles/text.rs +++ b/src/gui/styles/text.rs @@ -4,7 +4,7 @@ use iced::widget::text::Appearance; use iced::widget::{Column, Text}; -use iced::{Color, Font, Renderer}; +use iced::{Color, Font}; use crate::gui::types::message::Message; use crate::StyleType; diff --git a/src/gui/types/message.rs b/src/gui/types/message.rs index 938761d5..f7ded251 100644 --- a/src/gui/types/message.rs +++ b/src/gui/types/message.rs @@ -1,5 +1,3 @@ -use iced::font; - use crate::gui::components::types::my_modal::MyModal; use crate::gui::pages::types::running_page::RunningPage; use crate::gui::pages::types::settings_page::SettingsPage; @@ -94,9 +92,9 @@ pub enum Message { /// Set UI scale factor ChangeScaleFactor(f64), /// The app window position has been changed - WindowMoved(f32, f32), + WindowMoved(i32, i32), /// The app window size has been changed - WindowResized(f32, f32), + WindowResized(u32, u32), /// The country MMDB custom path has been updated CustomCountryDb(String), /// The ASN MMDB custom path has been updated diff --git a/src/gui/types/sniffer.rs b/src/gui/types/sniffer.rs index 6b2e2195..6db83a14 100644 --- a/src/gui/types/sniffer.rs +++ b/src/gui/types/sniffer.rs @@ -278,8 +278,8 @@ impl Sniffer { #[allow(clippy::cast_possible_truncation, clippy::cast_sign_loss)] Message::WindowResized(width, height) => { let scale_factor = self.configs.lock().unwrap().settings.scale_factor; - let scaled_width = width * scale_factor as f32; - let scaled_height = height * scale_factor as f32; + let scaled_width = (f64::from(width) * scale_factor) as u32; + let scaled_height = (f64::from(height) * scale_factor) as u32; self.configs.lock().unwrap().window.size = (scaled_width, scaled_height); } Message::CustomCountryDb(db) => { diff --git a/src/main.rs b/src/main.rs index 02fdcab8..cdba4cda 100644 --- a/src/main.rs +++ b/src/main.rs @@ -95,7 +95,7 @@ pub fn main() -> iced::Result { window: window::Settings { size: size.to_size(), // start size position: position.to_position(), - min_size: Some((800.0, 500.0).to_size()), // min size allowed + min_size: Some((800, 500).to_size()), // min size allowed max_size: None, visible: true, resizable: true, diff --git a/src/networking/types/my_link_type.rs b/src/networking/types/my_link_type.rs index 674ec77e..68a77fbc 100644 --- a/src/networking/types/my_link_type.rs +++ b/src/networking/types/my_link_type.rs @@ -1,5 +1,5 @@ use iced::widget::Column; -use iced::{Font, Renderer}; +use iced::Font; use pcap::Linktype; use crate::gui::styles::text::TextType; diff --git a/src/notifications/types/sound.rs b/src/notifications/types/sound.rs index 5a60b6fe..4b0cb23a 100644 --- a/src/notifications/types/sound.rs +++ b/src/notifications/types/sound.rs @@ -3,7 +3,7 @@ use std::thread; use iced::alignment::{Horizontal, Vertical}; use iced::widget::Text; -use iced::{Font, Length, Renderer, Theme}; +use iced::{Font, Length}; use rodio::{Decoder, OutputStream, Sink}; use serde::{Deserialize, Serialize}; diff --git a/src/report/types/report_sort_type.rs b/src/report/types/report_sort_type.rs index d5a321aa..4de73273 100644 --- a/src/report/types/report_sort_type.rs +++ b/src/report/types/report_sort_type.rs @@ -1,7 +1,6 @@ use std::fmt::Debug; use iced::widget::Text; -use iced::{Renderer, Theme}; use crate::gui::styles::button::ButtonType; use crate::gui::styles::types::style_type::StyleType; diff --git a/src/report/types/sort_type.rs b/src/report/types/sort_type.rs index aefb0da7..bd47abdc 100644 --- a/src/report/types/sort_type.rs +++ b/src/report/types/sort_type.rs @@ -2,7 +2,6 @@ use crate::gui::styles::button::ButtonType; use crate::gui::styles::types::style_type::StyleType; use crate::utils::types::icon::Icon; use iced::widget::Text; -use iced::{Renderer, Theme}; #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Default)] pub enum SortType { diff --git a/src/translations/translations.rs b/src/translations/translations.rs index 6d0a64a9..63d1a997 100644 --- a/src/translations/translations.rs +++ b/src/translations/translations.rs @@ -1,7 +1,6 @@ // EXTRA NEEDED CHARACTERS: Б use iced::widget::Text; -use iced::{Renderer, Theme}; use crate::translations::types::language::Language; use crate::StyleType; diff --git a/src/translations/translations_3.rs b/src/translations/translations_3.rs index 5fdb1840..2e84a6db 100644 --- a/src/translations/translations_3.rs +++ b/src/translations/translations_3.rs @@ -1,7 +1,6 @@ #![allow(clippy::match_same_arms)] use iced::widget::Text; -use iced::{Renderer, Theme}; use crate::translations::translations::network_adapter_translation; use crate::{Language, StyleType}; diff --git a/src/translations/types/language.rs b/src/translations/types/language.rs index 87ee8dfe..3ffe165f 100644 --- a/src/translations/types/language.rs +++ b/src/translations/types/language.rs @@ -2,7 +2,7 @@ use std::fmt; use iced::widget::svg::Handle; use iced::widget::Svg; -use iced::{Length, Renderer, Theme}; +use iced::Length; use serde::{Deserialize, Serialize}; use crate::countries::flags_pictures::{ diff --git a/src/utils/types/icon.rs b/src/utils/types/icon.rs index 302d53e9..c8afdec4 100644 --- a/src/utils/types/icon.rs +++ b/src/utils/types/icon.rs @@ -1,5 +1,4 @@ use iced::widget::Text; -use iced::{Renderer, Theme}; use crate::gui::styles::style_constants::ICONS; use crate::StyleType; From 3f6cb21cda245acfddb7f1788101acd0088f85e3 Mon Sep 17 00:00:00 2001 From: Giuliano Bellini s294739 Date: Fri, 8 Mar 2024 22:29:36 +0100 Subject: [PATCH 09/12] improve tooltips of buttons linking to a web page --- resources/fonts/subset/icons.ttf | Bin 14724 -> 14972 bytes src/gui/components/button.rs | 13 ++++++++++-- src/gui/components/footer.rs | 27 ++++++++++++++++++------- src/gui/pages/settings_general_page.rs | 8 +++++--- src/utils/types/icon.rs | 2 ++ 5 files changed, 38 insertions(+), 12 deletions(-) diff --git a/resources/fonts/subset/icons.ttf b/resources/fonts/subset/icons.ttf index 3e65c1e111d5ad123779a7a27978681fa49d9f63..b06c382dc467476f30c3aea0a7916735ec7f1b64 100644 GIT binary patch delta 649 zcmW+zO=uHQ5T4nrNp`opYm&_-DQ#`)np8|{leD`@wY3M0h2meWrT$^o7!zt^1C3C{ zQb8#N5yY)UdhsH~B8XToRs;_od#wi%l!BLvUTX288z-H|@c8DN`QFUDdlP>v(|`aV z!X0qH$xLSG*wY_l#{s&t6m2+q_(%q(V1aOqaN@-2{fXhl+-(3HAv~NbndOytg`WTn z@i{NeV--n3%On_=BG{fUY4a|g#uc! zRGE}FaFg&W!nel8bLNydvlGDahH#~1PL^?!O%YEH&DYIRzTxs*9cisn6Ccat6BVbt z;}<~sA@OtD!_k2EKM&}a-T1Ey-j27uMd z7&vZanI54Nx+q%*15(y==0;tzRt%k8pc^SG?wGau9B%8aBP+ZN{0@!;7ec|%;IhV! zw%68+EFFlzDeAgqA4=%*H{k(nLKixfU8p7u)YX7rQ3J_dG(3@L2RdbRHd5y9a7(1i z)2SQDgnkJ1NHi>=-=nC>a6&gc?da-oe6N4KDk_LRX-VdJ`!UD0@gW{Zg#ap2@3iPe zrr!R;Hfuigigusm^-5b}fa~Wt**>Sm;~H~Diz5>hSVT$elT-`{_B=_naU5QwtR+!J zR7IR`M4M;Bdz8>-O$0xXG{^S~K?dX6zZW$rT$DME{-L(T?V)|kPZD7#ZFePA5C&lc X&cb=P02i%TI*KW4C>>+hJ+Za_hC_?! delta 389 zcmW+xJ4k|I6g~eVk?b`DIyg8;8A;*$QAR`AP*GrrQBi-se!>@NWMSA4PPzCs)KW_{ zIY>eT($?P6&>*El1WheYMRx7L<#Nv9KF&|(B%KEbpclswu z){7%t5GM`hCEvK&e-q3BT!6Sg7?)D_g~$iM8%QferF5#@rcH1e$yY{W2a)%pZU_+d zfT<#frI6m&@{(7lvdeNfFDXYvk%k9J(97{mw(py75U&u=#*#rPC&kKu(BZprDVyT< zMJM@G&?TgJSi61J1K6JFiN{njol&T}7~ni7zw{rD0zOR)d~NnmwxFU@gty{+q0^gn zK2$4l9?r?8xJGxI0KWZ;PiEvDT!MvokII5hb{p()urj|#w>q#`VY54!NjPQGg2*0( xE!Cm=Rio2fYF>b Row<'static, Message, StyleType> { + Row::new() + .align_items(Alignment::Center) + .spacing(10) + .push(Text::new(text).font(font)) + .push(Icon::OpenLink.to_text().size(16).style(TextType::Title)) +} diff --git a/src/gui/components/footer.rs b/src/gui/components/footer.rs index 1a7d8484..be654e00 100644 --- a/src/gui/components/footer.rs +++ b/src/gui/components/footer.rs @@ -9,6 +9,7 @@ use iced::widget::Space; use iced::widget::{button, Container, Row, Text, Tooltip}; use iced::{Alignment, Font, Length}; +use crate::gui::components::button::row_open_link_tooltip; use crate::gui::styles::button::ButtonType; use crate::gui::styles::container::ContainerType; use crate::gui::styles::style_constants::{FONT_SIZE_FOOTER, FONT_SIZE_SUBTITLE}; @@ -67,8 +68,12 @@ fn get_button_website(font: Font) -> Tooltip<'static, Message, StyleType> { .width(Length::Fixed(30.0)) .on_press(Message::OpenWebPage(WebPage::Website)); - Tooltip::new(content, Text::new("Website").font(font), Position::Top) - .style(ContainerType::Tooltip) + Tooltip::new( + content, + row_open_link_tooltip("Website", font), + Position::Top, + ) + .style(ContainerType::Tooltip) } fn get_button_github(font: Font) -> Tooltip<'static, Message, StyleType> { @@ -84,8 +89,12 @@ fn get_button_github(font: Font) -> Tooltip<'static, Message, StyleType> { .width(Length::Fixed(40.0)) .on_press(Message::OpenWebPage(WebPage::Repo)); - Tooltip::new(content, Text::new("GitHub").font(font), Position::Top) - .style(ContainerType::Tooltip) + Tooltip::new( + content, + row_open_link_tooltip("GitHub", font), + Position::Top, + ) + .style(ContainerType::Tooltip) } fn get_button_sponsor(font: Font) -> Tooltip<'static, Message, StyleType> { @@ -103,8 +112,12 @@ fn get_button_sponsor(font: Font) -> Tooltip<'static, Message, StyleType> { .width(Length::Fixed(30.0)) .on_press(Message::OpenWebPage(WebPage::Sponsor)); - Tooltip::new(content, Text::new("Sponsor").font(font), Position::Top) - .style(ContainerType::Tooltip) + Tooltip::new( + content, + row_open_link_tooltip("Sponsor", font), + Position::Top, + ) + .style(ContainerType::Tooltip) } fn get_release_details( @@ -140,7 +153,7 @@ fn get_release_details( .on_press(Message::OpenWebPage(WebPage::WebsiteDownload)); let tooltip = Tooltip::new( button, - Text::new(new_version_available_translation(language)).font(font), + row_open_link_tooltip(new_version_available_translation(language), font), Position::Top, ) .style(ContainerType::Tooltip); diff --git a/src/gui/pages/settings_general_page.rs b/src/gui/pages/settings_general_page.rs index 9a380936..cca048da 100644 --- a/src/gui/pages/settings_general_page.rs +++ b/src/gui/pages/settings_general_page.rs @@ -7,7 +7,7 @@ use iced::widget::{button, Column, Container, PickList, Row, Rule, Slider, Space use iced::Length::Fixed; use iced::{Alignment, Font, Length}; -use crate::gui::components::button::button_open_file; +use crate::gui::components::button::{button_open_file, row_open_link_tooltip}; use crate::gui::components::tab::get_settings_tabs; use crate::gui::pages::settings_notifications_page::settings_header; use crate::gui::pages::types::settings_page::SettingsPage; @@ -133,8 +133,10 @@ fn language_picklist(language: Language, font: Font) -> Container<'static, Messa .padding(2) .height(Fixed(20.0)) .width(Fixed(20.0)), - Text::new("The selected language is not\nfully updated to version 1.3 ↗") - .font(font), + row_open_link_tooltip( + "The selected language is not\nfully updated to version 1.3", + font, + ), Position::FollowCursor, ) .style(ContainerType::Tooltip), diff --git a/src/utils/types/icon.rs b/src/utils/types/icon.rs index c8afdec4..62606a1d 100644 --- a/src/utils/types/icon.rs +++ b/src/utils/types/icon.rs @@ -28,6 +28,7 @@ pub enum Icon { Inspect, Lightning, Notification, + OpenLink, Overview, PacketsThreshold, // Restore, @@ -81,6 +82,7 @@ impl Icon { Icon::SortAscending => 'm', Icon::SortDescending => 'l', Icon::SortNeutral => 'n', + Icon::OpenLink => 'o', } } From 0e7cc2140512fe4f0221465ccacf621fddfac9d0 Mon Sep 17 00:00:00 2001 From: Giuliano Bellini s294739 Date: Sat, 9 Mar 2024 15:54:08 +0100 Subject: [PATCH 10/12] simplified iced lengths uses --- src/cli/mod.rs | 4 +- src/countries/country_utils.rs | 10 +-- src/gui/components/button.rs | 10 +-- src/gui/components/footer.rs | 26 +++---- src/gui/components/header.rs | 10 +-- src/gui/components/modal.rs | 24 +++--- src/gui/components/tab.rs | 14 ++-- src/gui/pages/connection_details_page.rs | 25 +++--- src/gui/pages/initial_page.rs | 30 ++++---- src/gui/pages/inspect_page.rs | 36 ++++----- src/gui/pages/notifications_page.rs | 38 +++++----- src/gui/pages/overview_page.rs | 80 +++++++++----------- src/gui/pages/settings_general_page.rs | 31 ++++---- src/gui/pages/settings_notifications_page.rs | 53 +++++++------ src/gui/pages/settings_style_page.rs | 79 +++++++++---------- src/gui/types/sniffer.rs | 12 +-- src/translations/types/language.rs | 3 +- 17 files changed, 230 insertions(+), 255 deletions(-) diff --git a/src/cli/mod.rs b/src/cli/mod.rs index ec041c67..34f587f6 100644 --- a/src/cli/mod.rs +++ b/src/cli/mod.rs @@ -88,8 +88,8 @@ mod tests { device_name: "hey-hey".to_string(), }, window: ConfigWindow { - position: (440.0, 99.0), - size: (452.0, 870.0), + position: (440, 99), + size: (452, 870), }, }; // we want to be sure that modified config is different from defaults diff --git a/src/countries/country_utils.rs b/src/countries/country_utils.rs index 80d2900c..cb1ac2da 100644 --- a/src/countries/country_utils.rs +++ b/src/countries/country_utils.rs @@ -2,7 +2,7 @@ use iced::widget::svg::Handle; use iced::widget::tooltip::Position; use iced::widget::Tooltip; use iced::widget::{Svg, Text}; -use iced::{Font, Length}; +use iced::Font; use crate::countries::flags_pictures::{ AD, AE, AF, AG, AI, AL, AM, AO, AQ, AR, AS, AT, AU, AW, AX, AZ, BA, BB, BD, BE, BF, BG, BH, BI, @@ -310,8 +310,8 @@ fn get_flag_from_country( } }))) .style(svg_style) - .width(Length::Fixed(width)) - .height(Length::Fixed(width * 0.75)); + .width(width) + .height(width * 0.75); (svg, tooltip) } @@ -367,8 +367,8 @@ pub fn get_computer_tooltip( }, ))) .style(SvgType::AdaptColor) - .width(Length::Fixed(FLAGS_WIDTH_BIG)) - .height(Length::Fixed(FLAGS_WIDTH_BIG * 0.75)); + .width(FLAGS_WIDTH_BIG) + .height(FLAGS_WIDTH_BIG * 0.75); let tooltip = match (is_my_address, is_local, traffic_type) { (true, _, _) => your_network_adapter_translation(language), diff --git a/src/gui/components/button.rs b/src/gui/components/button.rs index 8349feab..6179b35f 100644 --- a/src/gui/components/button.rs +++ b/src/gui/components/button.rs @@ -4,7 +4,7 @@ use iced::alignment::{Horizontal, Vertical}; use iced::widget::text::LineHeight; use iced::widget::tooltip::Position; use iced::widget::{button, Row, Text, Tooltip}; -use iced::{Alignment, Font, Length}; +use iced::{Alignment, Font}; use crate::gui::styles::container::ContainerType; use crate::gui::styles::text::TextType; @@ -29,8 +29,8 @@ pub fn button_hide( .line_height(LineHeight::Relative(1.0)), ) .padding(2) - .height(Length::Fixed(20.0)) - .width(Length::Fixed(20.0)) + .height(20) + .width(20) .on_press(message), Text::new(hide_translation(language)).font(font), Position::Right, @@ -58,8 +58,8 @@ pub fn button_open_file( .size(16.0), ) .padding(0) - .height(Length::Fixed(25.0)) - .width(Length::Fixed(40.0)); + .height(25) + .width(40); if is_editable { tooltip_str = file_info.action_info(language); diff --git a/src/gui/components/footer.rs b/src/gui/components/footer.rs index be654e00..1c4a7953 100644 --- a/src/gui/components/footer.rs +++ b/src/gui/components/footer.rs @@ -43,14 +43,14 @@ pub fn footer( .push(get_button_sponsor(font)) .push( Text::new("Made with ❤ by Giuliano Bellini") - .width(Length::FillPortion(1)) + .width(Length::Fill) .horizontal_alignment(Horizontal::Right) .size(FONT_SIZE_FOOTER) .font(font_footer), ); Container::new(footer_row) - .height(Length::Fixed(45.0)) + .height(45) .align_y(Vertical::Center) .style(ContainerType::Gradient(color_gradient)) } @@ -64,8 +64,8 @@ fn get_button_website(font: Font) -> Tooltip<'static, Message, StyleType> { .vertical_alignment(Vertical::Center) .line_height(LineHeight::Relative(1.0)), ) - .height(Length::Fixed(30.0)) - .width(Length::Fixed(30.0)) + .height(30) + .width(30) .on_press(Message::OpenWebPage(WebPage::Website)); Tooltip::new( @@ -85,8 +85,8 @@ fn get_button_github(font: Font) -> Tooltip<'static, Message, StyleType> { .vertical_alignment(Vertical::Center) .line_height(LineHeight::Relative(1.0)), ) - .height(Length::Fixed(40.0)) - .width(Length::Fixed(40.0)) + .height(40) + .width(40) .on_press(Message::OpenWebPage(WebPage::Repo)); Tooltip::new( @@ -108,8 +108,8 @@ fn get_button_sponsor(font: Font) -> Tooltip<'static, Message, StyleType> { .line_height(LineHeight::Relative(1.0)), ) .padding([2, 0, 0, 0]) - .height(Length::Fixed(30.0)) - .width(Length::Fixed(30.0)) + .height(30) + .width(30) .on_press(Message::OpenWebPage(WebPage::Sponsor)); Tooltip::new( @@ -129,7 +129,7 @@ fn get_release_details( let mut ret_val = Row::new() .align_items(Alignment::Center) .height(Length::Fill) - .width(Length::FillPortion(1)) + .width(Length::Fill) .push( Text::new(format!("{SNIFFNET_TITLECASE} {APP_VERSION}")) .size(FONT_SIZE_FOOTER) @@ -147,8 +147,8 @@ fn get_release_details( .line_height(LineHeight::Relative(0.8)), ) .padding(0) - .height(Length::Fixed(35.0)) - .width(Length::Fixed(35.0)) + .height(35) + .width(35) .style(ButtonType::Alert) .on_press(Message::OpenWebPage(WebPage::WebsiteDownload)); let tooltip = Tooltip::new( @@ -157,9 +157,7 @@ fn get_release_details( Position::Top, ) .style(ContainerType::Tooltip); - ret_val = ret_val - .push(Space::with_width(Length::Fixed(10.0))) - .push(tooltip); + ret_val = ret_val.push(Space::with_width(10)).push(tooltip); } else { // this is the latest release ret_val = ret_val.push(Text::new(" ✔").size(FONT_SIZE_SUBTITLE).font(font_footer)); diff --git a/src/gui/components/header.rs b/src/gui/components/header.rs index 3db8774d..05d29ea8 100644 --- a/src/gui/components/header.rs +++ b/src/gui/components/header.rs @@ -46,7 +46,7 @@ pub fn header( last_opened_setting, ))), ) - .height(Length::Fixed(90.0)) + .height(90) .align_y(Vertical::Center) .style(ContainerType::Gradient(color_gradient)) } @@ -61,8 +61,8 @@ fn get_button_reset(font: Font, language: Language) -> Tooltip<'static, Message, .line_height(LineHeight::Relative(1.0)), ) .padding(10) - .height(Length::Fixed(40.0)) - .width(Length::Fixed(60.0)) + .height(40) + .width(60) .on_press(Message::ResetButtonPressed); Tooltip::new( @@ -87,8 +87,8 @@ pub fn get_button_settings( .vertical_alignment(Vertical::Center), ) .padding(0) - .height(Length::Fixed(40.0)) - .width(Length::Fixed(60.0)) + .height(40) + .width(60) .on_press(Message::OpenSettings(open_overlay)); Tooltip::new( diff --git a/src/gui/components/modal.rs b/src/gui/components/modal.rs index 4454ca3f..729a7cc6 100644 --- a/src/gui/components/modal.rs +++ b/src/gui/components/modal.rs @@ -4,7 +4,7 @@ use iced::advanced::renderer; use iced::advanced::widget::{self, Widget}; use iced::advanced::{self, Clipboard, Shell}; use iced::alignment::{Alignment, Horizontal, Vertical}; -use iced::widget::{button, Column, Container, Row, Space, Text}; +use iced::widget::{button, horizontal_space, Column, Container, Row, Space, Text}; use iced::{event, mouse, Color, Element, Event, Font, Length, Point, Rectangle, Size, Vector}; use crate::gui::components::button::button_hide; @@ -37,7 +37,7 @@ pub fn get_exit_overlay( language, quit_analysis_translation(language), )) - .push(Space::with_height(Length::Fixed(20.0))) + .push(Space::with_height(20)) .push( ask_quit_translation(language) .horizontal_alignment(Horizontal::Center) @@ -46,8 +46,8 @@ pub fn get_exit_overlay( .push(row_buttons); Container::new(content) - .height(Length::Fixed(160.0)) - .width(Length::Fixed(450.0)) + .height(160) + .width(450) .style(ContainerType::Modal) } @@ -69,7 +69,7 @@ pub fn get_clear_all_overlay( language, clear_all_translation(language), )) - .push(Space::with_height(Length::Fixed(20.0))) + .push(Space::with_height(20)) .push( ask_clear_all_translation(language) .horizontal_alignment(Horizontal::Center) @@ -78,8 +78,8 @@ pub fn get_clear_all_overlay( .push(row_buttons); Container::new(content) - .height(Length::Fixed(160.0)) - .width(Length::Fixed(450.0)) + .height(160) + .width(450) .style(ContainerType::Modal) } @@ -92,7 +92,7 @@ fn get_modal_header( ) -> Container<'static, Message, StyleType> { Container::new( Row::new() - .push(Space::with_width(Length::FillPortion(1))) + .push(horizontal_space()) .push( Text::new(title) .font(font_headers) @@ -102,13 +102,13 @@ fn get_modal_header( ) .push( Container::new(button_hide(Message::HideModal, language, font)) - .width(Length::FillPortion(1)) + .width(Length::Fill) .align_x(Horizontal::Center), ), ) .align_x(Horizontal::Center) .align_y(Vertical::Center) - .height(Length::Fixed(40.0)) + .height(40) .width(Length::Fill) .style(ContainerType::Gradient(color_gradient)) } @@ -129,8 +129,8 @@ fn confirm_button_row( .horizontal_alignment(Horizontal::Center), ) .padding(5) - .height(Length::Fixed(40.0)) - .width(Length::Fixed(80.0)) + .height(40) + .width(80) .style(ButtonType::Alert) .on_press(message), ) diff --git a/src/gui/components/tab.rs b/src/gui/components/tab.rs index 62a85695..f3509563 100644 --- a/src/gui/components/tab.rs +++ b/src/gui/components/tab.rs @@ -110,20 +110,18 @@ fn new_page_tab( ) .align_y(Vertical::Center) .padding([2, 4]) - .height(Length::Fixed(20.0)) + .height(20) .style(ContainerType::Highlighted); - content = content - .push(Space::with_width(Length::Fixed(7.0))) - .push(notifications_badge); + content = content.push(Space::with_width(7)).push(notifications_badge); } } content = content.push(horizontal_space()); button(content) - .height(Length::Fixed(if active { 35.0 } else { 30.0 })) + .height(if active { 35 } else { 30 }) .padding(0) - .width(Length::FillPortion(1)) + .width(Length::Fill) .style(if active { ButtonType::TabActive } else { @@ -169,9 +167,9 @@ fn new_settings_tab( .push(horizontal_space()); button(content) - .height(Length::Fixed(if active { 35.0 } else { 30.0 })) + .height(if active { 35 } else { 30 }) .padding(0) - .width(Length::FillPortion(1)) + .width(Length::Fill) .style(if active { ButtonType::TabActive } else { diff --git a/src/gui/pages/connection_details_page.rs b/src/gui/pages/connection_details_page.rs index a1d006e7..97011151 100644 --- a/src/gui/pages/connection_details_page.rs +++ b/src/gui/pages/connection_details_page.rs @@ -3,9 +3,8 @@ use std::net::IpAddr; use iced::alignment::{Horizontal, Vertical}; use iced::widget::scrollable::Direction; use iced::widget::tooltip::Position; -use iced::widget::{button, lazy, Rule, Scrollable, Space}; +use iced::widget::{button, horizontal_space, lazy, vertical_space, Rule, Scrollable}; use iced::widget::{Column, Container, Row, Text, Tooltip}; -use iced::Length::Fixed; use iced::{Alignment, Font, Length}; use crate::countries::country_utils::{get_computer_tooltip, get_flag_tooltip}; @@ -149,8 +148,8 @@ fn page_content( let content = assemble_widgets(col_info, source_col, dest_col); Container::new(header_and_content.push(content)) - .width(Length::Fixed(1000.0)) - .height(Length::Fixed(500.0)) + .width(1000) + .height(500) .style(ContainerType::Modal) } @@ -162,7 +161,7 @@ fn page_header( ) -> Container<'static, Message, StyleType> { Container::new( Row::new() - .push(Space::with_width(Length::FillPortion(1))) + .push(horizontal_space()) .push( Text::new(connection_details_translation(language)) .font(font_headers) @@ -172,13 +171,13 @@ fn page_header( ) .push( Container::new(button_hide(Message::HideModal, language, font)) - .width(Length::FillPortion(1)) + .width(Length::Fill) .align_x(Horizontal::Center), ), ) .align_x(Horizontal::Center) .align_y(Vertical::Center) - .height(Fixed(40.0)) + .height(40.0) .width(Length::Fill) .style(ContainerType::Gradient(color_gradient)) } @@ -195,7 +194,7 @@ fn col_info( .spacing(10) .padding([20, 10, 20, 40]) .width(Length::FillPortion(2)) - .push(Space::with_height(Length::FillPortion(1))) + .push(vertical_space()) .push( Row::new().spacing(5).push(Icon::Clock.to_text()).push( Text::new(format!( @@ -260,7 +259,7 @@ fn col_info( ); } - ret_val = ret_val.push(Space::with_height(Length::FillPortion(1))); + ret_val = ret_val.push(vertical_space()); ret_val } @@ -390,11 +389,11 @@ fn assemble_widgets( .width(Length::FillPortion(3)) .align_items(Alignment::Center) .spacing(5) - .push(Space::with_height(Length::FillPortion(1))) + .push(vertical_space()) .push(source_container) .push(Icon::ArrowsDown.to_text()) .push(dest_container) - .push(Space::with_height(Length::FillPortion(1))), + .push(vertical_space()), ) } @@ -415,8 +414,8 @@ fn get_button_copy( .vertical_alignment(Vertical::Center), ) .padding(0) - .height(Length::Fixed(25.0)) - .width(Length::Fixed(25.0)) + .height(25.0) + .width(25) .on_press(Message::CopyIp(string.clone())); Tooltip::new( diff --git a/src/gui/pages/initial_page.rs b/src/gui/pages/initial_page.rs index 0df0730f..c100a927 100644 --- a/src/gui/pages/initial_page.rs +++ b/src/gui/pages/initial_page.rs @@ -95,14 +95,12 @@ pub fn initial_page(sniffer: &Sniffer) -> Container { .align_x(Horizontal::Center), ); - let body = Column::new() - .push(Space::with_height(Length::Fixed(5.0))) - .push( - Row::new() - .push(col_adapter) - .push(Space::with_width(Length::Fixed(30.0))) - .push(filters_pane), - ); + let body = Column::new().push(Space::with_height(5)).push( + Row::new() + .push(col_adapter) + .push(Space::with_width(30)) + .push(filters_pane), + ); Container::new(body).height(Length::Fill) } @@ -123,8 +121,8 @@ fn col_ip_buttons( .vertical_alignment(Vertical::Center) .font(font), ) - .width(Length::Fixed(90.0)) - .height(Length::Fixed(35.0)) + .width(90) + .height(35) .style(if is_active { ButtonType::BorderedRoundSelected } else { @@ -162,8 +160,8 @@ fn col_protocol_buttons( .vertical_alignment(Vertical::Center) .font(font), ) - .width(Length::Fixed(90.0)) - .height(Length::Fixed(35.0)) + .width(90) + .height(35) .style(if is_active { ButtonType::BorderedRoundSelected } else { @@ -200,7 +198,7 @@ fn col_address_input( .padding([3, 5]) .on_input(Message::AddressFilter) .font(font) - .width(Length::Fixed(310.0)) + .width(310) .style(if is_error { TextInputType::Error } else { @@ -235,7 +233,7 @@ fn col_port_input( .padding([3, 5]) .on_input(Message::PortFilter) .font(font) - .width(Length::Fixed(180.0)) + .width(180) .style(if is_error { TextInputType::Error } else { @@ -269,8 +267,8 @@ fn button_start( .vertical_alignment(alignment::Vertical::Center), ) .padding(10) - .height(Length::Fixed(80.0)) - .width(Length::Fixed(160.0)) + .height(80) + .width(160) .style(ButtonType::Gradient(color_gradient)); let mut tooltip = start_translation(language).to_string(); diff --git a/src/gui/pages/inspect_page.rs b/src/gui/pages/inspect_page.rs index 50cab4c5..25f6b094 100644 --- a/src/gui/pages/inspect_page.rs +++ b/src/gui/pages/inspect_page.rs @@ -5,7 +5,7 @@ use iced::widget::scrollable::Direction; use iced::widget::text::LineHeight; use iced::widget::text_input::Side; use iced::widget::tooltip::Position; -use iced::widget::{button, text_input, Rule, Space, Toggler, Tooltip}; +use iced::widget::{button, text_input, vertical_space, Rule, Space, Toggler, Tooltip}; use iced::widget::{lazy, Button, Column, Container, Row, Scrollable, Text, TextInput}; use iced::{alignment, Alignment, Font, Length, Pixels}; @@ -95,7 +95,7 @@ pub fn inspect_page(sniffer: &Sniffer) -> Container { .align_y(Vertical::Center) .align_x(Horizontal::Center) .padding([10, 7, 3, 7]) - .width(Length::Fixed(1042.0)) + .width(1042) .style(ContainerType::BorderedRound), ); @@ -152,9 +152,9 @@ fn lazy_report(sniffer: &Sniffer) -> Column<'static, Message, StyleType> { .height(Length::Fill) .padding(20) .align_items(Alignment::Center) - .push(Space::with_height(Length::FillPortion(1))) + .push(vertical_space()) .push(Icon::Funnel.to_text().size(60)) - .push(Space::with_height(Length::Fixed(15.0))) + .push(Space::with_height(15)) .push(Text::new(no_search_results_translation(language)).font(font)) .push(Space::with_height(Length::FillPortion(2))), ); @@ -195,8 +195,8 @@ fn report_header_row( let mut col_header = Column::new() .align_items(Alignment::Center) - .width(Length::Fixed(report_col.get_width())) - .height(Length::Fixed(56.0)) + .width(report_col.get_width()) + .height(56) .push(title_tooltip); if report_col != ReportCol::Packets && report_col != ReportCol::Bytes { col_header = col_header.push( @@ -298,7 +298,7 @@ fn row_report_entry( .style(text_type), ) .align_x(Horizontal::Center) - .width(Length::Fixed(report_col.get_width())), + .width(report_col.get_width()), ); } ret_val @@ -324,12 +324,12 @@ fn host_filters_col( )); } - let input_country = filter_input(FilterInputType::Country, search_params.clone(), font) - .width(Length::Fixed(95.0)); - let input_domain = filter_input(FilterInputType::Domain, search_params.clone(), font) - .width(Length::Fixed(190.0)); - let input_as_name = filter_input(FilterInputType::AsName, search_params.clone(), font) - .width(Length::Fixed(190.0)); + let input_country = + filter_input(FilterInputType::Country, search_params.clone(), font).width(95); + let input_domain = + filter_input(FilterInputType::Domain, search_params.clone(), font).width(190); + let input_as_name = + filter_input(FilterInputType::AsName, search_params.clone(), font).width(190); let container_country = Row::new() .spacing(5) @@ -461,8 +461,8 @@ fn get_button_change_page(increment: bool) -> Button<'static, Message, StyleType .vertical_alignment(alignment::Vertical::Center), ) .padding(2) - .height(Length::Fixed(20.0)) - .width(Length::Fixed(25.0)) + .height(20) + .width(25) .on_press(Message::UpdatePageNumber(increment)) } @@ -475,7 +475,7 @@ fn get_change_page_row( results_number: usize, ) -> Row<'static, Message, StyleType> { Row::new() - .height(Length::Fixed(40.0)) + .height(40) .align_items(Alignment::Center) .spacing(10) .push(Space::with_width(Length::Fill)) @@ -514,8 +514,8 @@ fn button_clear_filter( .line_height(LineHeight::Relative(1.0)), ) .padding(2) - .height(Length::Fixed(20.0)) - .width(Length::Fixed(20.0)) + .height(20) + .width(20) .on_press(Message::Search(new_search_parameters)) } diff --git a/src/gui/pages/notifications_page.rs b/src/gui/pages/notifications_page.rs index d117b2e8..78f6bd92 100644 --- a/src/gui/pages/notifications_page.rs +++ b/src/gui/pages/notifications_page.rs @@ -2,7 +2,7 @@ use iced::alignment::{Horizontal, Vertical}; use iced::widget::scrollable::Direction; use iced::widget::text::LineHeight; use iced::widget::tooltip::Position; -use iced::widget::{button, Space}; +use iced::widget::{button, vertical_space, Space}; use iced::widget::{lazy, Column, Container, Row, Scrollable, Text, Tooltip}; use iced::Length::FillPortion; use iced::{Alignment, Font, Length}; @@ -54,9 +54,7 @@ pub fn notifications_page(sniffer: &Sniffer) -> Container { sniffer.unread_notifications, ); - tab_and_body = tab_and_body - .push(tabs) - .push(Space::with_height(Length::Fixed(15.0))); + tab_and_body = tab_and_body.push(tabs).push(Space::with_height(15)); if notifications.packets_notification.threshold.is_none() && notifications.bytes_notification.threshold.is_none() @@ -87,7 +85,7 @@ pub fn notifications_page(sniffer: &Sniffer) -> Container { Text::new(only_last_30_translation(language)).font(font) }) .padding(10) - .width(Length::FillPortion(1)) + .width(Length::Fill) .height(Length::Fill) .align_x(Horizontal::Center) .align_y(Vertical::Center), @@ -98,7 +96,7 @@ pub fn notifications_page(sniffer: &Sniffer) -> Container { ) .push( Container::new(get_button_clear_all(font, language)) - .width(Length::FillPortion(1)) + .width(Length::Fill) .height(Length::Fill) .align_x(Horizontal::Center) .align_y(Vertical::Center), @@ -118,7 +116,7 @@ fn body_no_notifications_set( .spacing(5) .align_items(Alignment::Center) .width(Length::Fill) - .push(Space::with_height(FillPortion(1))) + .push(vertical_space()) .push( no_notifications_set_translation(language) .horizontal_alignment(Horizontal::Center) @@ -142,7 +140,7 @@ fn body_no_notifications_received( .spacing(5) .align_items(Alignment::Center) .width(Length::Fill) - .push(Space::with_height(FillPortion(1))) + .push(vertical_space()) .push( no_notifications_received_translation(language) .horizontal_alignment(Horizontal::Center) @@ -189,7 +187,7 @@ fn packets_notification_log( .push( Column::new() .spacing(7) - .width(Length::Fixed(250.0)) + .width(250) .push( Row::new() .spacing(5) @@ -222,8 +220,8 @@ fn packets_notification_log( .push(Text::new(outgoing_str).font(font)), ); Container::new(content) - .height(Length::Fixed(120.0)) - .width(Length::Fixed(800.0)) + .height(120.0) + .width(800) .padding(10) .style(ContainerType::BorderedRound) } @@ -270,7 +268,7 @@ fn bytes_notification_log( .push( Column::new() .spacing(7) - .width(Length::Fixed(250.0)) + .width(250) .push( Row::new() .spacing(5) @@ -305,8 +303,8 @@ fn bytes_notification_log( .push(Text::new(outgoing_str).font(font)), ); Container::new(content) - .height(Length::Fixed(120.0)) - .width(Length::Fixed(800.0)) + .height(120) + .width(800) .padding(10) .style(ContainerType::BorderedRound) } @@ -354,7 +352,7 @@ fn favorite_notification_log( ) .push( Column::new() - .width(Length::Fixed(250.0)) + .width(250) .spacing(7) .push( Row::new() @@ -375,8 +373,8 @@ fn favorite_notification_log( .push(row_flag_details), ); Container::new(content) - .height(Length::Fixed(120.0)) - .width(Length::Fixed(800.0)) + .height(120) + .width(800) .padding(10) .style(ContainerType::BorderedRound) } @@ -390,8 +388,8 @@ fn get_button_clear_all(font: Font, language: Language) -> Tooltip<'static, Mess .vertical_alignment(Vertical::Center), ) .padding(10) - .height(Length::Fixed(50.0)) - .width(Length::Fixed(75.0)) + .height(50) + .width(75) .on_press(Message::ShowModal(MyModal::ClearAll)); Tooltip::new( @@ -409,7 +407,7 @@ fn lazy_logged_notifications(sniffer: &Sniffer) -> Column<'static, Message, Styl } = sniffer.configs.lock().unwrap().settings; let font = style.get_extension().font; let mut ret_val = Column::new() - .width(Length::Fixed(830.0)) + .width(830) .padding(5) .spacing(10) .align_items(Alignment::Center); diff --git a/src/gui/pages/overview_page.rs b/src/gui/pages/overview_page.rs index 9cd5cd7d..02597b38 100644 --- a/src/gui/pages/overview_page.rs +++ b/src/gui/pages/overview_page.rs @@ -8,10 +8,10 @@ use iced::widget::scrollable::Direction; use iced::widget::text::LineHeight; use iced::widget::tooltip::Position; use iced::widget::{ - button, horizontal_space, lazy, Button, Column, Container, Row, Rule, Scrollable, Space, Text, - Tooltip, + button, horizontal_space, lazy, vertical_space, Button, Column, Container, Row, Rule, + Scrollable, Space, Text, Tooltip, }; -use iced::Length::{Fill, FillPortion, Fixed}; +use iced::Length::{Fill, FillPortion}; use iced::{Alignment, Font, Length}; use crate::countries::country_utils::get_flag_tooltip; @@ -179,9 +179,9 @@ fn body_no_packets( .padding(10) .spacing(10) .align_items(Alignment::Center) - .push(Space::with_height(FillPortion(1))) + .push(vertical_space()) .push(icon_text) - .push(Space::with_height(Length::Fixed(15.0))) + .push(Space::with_height(15)) .push(nothing_to_see_text) .push(Text::new(waiting.to_owned()).font(font).size(50)) .push(Space::with_height(FillPortion(2))) @@ -204,7 +204,7 @@ fn body_no_observed( .padding(10) .spacing(10) .align_items(Alignment::Center) - .push(Space::with_height(FillPortion(1))) + .push(vertical_space()) .push(Icon::Funnel.to_text().size(60)) .push(get_active_filters_col( filters, @@ -235,9 +235,9 @@ fn body_pcap_error( .padding(10) .spacing(10) .align_items(Alignment::Center) - .push(Space::with_height(FillPortion(1))) + .push(vertical_space()) .push(Icon::Error.to_text().size(60)) - .push(Space::with_height(Length::Fixed(15.0))) + .push(Space::with_height(15)) .push(error_text) .push(Text::new(waiting.to_owned()).font(font).size(50)) .push(Space::with_height(FillPortion(2))) @@ -265,9 +265,7 @@ fn col_host(width: f32, sniffer: &Sniffer) -> Column<'static, Message, StyleType let font = style.get_extension().font; let chart_type = sniffer.traffic_chart.chart_type; - let mut scroll_host = Column::new() - .width(Length::Fixed(width)) - .align_items(Alignment::Center); + let mut scroll_host = Column::new().width(width).align_items(Alignment::Center); let entries = get_host_entries(&sniffer.info_traffic, chart_type, sniffer.host_sort_type); let first_entry_data_info = entries .iter() @@ -286,7 +284,7 @@ fn col_host(width: f32, sniffer: &Sniffer) -> Column<'static, Message, StyleType let star_button = get_star_button(data_info_host.is_favorite, host.clone()); let host_bar = Column::new() - .width(Length::Fixed(width)) + .width(width) .spacing(1) .push( Row::new() @@ -333,20 +331,18 @@ fn col_host(width: f32, sniffer: &Sniffer) -> Column<'static, Message, StyleType } if entries.len() >= 30 { - scroll_host = scroll_host - .push(Space::with_height(Length::Fixed(25.0))) - .push( - Text::new(only_top_30_items_translation(language)) - .font(font) - .horizontal_alignment(Horizontal::Center), - ); + scroll_host = scroll_host.push(Space::with_height(25.0)).push( + Text::new(only_top_30_items_translation(language)) + .font(font) + .horizontal_alignment(Horizontal::Center), + ); } Column::new() - .width(Length::Fixed(width + 11.0)) + .width(width + 11.0) .push( Row::new() - .height(Length::Fixed(45.0)) + .height(45) .align_items(Alignment::Center) .push( Text::new(host_translation(language)) @@ -374,9 +370,7 @@ fn col_service(width: f32, sniffer: &Sniffer) -> Column<'static, Message, StyleT let font = style.get_extension().font; let chart_type = sniffer.traffic_chart.chart_type; - let mut scroll_service = Column::new() - .width(Length::Fixed(width)) - .align_items(Alignment::Center); + let mut scroll_service = Column::new().width(width).align_items(Alignment::Center); let entries = get_service_entries(&sniffer.info_traffic, chart_type, sniffer.service_sort_type); let first_entry_data_info = entries .iter() @@ -390,7 +384,7 @@ fn col_service(width: f32, sniffer: &Sniffer) -> Column<'static, Message, StyleT let content = Column::new() .spacing(1) - .width(Length::Fixed(width)) + .width(width) .push( Row::new() .push(Text::new(service.to_string()).font(font)) @@ -417,20 +411,18 @@ fn col_service(width: f32, sniffer: &Sniffer) -> Column<'static, Message, StyleT } if entries.len() >= 30 { - scroll_service = scroll_service - .push(Space::with_height(Length::Fixed(25.0))) - .push( - Text::new(only_top_30_items_translation(language)) - .font(font) - .horizontal_alignment(Horizontal::Center), - ); + scroll_service = scroll_service.push(Space::with_height(25)).push( + Text::new(only_top_30_items_translation(language)) + .font(font) + .horizontal_alignment(Horizontal::Center), + ); } Column::new() - .width(Length::Fixed(width + 11.0)) + .width(width + 11.0) .push( Row::new() - .height(Length::Fixed(45.0)) + .height(45) .align_items(Alignment::Center) .push( Text::new(service_translation(language)) @@ -484,14 +476,14 @@ fn lazy_col_info( .padding([5, 10]) .push( Row::new() - .height(Length::Fixed(120.0)) + .height(120) .push( Scrollable::new(col_device) .width(Length::Fill) .direction(Direction::Horizontal(ScrollbarType::properties())), ) .push(Container::new(Rule::vertical(25)).height(Length::Shrink)) - .push(col_data_representation.width(Length::FillPortion(1))), + .push(col_data_representation.width(Length::Fill)), ) .push(Rule::horizontal(15)) .push( @@ -502,7 +494,7 @@ fn lazy_col_info( ); Container::new(content) - .width(Length::Fixed(400.0)) + .width(400) .padding([10, 5, 5, 5]) .align_x(Horizontal::Center) .style(ContainerType::BorderedRound) @@ -592,7 +584,7 @@ fn col_data_representation( .font(font), ) .width(Length::Fill) - .height(Length::Fixed(33.0)) + .height(33) .style(if is_active { ButtonType::BorderedRoundSelected } else { @@ -741,14 +733,14 @@ fn get_bars(in_len: f32, out_len: f32) -> Row<'static, Message, StyleType> { Row::new() .push(if in_len > 0.0 { Row::new() - .width(Length::Fixed(in_len)) + .width(in_len) .push(Rule::horizontal(1).style(RuleType::Incoming)) } else { Row::new() }) .push(if out_len > 0.0 { Row::new() - .width(Length::Fixed(out_len)) + .width(out_len) .push(Rule::horizontal(1).style(RuleType::Outgoing)) } else { Row::new() @@ -764,8 +756,8 @@ fn get_star_button(is_favorite: bool, host: Host) -> Button<'static, Message, St .vertical_alignment(Vertical::Center), ) .padding(0) - .height(Length::Fixed(FLAGS_WIDTH_BIG * 0.75)) - .width(Length::Fixed(FLAGS_WIDTH_BIG)) + .height(FLAGS_WIDTH_BIG * 0.75) + .width(FLAGS_WIDTH_BIG) .style(if is_favorite { ButtonType::Starred } else { @@ -804,8 +796,8 @@ fn get_active_filters_col( ) .align_x(Horizontal::Center) .align_y(Vertical::Center) - .height(Fixed(20.0)) - .width(Fixed(20.0)) + .height(20) + .width(20) .style(ContainerType::Highlighted), Text::new(filters_string).font(font), Position::FollowCursor, diff --git a/src/gui/pages/settings_general_page.rs b/src/gui/pages/settings_general_page.rs index cca048da..8010d942 100644 --- a/src/gui/pages/settings_general_page.rs +++ b/src/gui/pages/settings_general_page.rs @@ -3,8 +3,9 @@ use std::sync::Arc; use iced::alignment::{Horizontal, Vertical}; use iced::widget::text::LineHeight; use iced::widget::tooltip::Position; -use iced::widget::{button, Column, Container, PickList, Row, Rule, Slider, Space, Text, Tooltip}; -use iced::Length::Fixed; +use iced::widget::{ + button, horizontal_space, Column, Container, PickList, Row, Rule, Slider, Space, Text, Tooltip, +}; use iced::{Alignment, Font, Length}; use crate::gui::components::button::{button_open_file, row_open_link_tooltip}; @@ -46,12 +47,12 @@ pub fn settings_general_page(sniffer: &Sniffer) -> Container language, )) .push(get_settings_tabs(SettingsPage::General, font, language)) - .push(Space::with_height(Fixed(10.0))) + .push(Space::with_height(10)) .push(column_all_general_setting(sniffer, font)); Container::new(content) - .height(Fixed(400.0)) - .width(Fixed(800.0)) + .height(400) + .width(800) .style(ContainerType::Modal) } @@ -82,7 +83,7 @@ fn column_all_general_setting( .padding(10.0) .style(ContainerType::Badge), ) - .push(Space::with_height(Fixed(10.0))); + .push(Space::with_height(10)); } column = column.push(mmdb_settings( @@ -105,12 +106,12 @@ fn row_language_scale_factor( ) -> Row<'static, Message, StyleType> { Row::new() .align_items(Alignment::Start) - .height(Length::Fixed(90.0)) + .height(90) .push(language_picklist(language, font)) .push(Rule::vertical(25)) .push(scale_factor_slider(language, font, scale_factor)) .push(Rule::vertical(25)) - .push(Space::with_width(Length::FillPortion(1))) + .push(horizontal_space()) } fn language_picklist(language: Language, font: Font) -> Container<'static, Message, StyleType> { @@ -131,8 +132,8 @@ fn language_picklist(language: Language, font: Font) -> Container<'static, Messa ) .on_press(Message::OpenWebPage(WebPage::IssueLanguages)) .padding(2) - .height(Fixed(20.0)) - .width(Fixed(20.0)), + .height(20) + .width(20), row_open_link_tooltip( "The selected language is not\nfully updated to version 1.3", font, @@ -164,7 +165,7 @@ fn language_picklist(language: Language, font: Font) -> Container<'static, Messa ); Container::new(content) - .width(Length::FillPortion(1)) + .width(Length::Fill) .align_x(Horizontal::Center) .align_y(Vertical::Center) } @@ -190,10 +191,10 @@ fn scale_factor_slider( .push( Slider::new(0.5..=1.5, scale_factor, Message::ChangeScaleFactor) .step(0.05) - .width(Fixed(slider_width)), + .width(slider_width), ), ) - .width(Length::FillPortion(1)) + .width(Length::Fill) .align_x(Horizontal::Center) .align_y(Vertical::Center) } @@ -293,8 +294,8 @@ fn button_clear_mmdb( .size(15), ) .padding(2) - .height(Fixed(20.0)) - .width(Fixed(20.0)); + .height(20.0) + .width(20.0); if is_editable { button = button.on_press(message(String::new())); diff --git a/src/gui/pages/settings_notifications_page.rs b/src/gui/pages/settings_notifications_page.rs index 92e98fe6..f629c146 100644 --- a/src/gui/pages/settings_notifications_page.rs +++ b/src/gui/pages/settings_notifications_page.rs @@ -1,8 +1,7 @@ use iced::alignment::{Horizontal, Vertical}; use iced::widget::scrollable::Direction; -use iced::widget::{Button, Slider}; +use iced::widget::{horizontal_space, Button, Slider}; use iced::widget::{Checkbox, Column, Container, Row, Scrollable, Space, Text, TextInput}; -use iced::Length::Fixed; use iced::{Alignment, Font, Length}; use crate::gui::components::button::button_hide; @@ -52,7 +51,7 @@ pub fn settings_notifications_page(sniffer: &Sniffer) -> Container Container Container Container Container<'static, Message, StyleType> { Container::new( Row::new() - .push(Space::with_width(Length::FillPortion(1))) + .push(horizontal_space()) .push( Text::new(settings_translation(language)) .font(font_headers) @@ -447,13 +446,13 @@ pub fn settings_header( ) .push( Container::new(button_hide(Message::CloseSettings, language, font)) - .width(Length::FillPortion(1)) + .width(Length::Fill) .align_x(Horizontal::Center), ), ) .align_x(Horizontal::Center) .align_y(Vertical::Center) - .height(Fixed(40.0)) + .height(40) .width(Length::Fill) .style(ContainerType::Gradient(color_gradient)) } diff --git a/src/gui/pages/settings_style_page.rs b/src/gui/pages/settings_style_page.rs index 76c5cbc5..11a33a34 100644 --- a/src/gui/pages/settings_style_page.rs +++ b/src/gui/pages/settings_style_page.rs @@ -2,7 +2,6 @@ use iced::alignment::{Horizontal, Vertical}; use iced::widget::scrollable::Direction; use iced::widget::{button, lazy, Rule, Space}; use iced::widget::{Button, Column, Container, Row, Scrollable, Text}; -use iced::Length::Fixed; use iced::{Alignment, Color, Element, Font, Length}; use crate::gui::components::button::button_open_file; @@ -53,16 +52,16 @@ pub fn settings_style_page(sniffer: &Sniffer) -> Container { language, )) .push(get_settings_tabs(SettingsPage::Appearance, font, language)) - .push(Space::with_height(Length::Fixed(15.0))) + .push(Space::with_height(15)) .push( appearance_title_translation(language) .style(TextType::Subtitle) .font(font) .size(FONT_SIZE_SUBTITLE), ) - .push(Space::with_height(Length::Fixed(15.0))) + .push(Space::with_height(15)) .push(gradients_row(font, color_gradient, language)) - .push(Space::with_height(Length::Fixed(15.0))); + .push(Space::with_height(15)); let mut styles_col = Column::new() .align_items(Alignment::Center) @@ -75,7 +74,7 @@ pub fn settings_style_page(sniffer: &Sniffer) -> Container { yeti_night_translation(language).to_string(), Night, )) - .push(Space::with_width(Length::Fixed(10.0))) + .push(Space::with_width(10)) .push(get_palette_container( style, "Yeti Day".to_string(), @@ -83,7 +82,7 @@ pub fn settings_style_page(sniffer: &Sniffer) -> Container { Day, )), ) - .push(Space::with_height(Length::Fixed(10.0))) + .push(Space::with_height(10)) .push( Row::new() .push(get_palette_container( @@ -92,7 +91,7 @@ pub fn settings_style_page(sniffer: &Sniffer) -> Container { deep_sea_translation(language).to_string(), DeepSea, )) - .push(Space::with_width(Length::Fixed(10.0))) + .push(Space::with_width(10)) .push(get_palette_container( style, "Mon Amour".to_string(), @@ -100,7 +99,7 @@ pub fn settings_style_page(sniffer: &Sniffer) -> Container { MonAmour, )), ) - .push(Space::with_height(Length::Fixed(10.0))); + .push(Space::with_height(10)); for children in get_extra_palettes(ExtraStyles::all_styles(), style) { styles_col = styles_col.push(children); } @@ -116,8 +115,8 @@ pub fn settings_style_page(sniffer: &Sniffer) -> Container { content = content.push(styles_scroll); Container::new(content) - .height(Length::Fixed(400.0)) - .width(Length::Fixed(800.0)) + .height(400) + .width(800) .style(ContainerType::Modal) } @@ -140,11 +139,11 @@ fn gradients_row( ) .padding(0) .height(20.0) - .width(Fixed(if color_gradient.eq(&GradientType::None) { - 60.0 + .width(if color_gradient.eq(&GradientType::None) { + 60 } else { - 20.0 - })) + 20 + }) .style(ButtonType::Gradient(GradientType::None)) .on_press(Message::GradientsSelection(GradientType::None)), ) @@ -158,11 +157,11 @@ fn gradients_row( ) .padding(0) .height(20.0) - .width(Fixed(if color_gradient.eq(&GradientType::Mild) { - 60.0 + .width(if color_gradient.eq(&GradientType::Mild) { + 60 } else { - 20.0 - })) + 20 + }) .on_press(Message::GradientsSelection(GradientType::Mild)) .style(ButtonType::Gradient(GradientType::Mild)), ) @@ -176,11 +175,11 @@ fn gradients_row( ) .padding(0) .height(20.0) - .width(Fixed(if color_gradient.eq(&GradientType::Wild) { - 60.0 + .width(if color_gradient.eq(&GradientType::Wild) { + 60 } else { - 20.0 - })) + 20 + }) .on_press(Message::GradientsSelection(GradientType::Wild)) .style(ButtonType::Gradient(GradientType::Wild)), ) @@ -212,8 +211,8 @@ fn get_palette_container( } Button::new(content) - .height(Length::Fixed(if is_custom { 75.0 } else { 110.0 })) - .width(Length::Fixed(380.0)) + .height(if is_custom { 75 } else { 110 }) + .width(380) .padding(5) .style(if on_press.eq(&style) { ButtonType::BorderedRoundSelected @@ -232,16 +231,16 @@ fn get_palette_rule( Container::new( Row::new() - .push(Row::new().width(Length::Fixed(120.0)).push( + .push(Row::new().width(120).push( Rule::horizontal(height).style(RuleType::PaletteColor(palette.primary, height)), )) - .push(Row::new().width(Length::Fixed(80.0)).push( + .push(Row::new().width(80).push( Rule::horizontal(height).style(RuleType::PaletteColor(palette.secondary, height)), )) - .push(Row::new().width(Length::Fixed(60.0)).push( + .push(Row::new().width(60).push( Rule::horizontal(height).style(RuleType::PaletteColor(palette.outgoing, height)), )) - .push(Row::new().width(Length::Fixed(40.0)).push( + .push(Row::new().width(40).push( Rule::horizontal(height).style(RuleType::PaletteColor(buttons_color, height)), )), ) @@ -277,19 +276,15 @@ fn get_extra_palettes( children.extend([ Row::new() .push(first) - .push(Space::with_width(Length::Fixed(10.0))) + .push(Space::with_width(10)) .push(second) .into(), - >>::into(Space::with_height( - Length::Fixed(10.0), - )), + >>::into(Space::with_height(10)), ]); } else { children.extend([ Row::new().push(first).into(), - >>::into(Space::with_height( - Length::Fixed(10.0), - )), + >>::into(Space::with_height(10)), ]); } } @@ -354,14 +349,12 @@ fn lazy_custom_style_input( } Button::new(content) - .height(Length::Fixed( - if custom_palette.is_ok() || is_custom_toml_style_set { - 110.0 - } else { - 75.0 - }, - )) - .width(Length::Fixed(380.0)) + .height(if custom_palette.is_ok() || is_custom_toml_style_set { + 110 + } else { + 75 + }) + .width(380) .padding([10, 0, 5, 0]) .style(if is_custom_toml_style_set { ButtonType::BorderedRoundSelected diff --git a/src/gui/types/sniffer.rs b/src/gui/types/sniffer.rs index 6db83a14..66db58f0 100644 --- a/src/gui/types/sniffer.rs +++ b/src/gui/types/sniffer.rs @@ -1668,14 +1668,14 @@ mod tests { assert_eq!( window_start, ConfigWindow { - position: (0.0, 0.0), - size: (1190.0, 670.0), + position: (0, 0), + size: (1190, 670), } ); // change window properties by sending messages - sniffer.update(Message::WindowMoved(-10.0, 555.0)); - sniffer.update(Message::WindowResized(1000.0, 999.0)); + sniffer.update(Message::WindowMoved(-10, 555)); + sniffer.update(Message::WindowResized(1000, 999)); // quit the app by sending a CloseRequested message sniffer.update(Message::CloseRequested); @@ -1692,8 +1692,8 @@ mod tests { assert_eq!( window_end, ConfigWindow { - position: (-10.0, 555.0), - size: (1000.0, 999.0), + position: (-10, 555), + size: (1000, 999), } ); } diff --git a/src/translations/types/language.rs b/src/translations/types/language.rs index 3ffe165f..cc0fab48 100644 --- a/src/translations/types/language.rs +++ b/src/translations/types/language.rs @@ -2,7 +2,6 @@ use std::fmt; use iced::widget::svg::Handle; use iced::widget::Svg; -use iced::Length; use serde::{Deserialize, Serialize}; use crate::countries::flags_pictures::{ @@ -103,7 +102,7 @@ impl Language { Language::JA => JP, Language::UZ => UZ, }))) - .width(Length::Fixed(FLAGS_WIDTH_BIG)) + .width(FLAGS_WIDTH_BIG) } } From aad0c761ca122a099257712940a783c345ec8028 Mon Sep 17 00:00:00 2001 From: Giuliano Bellini s294739 Date: Sat, 9 Mar 2024 16:05:30 +0100 Subject: [PATCH 11/12] fix PlatformSpecific import on Linux --- src/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index cdba4cda..58b3d056 100644 --- a/src/main.rs +++ b/src/main.rs @@ -7,7 +7,7 @@ use std::sync::{Arc, Mutex}; use std::{panic, process, thread}; #[cfg(target_os = "linux")] -use iced::window::PlatformSpecific; +use iced::window::settings::PlatformSpecific; use iced::{window, Application, Font, Pixels, Settings}; use chart::types::chart_type::ChartType; From 2978306ded715db1a6d17110b4cc214d6963ad5e Mon Sep 17 00:00:00 2001 From: Giuliano Bellini s294739 Date: Sat, 9 Mar 2024 22:14:08 +0100 Subject: [PATCH 12/12] minor fixes and updated CHANGELOG --- CHANGELOG.md | 1 + src/gui/pages/connection_details_page.rs | 2 +- src/gui/pages/inspect_page.rs | 16 +++++++++------- src/gui/pages/notifications_page.rs | 2 +- src/gui/pages/overview_page.rs | 4 ++-- src/gui/pages/settings_general_page.rs | 4 ++-- src/gui/styles/toggler.rs | 4 ++-- src/translations/translations.rs | 6 +++--- 8 files changed, 21 insertions(+), 18 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 97bec68f..9caf2240 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,6 +23,7 @@ All Sniffnet releases with the relative changes are documented in this file. - Settings "Language" tab has been removed. Language selection and other options are now included in a new settings tab "General" ([#365](https://github.com/GyulyVGC/sniffnet/pull/365)) - Updated Portuguese translation to v1.2 ([#398](https://github.com/GyulyVGC/sniffnet/pull/398)) - Cleaned code implementing the concept of first class theming ([#339](https://github.com/GyulyVGC/sniffnet/pull/339)) +- Migrate to Iced 0.12 ([#470](https://github.com/GyulyVGC/sniffnet/pull/470)) - Added documentation about Sniffnet installation on Nix and Tiny Core Linux (respectively [#394](https://github.com/GyulyVGC/sniffnet/pull/394) and [#341](https://github.com/GyulyVGC/sniffnet/pull/341)) - General aesthetic improvements - Fixed bug about not delivered favorite notifications in presence of old outgoing connections diff --git a/src/gui/pages/connection_details_page.rs b/src/gui/pages/connection_details_page.rs index 97011151..470e00ed 100644 --- a/src/gui/pages/connection_details_page.rs +++ b/src/gui/pages/connection_details_page.rs @@ -414,7 +414,7 @@ fn get_button_copy( .vertical_alignment(Vertical::Center), ) .padding(0) - .height(25.0) + .height(25) .width(25) .on_press(Message::CopyIp(string.clone())); diff --git a/src/gui/pages/inspect_page.rs b/src/gui/pages/inspect_page.rs index 25f6b094..c8cfb98e 100644 --- a/src/gui/pages/inspect_page.rs +++ b/src/gui/pages/inspect_page.rs @@ -5,7 +5,9 @@ use iced::widget::scrollable::Direction; use iced::widget::text::LineHeight; use iced::widget::text_input::Side; use iced::widget::tooltip::Position; -use iced::widget::{button, text_input, vertical_space, Rule, Space, Toggler, Tooltip}; +use iced::widget::{ + button, horizontal_space, text_input, vertical_space, Rule, Space, Toggler, Tooltip, +}; use iced::widget::{lazy, Button, Column, Container, Row, Scrollable, Text, TextInput}; use iced::{alignment, Alignment, Font, Length, Pixels}; @@ -478,11 +480,11 @@ fn get_change_page_row( .height(40) .align_items(Alignment::Center) .spacing(10) - .push(Space::with_width(Length::Fill)) + .push(horizontal_space()) .push(if page_number > 1 { - Container::new(get_button_change_page(false).width(25.0)) + Container::new(get_button_change_page(false).width(25)) } else { - Container::new(Space::with_width(25.0)) + Container::new(Space::with_width(25)) }) .push( Text::new(showing_results_translation( @@ -494,11 +496,11 @@ fn get_change_page_row( .font(font), ) .push(if page_number < (results_number + 20 - 1) / 20 { - Container::new(get_button_change_page(true).width(25.0)) + Container::new(get_button_change_page(true).width(25)) } else { - Container::new(Space::with_width(25.0)) + Container::new(Space::with_width(25)) }) - .push(Space::with_width(Length::Fill)) + .push(horizontal_space()) } fn button_clear_filter( diff --git a/src/gui/pages/notifications_page.rs b/src/gui/pages/notifications_page.rs index 78f6bd92..ac138ef2 100644 --- a/src/gui/pages/notifications_page.rs +++ b/src/gui/pages/notifications_page.rs @@ -220,7 +220,7 @@ fn packets_notification_log( .push(Text::new(outgoing_str).font(font)), ); Container::new(content) - .height(120.0) + .height(120) .width(800) .padding(10) .style(ContainerType::BorderedRound) diff --git a/src/gui/pages/overview_page.rs b/src/gui/pages/overview_page.rs index 02597b38..4575e94a 100644 --- a/src/gui/pages/overview_page.rs +++ b/src/gui/pages/overview_page.rs @@ -331,7 +331,7 @@ fn col_host(width: f32, sniffer: &Sniffer) -> Column<'static, Message, StyleType } if entries.len() >= 30 { - scroll_host = scroll_host.push(Space::with_height(25.0)).push( + scroll_host = scroll_host.push(Space::with_height(25)).push( Text::new(only_top_30_items_translation(language)) .font(font) .horizontal_alignment(Horizontal::Center), @@ -430,7 +430,7 @@ fn col_service(width: f32, sniffer: &Sniffer) -> Column<'static, Message, StyleT .style(TextType::Title) .size(FONT_SIZE_TITLE), ) - .push(Space::with_width(Length::Fill)) + .push(horizontal_space()) .push(sort_arrows( sniffer.service_sort_type, Message::ServiceSortSelection, diff --git a/src/gui/pages/settings_general_page.rs b/src/gui/pages/settings_general_page.rs index 8010d942..b1350296 100644 --- a/src/gui/pages/settings_general_page.rs +++ b/src/gui/pages/settings_general_page.rs @@ -294,8 +294,8 @@ fn button_clear_mmdb( .size(15), ) .padding(2) - .height(20.0) - .width(20.0); + .height(20) + .width(20); if is_editable { button = button.on_press(message(String::new())); diff --git a/src/gui/styles/toggler.rs b/src/gui/styles/toggler.rs index f588c7e0..74c16a55 100644 --- a/src/gui/styles/toggler.rs +++ b/src/gui/styles/toggler.rs @@ -37,7 +37,7 @@ impl iced::widget::toggler::StyleSheet for StyleType { foreground_border_color: if is_active { colors.secondary } else { - ext.buttons_color + Color::TRANSPARENT }, } } @@ -62,7 +62,7 @@ impl iced::widget::toggler::StyleSheet for StyleType { foreground_border_color: if is_active { colors.secondary } else { - ext.buttons_color + Color::TRANSPARENT }, } } diff --git a/src/translations/translations.rs b/src/translations/translations.rs index 63d1a997..aa6778de 100644 --- a/src/translations/translations.rs +++ b/src/translations/translations.rs @@ -235,7 +235,7 @@ pub fn traffic_rate_translation(language: Language) -> Text<'static, StyleType> }) } -// pub fn relevant_connections_translation(language: Language) -> Text<'static, StyleType>> { +// pub fn relevant_connections_translation(language: Language) -> Text<'static, StyleType> { // Text::new(match language { // Language::EN => "Relevant connections:", // Language::IT => "Connessioni rilevanti:", @@ -723,7 +723,7 @@ pub fn of_total_translation(language: Language, percentage: &str) -> String { } } -// pub fn filtered_application_translation(language: Language) -> Text<'static,StyleType>> { +// pub fn filtered_application_translation(language: Language) -> Text<'static,StyleType> { // Text::new(match language { // Language::EN => "Filtered packets per application protocol:", // Language::IT => "Pacchetti filtrati per protocollo applicativo:", @@ -745,7 +745,7 @@ pub fn of_total_translation(language: Language, percentage: &str) -> String { // }) // } -// pub fn no_favorites_translation(language: Language) -> Text<'static, StyleType>> { +// pub fn no_favorites_translation(language: Language) -> Text<'static, StyleType> { // Text::new(match language { // Language::EN => "Nothing to show at the moment.\n\ // To add a connection to your favorites, click on the star symbol near the connection.",