Skip to content
This repository was archived by the owner on Apr 16, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@ name = "text-diff"
version = "0.1.0"
edition = "2021"
authors = ["CodeDead <admin@codedead.com>"]
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

Expand Down
2 changes: 1 addition & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
},
Expand Down
14 changes: 11 additions & 3 deletions src/view.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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(
Expand Down