diff --git a/Cargo.toml b/Cargo.toml index 854072a..eb61da8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,9 +3,11 @@ name = "text-diff" version = "0.1.0" edition = "2021" authors = ["CodeDead "] +description = "A cross-platform GUI for comparing two text files" readme = "README.md" repository = "https://github.com/CodeDead/text-diff-rs" license-file = "LICENSE" +keywords = ["gui", "ui", "text-diff", "interface", "codedead", "diff", "difference"] # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/src/main.rs b/src/main.rs index 01a20b5..aa5eac6 100644 --- a/src/main.rs +++ b/src/main.rs @@ -11,7 +11,7 @@ pub fn main() -> iced::Result { view::ApplicationContext::run(Settings { id: Some(String::from("text-diff")), window: window::Settings { - size: (800, 600), + size: (800, 800), position: window::Position::Centered, ..window::Settings::default() }, diff --git a/src/view.rs b/src/view.rs index d405011..d832377 100644 --- a/src/view.rs +++ b/src/view.rs @@ -5,7 +5,7 @@ use crate::filereader::FileReader; use crate::style; use crate::vector_comparer::{IVectorComparer, VectorComparer}; use crate::vector_exporter::{ExportType, IVectorExporter, VectorExporter}; -use iced::{alignment, scrollable, Rule}; +use iced::{alignment, scrollable, Rule, Scrollable}; use iced::{ button, text_input, Alignment, Button, Column, Container, Element, Length, Radio, Row, Sandbox, Text, TextInput, @@ -331,13 +331,21 @@ impl Sandbox for ApplicationContext { } let diff_column = self.differences.iter().fold( - Column::new().spacing(10).push(diff_text.size(30)), + Column::new().spacing(10), |column, theme| column.push(Text::new(format!("- {}", theme))), ); + let scroll_container = Column::new().width(Length::Fill).push(diff_column); + let scroll = Scrollable::new(&mut self.scrollable) + .push(Container::new(scroll_container) + .width(Length::Fill)) + .max_height(150) + .style(self.theme); + content = content .push(Rule::horizontal(20).style(self.theme)) - .push(diff_column); + .push(diff_text.size(30)) + .push(scroll); if !self.differences.is_empty() { let btn_export = Button::new(