From e801402a058fe91a8579406c6d427aaf05933980 Mon Sep 17 00:00:00 2001 From: Matt Date: Sun, 24 Nov 2024 07:14:51 -0500 Subject: [PATCH] Also highlight files with changes made to them in the workspace --- .../services/cell/CellConfigurationService.java | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/recaf-ui/src/main/java/software/coley/recaf/services/cell/CellConfigurationService.java b/recaf-ui/src/main/java/software/coley/recaf/services/cell/CellConfigurationService.java index da44e1a50..496fb43c1 100644 --- a/recaf-ui/src/main/java/software/coley/recaf/services/cell/CellConfigurationService.java +++ b/recaf-ui/src/main/java/software/coley/recaf/services/cell/CellConfigurationService.java @@ -41,7 +41,11 @@ import software.coley.recaf.util.FxThreadUtil; import software.coley.recaf.util.Lang; import software.coley.recaf.workspace.model.Workspace; -import software.coley.recaf.workspace.model.bundle.*; +import software.coley.recaf.workspace.model.bundle.AndroidClassBundle; +import software.coley.recaf.workspace.model.bundle.Bundle; +import software.coley.recaf.workspace.model.bundle.ClassBundle; +import software.coley.recaf.workspace.model.bundle.FileBundle; +import software.coley.recaf.workspace.model.bundle.JvmClassBundle; import software.coley.recaf.workspace.model.resource.WorkspaceResource; /** @@ -164,13 +168,18 @@ private Navigable openPath(@Nonnull PathNode item) { * Content within the cell. */ public void configureStyle(@Nonnull Node cell, @Nonnull PathNode item) { - // Add the edited class CSS style to classes with changes made to them + // Add the edited class CSS style to classes & files with changes made to them cell.getStyleClass().remove(CLASS_EDITED); if (item instanceof ClassPathNode classPathNode) { var bundle = classPathNode.getValueOfType(ClassBundle.class); if (bundle != null && bundle.hasHistory(classPathNode.getValue().getName())) { cell.getStyleClass().add(CLASS_EDITED); } + } else if (item instanceof FilePathNode filePathNode) { + var bundle = filePathNode.getValueOfType(FileBundle.class); + if (bundle != null && bundle.hasHistory(filePathNode.getValue().getName())) { + cell.getStyleClass().add(CLASS_EDITED); + } } }