Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

intellij-style, side-locked dockers and ui cleanup #28

Merged
merged 67 commits into from
Jan 23, 2023
Merged
Show file tree
Hide file tree
Changes from 29 commits
Commits
Show all changes
67 commits
Select commit Hold shift + click to select a range
c438681
initial draggable side panel label impl
ix0rai Jan 6, 2023
7c9436b
functional dock highlighting
ix0rai Jan 7, 2023
4fd3050
functional dock moving
ix0rai Jan 7, 2023
3c998ad
docks on both sides and improvements
ix0rai Jan 8, 2023
cc8210b
work in progress improvements
ix0rai Jan 8, 2023
17668f5
INCREDIBLY broken version of side unification
ix0rai Jan 10, 2023
8d60e06
MAKE THINGS SORT OF MOSTLY WORK
ix0rai Jan 11, 2023
f7f8a1d
better highlighting
ix0rai Jan 11, 2023
45245d8
remove stupid
ix0rai Jan 11, 2023
dc60d9c
various fixes
ix0rai Jan 11, 2023
2cf2b82
docker selector on left and refactors
ix0rai Jan 11, 2023
7db42cc
functionality for docker buttons
ix0rai Jan 11, 2023
0fa9aff
refactors and improvements
ix0rai Jan 12, 2023
63e57a1
fix a crash
ix0rai Jan 12, 2023
ce03618
reimplementations and improvements
ix0rai Jan 12, 2023
a61633a
new docker title bar with minimise button; refactors
ix0rai Jan 12, 2023
ff9410c
misc work; improve collab panel
ix0rai Jan 13, 2023
2eb2209
add docker title to panels without it
ix0rai Jan 13, 2023
16c7d3c
initial version of ui state saving
ix0rai Jan 14, 2023
faa96fc
remove some unused code
ix0rai Jan 15, 2023
39cd2b0
mouse feedback when moving dockers
ix0rai Jan 15, 2023
f7894a7
refactors
ix0rai Jan 15, 2023
e2a9192
new "all classes" docker
ix0rai Jan 15, 2023
88c53cd
better warning
ix0rai Jan 15, 2023
26efddf
remove unused UiConfig code
ix0rai Jan 15, 2023
1a06e6f
implement closing and opening of compound docks
ix0rai Jan 15, 2023
e312cc8
migrate translations
ix0rai Jan 15, 2023
3ffb5db
make docks and dockers unaware of their locations
ix0rai Jan 16, 2023
0453ce1
configable dock highlight color
ix0rai Jan 16, 2023
2c90dd9
fix broken everything
ix0rai Jan 16, 2023
7608bce
always repaint on docker close
ix0rai Jan 16, 2023
a3a1c5a
fix badly arranged imports in Gui
ix0rai Jan 16, 2023
95b0073
remove obsolete code in Gui#openDocker and correct comments
ix0rai Jan 16, 2023
b61a48c
remove unused import in Main
ix0rai Jan 16, 2023
4456f20
fix problems saving horizontal location (remove bad check)
ix0rai Jan 16, 2023
faad2d8
move docker serialisation and deserialisation into UiConfig
ix0rai Jan 16, 2023
6c25983
refactors
ix0rai Jan 16, 2023
f1d1768
fix some issues
ix0rai Jan 17, 2023
942244d
fix button state desyncs
ix0rai Jan 17, 2023
d61dfc2
cleanup, remove obsolete layout field from UiConfig
ix0rai Jan 17, 2023
6036412
fix some saving and restoration issues
ix0rai Jan 17, 2023
bbb227c
address review comments
ix0rai Jan 17, 2023
0d063cd
properly clear dockers on unification
ix0rai Jan 17, 2023
1c3bdcf
better defaults
ix0rai Jan 17, 2023
84f2c0c
avoid having empty space when closing a docker on a split dock
ix0rai Jan 18, 2023
ce45c49
fix second issue
ix0rai Jan 18, 2023
bed3330
ew bad formatting
ix0rai Jan 18, 2023
0facefa
fix dock not hiding in rare cases
ix0rai Jan 18, 2023
1df677e
more broken logic
ix0rai Jan 18, 2023
c8ae1d8
fix divider state saving issues
ix0rai Jan 18, 2023
d6f31f8
code cleanup
ix0rai Jan 18, 2023
6b80ec0
cleanup 2
ix0rai Jan 18, 2023
e1bc059
avoid showing empty docker container when minimising
ix0rai Jan 18, 2023
20839e9
avoid deleting unified docker when opening new split over it
ix0rai Jan 18, 2023
087949d
remove debug message
ix0rai Jan 18, 2023
d35ad65
fix for structure docker showing far too often when using the editor …
ix0rai Jan 18, 2023
96820f3
avoid wasting space when opening dockers
ix0rai Jan 18, 2023
f42a194
correct old comments
ix0rai Jan 18, 2023
40c6bc7
fix divider location restoration issues
ix0rai Jan 19, 2023
073a2fa
decrease code duplication a little
ix0rai Jan 19, 2023
901cb9d
Revert "decrease code duplication a little"
ix0rai Jan 19, 2023
c4a4d15
hackfix the hackfix
ix0rai Jan 20, 2023
9ad818c
repaint from a better codepoint to avoid visual corruption with docke…
ix0rai Jan 20, 2023
ed32089
Restore state even when there aren't any dockers selected
IotaBread Jan 20, 2023
a37ddbc
slightly cleaner implementation of dock hosting
ix0rai Jan 21, 2023
f4c3f21
fix docker labels randomly disappearing
ix0rai Jan 21, 2023
b52e538
add another edge case to full check
ix0rai Jan 23, 2023
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
27 changes: 16 additions & 11 deletions enigma-swing/src/main/java/cuchaz/enigma/gui/ClassSelector.java
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ public ClassSelector(Gui gui, Comparator<ClassEntry> comparator, boolean isRenam
public Component getTreeCellRendererComponent(JTree tree, Object value, boolean sel, boolean expanded, boolean leaf, int row, boolean hasFocus) {
super.getTreeCellRendererComponent(tree, value, sel, expanded, leaf, row, hasFocus);

if (leaf && value instanceof ClassSelectorClassNode) {
setIcon(GuiUtil.getClassIcon(gui, ((ClassSelectorClassNode) value).getObfEntry()));
if (leaf && value instanceof ClassSelectorClassNode node) {
setIcon(GuiUtil.getClassIcon(gui, node.getObfEntry()));
}

return this;
Expand Down Expand Up @@ -160,19 +160,23 @@ public void setRenameSelectionListener(RenameSelectionListener renameSelectionLi
this.renameSelectionListener = renameSelectionListener;
}

public NestedPackages getPackageManager() {
return this.packageManager;
}

public void setClasses(Collection<ClassEntry> classEntries) {
List<StateEntry> state = getExpansionState();
List<StateEntry> state = this.getExpansionState();

if (classEntries == null) {
setModel(null);
this.setModel(null);
return;
}

// update the tree control
packageManager = new NestedPackages(classEntries, comparator, controller.project.getMapper());
setModel(new DefaultTreeModel(packageManager.getRoot()));
this.packageManager = new NestedPackages(classEntries, this.comparator, this.controller.project.getMapper());
this.setModel(new DefaultTreeModel(this.packageManager.getRoot()));

restoreExpansionState(state);
this.restoreExpansionState(state);
}

public ClassEntry getSelectedClass() {
Expand Down Expand Up @@ -211,12 +215,13 @@ public List<StateEntry> getExpansionState() {
}

public void restoreExpansionState(List<StateEntry> expansionState) {
clearSelection();
this.clearSelection();

for (StateEntry entry : expansionState) {
switch (entry.state) {
case SELECTED -> addSelectionPath(entry.path);
case EXPANDED -> expandPath(entry.path);
if (entry.state() == State.EXPANDED) {
this.expandPath(entry.path());
} else if (entry.state() == State.SELECTED) {
this.addSelectionPath(entry.path());
}
}
}
Expand Down
Loading