Skip to content

Commit

Permalink
added breakpoint toggeling on line number click
Browse files Browse the repository at this point in the history
  • Loading branch information
ArchUsr64 committed Jan 10, 2024
1 parent 7a1b9d9 commit fc44d9e
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions src/app.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use egui_macroquad::egui::Widget;
use egui_macroquad::egui::{Align2, Color32};

use crate::{cpu, egui, Memory};
Expand Down Expand Up @@ -128,7 +129,7 @@ impl App {
.enumerate()
.for_each(|(line_number, line)| {
ui.horizontal(|ui| {
ui.label(
if egui::Label::new(
egui::RichText::new(format!(
"{}{}\t",
" ".repeat(3 - (line_number + 1).to_string().len()),
Expand All @@ -141,7 +142,21 @@ impl App {
} else {
Color32::default()
}),
);
)
.sense(egui::Sense::click())
.ui(ui)
.clicked()
{
if let Some(index) = self
.breakpoints
.iter()
.position(|&i| i == line_number + 1)
{
self.breakpoints.remove(index);
} else {
self.breakpoints.push(line_number + 1);
}
};
ui.label(
egui::RichText::new(line)
.color(if line.contains(";") {
Expand Down

0 comments on commit fc44d9e

Please sign in to comment.