Skip to content

Commit

Permalink
Also highlight files with changes made to them in the workspace
Browse files Browse the repository at this point in the history
  • Loading branch information
Col-E committed Nov 24, 2024
1 parent 672fbae commit e801402
Showing 1 changed file with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;

/**
Expand Down Expand Up @@ -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);
}
}
}

Expand Down

0 comments on commit e801402

Please sign in to comment.