-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: new layout and full screen scrolling
- Loading branch information
Showing
7 changed files
with
147 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
use egui::Ui; | ||
use egui_extras::{Column, TableBuilder}; | ||
|
||
use super::TFSetting; | ||
use crate::random::ALGS; | ||
|
||
pub fn render_commands(st: &mut TFSetting, ui: &mut Ui) { | ||
TableBuilder::new(ui) | ||
.auto_shrink([true, true]) | ||
.column(Column::exact(100.0)) | ||
.column(Column::exact(150.0)) | ||
.header(20.0, |mut header| { | ||
header.col(|ui| { | ||
ui.heading("Challenge"); | ||
}); | ||
|
||
header.col(|ui| { | ||
ui.heading("Actions"); | ||
}); | ||
}) | ||
.body(|mut body| { | ||
for alg in ALGS { | ||
body.row(50.0, |mut row| { | ||
row.col(|ui| { | ||
ui.label(alg.description); | ||
}); | ||
|
||
row.col(|ui| { | ||
ui.horizontal(|ui| { | ||
if ui.button("use").clicked() { | ||
st.command = "level".to_owned() + " " + alg.id + ";" | ||
} | ||
}); | ||
}); | ||
}); | ||
} | ||
}); | ||
ui.label("size"); | ||
ui.add(egui::DragValue::new(&mut st.size)); | ||
ui.collapsing("?", |ui| { | ||
ui.label("a size of 3 with the challenge 'english words' means 3 words"); | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
use egui::Ui; | ||
use egui_extras::{Column, TableBuilder}; | ||
|
||
use crate::random::Algorithm; | ||
|
||
pub fn render_alg(level: &Algorithm, ui: &mut Ui) { | ||
TableBuilder::new(ui) | ||
.striped(true) | ||
.vscroll(true) | ||
.column(Column::exact(150.0)) | ||
.column(Column::exact(250.0)) | ||
.header(20.0, |mut header| { | ||
header.col(|ui| { | ||
ui.heading("Challenge"); | ||
}); | ||
header.col(|_ui| {}); | ||
}) | ||
.body(|mut body| { | ||
body.row(30.0, |mut row| { | ||
row.col(|ui| { | ||
ui.label("id"); | ||
}); | ||
row.col(|ui| { | ||
ui.label(level.id); | ||
}); | ||
}); | ||
|
||
body.row(30.0, |mut row| { | ||
row.col(|ui| { | ||
ui.label("version"); | ||
}); | ||
row.col(|ui| { | ||
ui.label(level.version); | ||
}); | ||
}); | ||
|
||
body.row(30.0, |mut row| { | ||
row.col(|ui| { | ||
ui.label("description"); | ||
}); | ||
row.col(|ui| { | ||
ui.label(level.description); | ||
}); | ||
}); | ||
body.row(30.0, |mut row| { | ||
row.col(|ui| { | ||
ui.label("lang"); | ||
}); | ||
row.col(|ui| { | ||
ui.label(level.lang); | ||
}); | ||
}); | ||
body.row(30.0, |mut row| { | ||
row.col(|ui| { | ||
ui.label("score multiplier"); | ||
}); | ||
row.col(|ui| { | ||
ui.label(level.out_size.to_string()); | ||
}); | ||
}); | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters