diff --git a/.vs/AIT/FileContentIndex/4c69862f-2b19-4f1b-a5c8-7b9a3a13bf8d.vsidx b/.vs/AIT/FileContentIndex/4c69862f-2b19-4f1b-a5c8-7b9a3a13bf8d.vsidx new file mode 100644 index 0000000..70aef67 Binary files /dev/null and b/.vs/AIT/FileContentIndex/4c69862f-2b19-4f1b-a5c8-7b9a3a13bf8d.vsidx differ diff --git a/.vs/AIT/FileContentIndex/db1146a8-258a-4b53-baaa-764db79783d4.vsidx b/.vs/AIT/FileContentIndex/db1146a8-258a-4b53-baaa-764db79783d4.vsidx new file mode 100644 index 0000000..c4a68f6 Binary files /dev/null and b/.vs/AIT/FileContentIndex/db1146a8-258a-4b53-baaa-764db79783d4.vsidx differ diff --git a/.vs/AIT/v17/.wsuo b/.vs/AIT/v17/.wsuo new file mode 100644 index 0000000..9cf9162 Binary files /dev/null and b/.vs/AIT/v17/.wsuo differ diff --git a/.vs/AIT/v17/DocumentLayout.backup.json b/.vs/AIT/v17/DocumentLayout.backup.json new file mode 100644 index 0000000..c0380ed --- /dev/null +++ b/.vs/AIT/v17/DocumentLayout.backup.json @@ -0,0 +1,54 @@ +{ + "Version": 1, + "WorkspaceRootPath": "C:\\msys64\\home\\doryan\\AIT\\", + "Documents": [ + { + "AbsoluteMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|C:\\msys64\\home\\doryan\\AIT\\src\\main.rs||{3B902123-F8A7-4915-9F01-361F908088D0}", + "RelativeMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|solutionrelative:src\\main.rs||{3B902123-F8A7-4915-9F01-361F908088D0}" + }, + { + "AbsoluteMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|C:\\msys64\\home\\doryan\\AIT\\.gitignore||{3B902123-F8A7-4915-9F01-361F908088D0}", + "RelativeMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|solutionrelative:.gitignore||{3B902123-F8A7-4915-9F01-361F908088D0}" + } + ], + "DocumentGroupContainers": [ + { + "Orientation": 0, + "VerticalTabListWidth": 256, + "DocumentGroups": [ + { + "DockedWidth": 200, + "SelectedChildIndex": 1, + "Children": [ + { + "$type": "Document", + "DocumentIndex": 1, + "Title": ".gitignore", + "DocumentMoniker": "C:\\msys64\\home\\doryan\\AIT\\.gitignore", + "RelativeDocumentMoniker": ".gitignore", + "ToolTip": "C:\\msys64\\home\\doryan\\AIT\\.gitignore", + "RelativeToolTip": ".gitignore", + "ViewState": "AgIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==", + "Icon": "00000000-0000-0000-0000-000000000000.000000|iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAF8SURBVDhPjVNLTgJBEG1lwpoFB3GNK9fieA48hD8iwT/ihwgSDAIHgAGXXsEV18CNzL/LquqZdsYM6kteXqcy3fWqpmpNRBgOhyABBEgpAFVKPIMUcYzUyOU\u002BXM/b2qtU3vkSfRjjZTCAMAw1A2LwzdFoBPP5HNqdzuL27n4juibWI\u002BUshBA1DIkhEx9iEorFotgslQqGYbxxAGFEqt1MxmPWJLbLZdZ\u002Bv89q5PMFPiTR6z2zdaxR0fXA0XTBcVywkb4fwHXjRteecIDNQ7UmExVYAdPcxYaqclN46na5WenMKjtlVnTYwcXlVYaDqImW9beD5N/TeGy32QHXm6hZ03ZgiSQHp2fnWQ4oBmJqWSqwAqZpZjt4aLXAD4J0VqyZsmoubfB8H2r1eoaD6NXZ9HcHO\u002BSA3f4AjifXl8rItOETM8ckB9WTWpYD9RdeZ1PWVWAHWXPQaDb59f/w8LiqHeh1pvGkCaP6qB8yXusoxmuNZ7XmII4O9vGuEF86osuDYRkpYQAAAABJRU5ErkJggg==", + "WhenOpened": "2024-08-18T21:59:06.655Z", + "EditorCaption": "" + }, + { + "$type": "Document", + "DocumentIndex": 0, + "Title": "main.rs", + "DocumentMoniker": "C:\\msys64\\home\\doryan\\AIT\\src\\main.rs", + "RelativeDocumentMoniker": "src\\main.rs", + "ToolTip": "C:\\msys64\\home\\doryan\\AIT\\src\\main.rs", + "RelativeToolTip": "src\\main.rs", + "ViewState": "AgIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==", + "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.001001|", + "WhenOpened": "2024-08-18T21:59:04.875Z", + "EditorCaption": "" + } + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/.vs/AIT/v17/DocumentLayout.json b/.vs/AIT/v17/DocumentLayout.json new file mode 100644 index 0000000..800e8a5 --- /dev/null +++ b/.vs/AIT/v17/DocumentLayout.json @@ -0,0 +1,53 @@ +{ + "Version": 1, + "WorkspaceRootPath": "C:\\msys64\\home\\doryan\\AIT\\", + "Documents": [ + { + "AbsoluteMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|C:\\msys64\\home\\doryan\\AIT\\src\\main.rs||{3B902123-F8A7-4915-9F01-361F908088D0}", + "RelativeMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|solutionrelative:src\\main.rs||{3B902123-F8A7-4915-9F01-361F908088D0}" + }, + { + "AbsoluteMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|C:\\msys64\\home\\doryan\\AIT\\.gitignore||{3B902123-F8A7-4915-9F01-361F908088D0}", + "RelativeMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|solutionrelative:.gitignore||{3B902123-F8A7-4915-9F01-361F908088D0}" + } + ], + "DocumentGroupContainers": [ + { + "Orientation": 0, + "VerticalTabListWidth": 256, + "DocumentGroups": [ + { + "DockedWidth": 200, + "SelectedChildIndex": 1, + "Children": [ + { + "$type": "Document", + "DocumentIndex": 1, + "Title": ".gitignore", + "DocumentMoniker": "C:\\msys64\\home\\doryan\\AIT\\.gitignore", + "RelativeDocumentMoniker": ".gitignore", + "ToolTip": "C:\\msys64\\home\\doryan\\AIT\\.gitignore", + "RelativeToolTip": ".gitignore", + "ViewState": "AgIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==", + "Icon": "00000000-0000-0000-0000-000000000000.000000|iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAF8SURBVDhPjVNLTgJBEG1lwpoFB3GNK9fieA48hD8iwT/ihwgSDAIHgAGXXsEV18CNzL/LquqZdsYM6kteXqcy3fWqpmpNRBgOhyABBEgpAFVKPIMUcYzUyOU\u002BXM/b2qtU3vkSfRjjZTCAMAw1A2LwzdFoBPP5HNqdzuL27n4juibWI\u002BUshBA1DIkhEx9iEorFotgslQqGYbxxAGFEqt1MxmPWJLbLZdZ\u002Bv89q5PMFPiTR6z2zdaxR0fXA0XTBcVywkb4fwHXjRteecIDNQ7UmExVYAdPcxYaqclN46na5WenMKjtlVnTYwcXlVYaDqImW9beD5N/TeGy32QHXm6hZ03ZgiSQHp2fnWQ4oBmJqWSqwAqZpZjt4aLXAD4J0VqyZsmoubfB8H2r1eoaD6NXZ9HcHO\u002BSA3f4AjifXl8rItOETM8ckB9WTWpYD9RdeZ1PWVWAHWXPQaDb59f/w8LiqHeh1pvGkCaP6qB8yXusoxmuNZ7XmII4O9vGuEF86osuDYRkpYQAAAABJRU5ErkJggg==", + "WhenOpened": "2024-08-18T21:59:06.655Z" + }, + { + "$type": "Document", + "DocumentIndex": 0, + "Title": "main.rs", + "DocumentMoniker": "C:\\msys64\\home\\doryan\\AIT\\src\\main.rs", + "RelativeDocumentMoniker": "src\\main.rs", + "ToolTip": "C:\\msys64\\home\\doryan\\AIT\\src\\main.rs", + "RelativeToolTip": "src\\main.rs", + "ViewState": "AgIAAAAAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAA==", + "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.001001|", + "WhenOpened": "2024-08-18T21:59:04.875Z", + "EditorCaption": "" + } + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/.vs/ProjectSettings.json b/.vs/ProjectSettings.json new file mode 100644 index 0000000..f8b4888 --- /dev/null +++ b/.vs/ProjectSettings.json @@ -0,0 +1,3 @@ +{ + "CurrentProjectSetting": null +} \ No newline at end of file diff --git a/.vs/VSWorkspaceState.json b/.vs/VSWorkspaceState.json new file mode 100644 index 0000000..bb42b5b --- /dev/null +++ b/.vs/VSWorkspaceState.json @@ -0,0 +1,7 @@ +{ + "ExpandedNodes": [ + "", + "\\src" + ], + "PreviewInSolutionExplorer": false +} \ No newline at end of file diff --git a/.vs/slnx.sqlite b/.vs/slnx.sqlite new file mode 100644 index 0000000..741dadf Binary files /dev/null and b/.vs/slnx.sqlite differ diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..f53383d --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,45 @@ +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "type": "lldb", + "request": "launch", + "name": "Debug executable 'AIT'", + "cargo": { + "args": [ + "build", + "--bin=AIT", + "--package=AIT" + ], + "filter": { + "name": "AIT", + "kind": "bin" + } + }, + "args": [], + "cwd": "${workspaceFolder}" + }, + { + "type": "lldb", + "request": "launch", + "name": "Debug unit tests in executable 'AIT'", + "cargo": { + "args": [ + "test", + "--no-run", + "--bin=AIT", + "--package=AIT" + ], + "filter": { + "name": "AIT", + "kind": "bin" + } + }, + "args": [], + "cwd": "${workspaceFolder}" + } + ] +} \ No newline at end of file diff --git a/Cargo.lock b/Cargo.lock index 111708a..accf336 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -11,6 +11,7 @@ dependencies = [ "gtk4", "libadwaita", "tokio", + "winres", ] [[package]] @@ -712,7 +713,7 @@ dependencies = [ "cfg-expr", "heck", "pkg-config", - "toml", + "toml 0.8.19", "version-compare", ] @@ -750,6 +751,15 @@ dependencies = [ "syn", ] +[[package]] +name = "toml" +version = "0.5.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4f7f0dd8d50a853a531c426359045b1998f04219d88799810762cd4ad314234" +dependencies = [ + "serde", +] + [[package]] name = "toml" version = "0.8.19" @@ -898,6 +908,15 @@ dependencies = [ "memchr", ] +[[package]] +name = "winres" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b68db261ef59e9e52806f688020631e987592bd83619edccda9c47d42cde4f6c" +dependencies = [ + "toml 0.5.11", +] + [[package]] name = "wyz" version = "0.5.1" diff --git a/Cargo.toml b/Cargo.toml index 8421b3d..f8d0009 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,8 +6,11 @@ edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -adw = { version = "0.7.0", package = "libadwaita", features = ["v1_4", "v1_5"] } +adw = { version = "0.7.0", package = "libadwaita"} bitvec = "1.0.1" gio = { version = "0.20.0", features = ["v2_74"] } gtk = { version = "0.9.0", package = "gtk4", features = ["v4_12"] } tokio = { version = "1.39.2", features = ["rt", "time", "rt-multi-thread", "macros", "sync"] } + +[build-dependencies] +winres = "0.1" \ No newline at end of file diff --git a/build.rs b/build.rs new file mode 100644 index 0000000..f04ae70 --- /dev/null +++ b/build.rs @@ -0,0 +1,9 @@ +extern crate winres; + +fn main() { + if cfg!(target_os = "windows") { + let mut res = winres::WindowsResource::new(); + res.set_icon("./src/view/resources/icon.ico"); // Replace this with the filename of your .ico file. + res.compile().unwrap(); + } +} \ No newline at end of file diff --git a/src/view/components/dialogues.rs b/src/view/components/dialogues.rs index af3fb97..7688ee1 100644 --- a/src/view/components/dialogues.rs +++ b/src/view/components/dialogues.rs @@ -57,8 +57,8 @@ pub fn open_help_dialogue(_action: &SimpleAction, _var: Option<&Variant>) { let custom_header = HeaderBar::new(); Window::builder() - .width_request(400) - .height_request(300) + .width_request(800) + .height_request(600) .name("help") .title("Помощь") .titlebar(&custom_header) diff --git a/src/view/resources/icon.ico b/src/view/resources/icon.ico new file mode 100644 index 0000000..dfecb99 Binary files /dev/null and b/src/view/resources/icon.ico differ diff --git a/src/view/resources/icon.png b/src/view/resources/icon.png new file mode 100644 index 0000000..068a28b Binary files /dev/null and b/src/view/resources/icon.png differ diff --git a/src/view/ui.rs b/src/view/ui.rs index 26b64f2..b34748b 100644 --- a/src/view/ui.rs +++ b/src/view/ui.rs @@ -22,7 +22,10 @@ pub fn ui(application: &adw::Application) { let default_settings = Settings::default(); if let Some(settings) = default_settings { - settings.set_gtk_font_name(Some("Segoe UI 9")); + { + #[cfg(target_os = "windows")] + settings.set_gtk_font_name(Some("Segoe UI 9")); + } settings.connect_gtk_application_prefer_dark_theme_notify(load_css); settings.connect_gtk_theme_name_notify(load_css); load_css(&settings);