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

Panel content reorganization + Control/Tool rework #5384

Merged
merged 227 commits into from
Jul 2, 2021
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
Show all changes
227 commits
Select commit Hold shift + click to select a range
e8d60ba
WIP adapting to flex layout
MichaelBuessemeyer Mar 10, 2021
ffbbcb9
WIP make sure that canvas is visible
MichaelBuessemeyer Mar 10, 2021
f9395d0
First working version with minimal feature set
MichaelBuessemeyer Mar 10, 2021
496bb92
adjust layout a bit
MichaelBuessemeyer Mar 11, 2021
36e0adf
WIP cleaning up default layout and adding default layouts for all pos…
MichaelBuessemeyer Mar 11, 2021
8a4dde7
finish the builder methods for default layouts
MichaelBuessemeyer Mar 11, 2021
336ad56
WIP migrating default layout
MichaelBuessemeyer Mar 11, 2021
08e72c0
finish adding arbitray default layout
MichaelBuessemeyer Mar 12, 2021
63f03dd
Finish adding layout persistence
MichaelBuessemeyer Mar 12, 2021
01d7bc2
fix linting
MichaelBuessemeyer Mar 12, 2021
7636953
remove logging and add todos
MichaelBuessemeyer Mar 15, 2021
693ff0c
fixing layouting bug for maximize and general layout changes
MichaelBuessemeyer Mar 15, 2021
3492f92
add name and shot name to OrthoViews
MichaelBuessemeyer Mar 15, 2021
81842b9
adjust titles of viewports
MichaelBuessemeyer Mar 15, 2021
1d48a8a
css rework and various fixes
MichaelBuessemeyer Mar 15, 2021
00c5b1b
fix linting and flow
MichaelBuessemeyer Mar 15, 2021
1274437
add layout reset; add error toasts; add useful info to footer
MichaelBuessemeyer Mar 16, 2021
141f67a
fiy arbitrary layout & do not intially render content of hidden viewp…
MichaelBuessemeyer Mar 16, 2021
f2e3873
undo making arbitrary viewport quadratic with css only
MichaelBuessemeyer Mar 16, 2021
626c78f
also restrict tab arrangement after layout change
MichaelBuessemeyer Mar 16, 2021
fa507ce
fix picking the correct last active layout
MichaelBuessemeyer Mar 16, 2021
48d98f2
setting viewport rect to empty if viewport is not rendered
MichaelBuessemeyer Mar 17, 2021
de9bdd7
set default viewport rect to 0 and fix tests
MichaelBuessemeyer Mar 17, 2021
b745e27
auto hide sidebars on maximize; add maximize shortcut
MichaelBuessemeyer Mar 17, 2021
05e8ef4
add sidebar buttons to navbar & maintain border status correctly whil…
MichaelBuessemeyer Mar 18, 2021
9636181
restore old settings toggle button in navbar
MichaelBuessemeyer Mar 18, 2021
0aaff9c
remove tab title border on hover
MichaelBuessemeyer Mar 18, 2021
2e1eb8b
reduce header height
MichaelBuessemeyer Mar 18, 2021
48b699f
auto hide sidebar is width gets too small
MichaelBuessemeyer Mar 19, 2021
91c42e3
consistent renaming of sidebar to border
MichaelBuessemeyer Mar 19, 2021
010d6b4
remove golden layout
MichaelBuessemeyer Mar 19, 2021
3e81fca
Merge branch 'master' into layout-rework
MichaelBuessemeyer Mar 19, 2021
793c1a9
polish the code
MichaelBuessemeyer Mar 19, 2021
ff0969a
remove buttons from navbar; recenter logo; change toggle button icon
MichaelBuessemeyer Mar 19, 2021
d833969
final adjustments before first review
MichaelBuessemeyer Mar 19, 2021
6a9307c
Merge branch 'master' into layout-rework
MichaelBuessemeyer Mar 22, 2021
e6a5085
apply feedback
MichaelBuessemeyer Mar 23, 2021
60741bb
add border toggle buttons to top of each side
MichaelBuessemeyer Mar 23, 2021
b03cb4d
WIP apply feedback && better typing of laoyut configs
MichaelBuessemeyer Mar 23, 2021
2f23642
finish typing of json format
MichaelBuessemeyer Mar 24, 2021
0a9ba8f
better typing for webpack config
MichaelBuessemeyer Mar 24, 2021
86df4f9
apply feedback && do not react to tab maximizing in borders
MichaelBuessemeyer Mar 24, 2021
87f76f1
finish last feedback
MichaelBuessemeyer Mar 24, 2021
c6fac6f
Merge branch 'master' into layout-rework
MichaelBuessemeyer Mar 24, 2021
4b4f62f
do not react to action of sublayouts used for borders
MichaelBuessemeyer Mar 24, 2021
8c1a86c
Merge branch 'layout-rework' of github.com:scalableminds/webknossos i…
MichaelBuessemeyer Mar 24, 2021
c0d14cf
Merge branch 'master' of github.com:scalableminds/webknossos into lay…
MichaelBuessemeyer Mar 26, 2021
4c4094c
add border toggle buttons to header in tab
MichaelBuessemeyer Mar 26, 2021
ca778e2
update expected zoom values slightly
MichaelBuessemeyer Mar 26, 2021
e561497
enforce entering of icon in border toggle button
MichaelBuessemeyer Mar 26, 2021
203d356
incease visibility of resize bars
MichaelBuessemeyer Mar 26, 2021
93de7e8
undo change to expected zoom values
MichaelBuessemeyer Mar 26, 2021
8eeaa7d
Merge branch 'master' of github.com:scalableminds/webknossos into lay…
MichaelBuessemeyer Apr 7, 2021
f8b9e52
don't collapse borders below a certain width
MichaelBuessemeyer Apr 7, 2021
6a2baac
set border bar siye to 1 and fix bug not rendering border toggle buttons
MichaelBuessemeyer Apr 7, 2021
8033187
use our icons
MichaelBuessemeyer Apr 7, 2021
cd36ebe
reduce splitter size and increase header height for borders
MichaelBuessemeyer Apr 7, 2021
ea4d4e4
fix linting
MichaelBuessemeyer Apr 7, 2021
4e1c377
reduce splitter width to 1px
MichaelBuessemeyer Apr 7, 2021
96ce668
enforce left border to alwazs have the same width
MichaelBuessemeyer Apr 8, 2021
0185566
increase layout version
MichaelBuessemeyer Apr 8, 2021
a9a177c
fix bug in safari having tracing view heihgt of 0
MichaelBuessemeyer Apr 8, 2021
4facfa6
add layer settings tab
MichaelBuessemeyer Apr 8, 2021
d4a0034
apply feedback
MichaelBuessemeyer Apr 8, 2021
80a9bb8
add designated skeleton tool and hoist activeTool to annotation (inst…
philippotto Apr 14, 2021
cbf2fd6
rename volume tool to annotation tool
philippotto Apr 14, 2021
36fc6c9
convert volume actions bar to toolbar (== also show it for skeleton-o…
philippotto Apr 14, 2021
e6ff93e
fix skeleton toolbar
philippotto Apr 14, 2021
7e03c64
make context menu available in move tool
philippotto Apr 15, 2021
75dcdd4
fix inconsistent coloring of toolbar icons
philippotto Apr 15, 2021
6f595cd
first step to decouple mouse bindings from actual behavior
philippotto Apr 16, 2021
daea1c9
add general settings
MichaelBuessemeyer Apr 16, 2021
6f53901
Merge branch 'master' of github.com:scalableminds/webknossos into lay…
MichaelBuessemeyer Apr 16, 2021
922f89c
remove kl zooming
MichaelBuessemeyer Apr 16, 2021
e457e6a
further decoupling of mouse bindings and tool-specific actions
philippotto Apr 16, 2021
d6e555f
extract volume-tools-related actions from mouse bindings
philippotto Apr 16, 2021
c8ee7ab
clean up
philippotto Apr 16, 2021
a847f6a
simplify some code
philippotto Apr 16, 2021
e44136c
remove highlight hovered cell setting
MichaelBuessemeyer Apr 16, 2021
9ffe532
Merge branch 'layout-rework' of github.com:scalableminds/webknossos i…
MichaelBuessemeyer Apr 16, 2021
346f9fd
add skeleton tab
MichaelBuessemeyer Apr 16, 2021
8de43ed
small fixes
MichaelBuessemeyer Apr 16, 2021
92a0ef9
Merge branch 'master' of github.com:scalableminds/webknossos into lay…
MichaelBuessemeyer Apr 16, 2021
13122cc
fix changes in the border not being persisted
MichaelBuessemeyer Apr 16, 2021
0917d6e
Merge branch 'layout-rework' of github.com:scalableminds/webknossos i…
MichaelBuessemeyer Apr 17, 2021
da31ca7
rename folders to better match the semantic
MichaelBuessemeyer Apr 17, 2021
84a3f5b
move setting_input_view to compontents
MichaelBuessemeyer Apr 17, 2021
b4a175c
hookify skeleton tab
MichaelBuessemeyer Apr 17, 2021
a9868fc
add volume tab and fix imports
MichaelBuessemeyer Apr 17, 2021
5d683f1
remove duplicate of volume tab view
MichaelBuessemeyer Apr 17, 2021
74fefe6
merge mapping info view with volume tab
MichaelBuessemeyer Apr 17, 2021
9e2f9f0
add bounding box tab
MichaelBuessemeyer Apr 17, 2021
9972cdf
increase min width of bb tab
MichaelBuessemeyer Apr 17, 2021
cbb0500
remove old dataset and user settings tabs
MichaelBuessemeyer Apr 17, 2021
49c20d1
make API backwards-compatible
philippotto Apr 19, 2021
0386685
Merge branch 'reworked-controls' into reworked-controls-refactoring
philippotto Apr 19, 2021
8a1bb62
extract code for move/navigation handlers into own module
philippotto Apr 19, 2021
024d713
remove controller to handlers
philippotto Apr 19, 2021
8e29f14
move mouse bindings into plane controller
philippotto Apr 19, 2021
63430e3
format
philippotto Apr 19, 2021
2b204a4
remove dead code
philippotto Apr 19, 2021
7e895d4
only show toolbar in ortho view
philippotto Apr 19, 2021
d757a5c
fix cycle-tool (and add it to skeleton-only)
philippotto Apr 20, 2021
f30657b
fix tests
philippotto Apr 20, 2021
7984720
use const instead of let
philippotto Apr 20, 2021
452493a
Merge branch 'master' of github.com:scalableminds/webknossos into rew…
philippotto Apr 20, 2021
906f216
adapt status bar to refactoring
philippotto Apr 20, 2021
6de8c56
Merge branch 'reworked-controls' into reworked-controls-refactoring
philippotto Apr 20, 2021
888f477
fix left-click-label in status bar for skeleton tool
philippotto Apr 20, 2021
ec0a4f4
integrate PR feedback for #5397
philippotto Apr 21, 2021
5b4ed1b
move activeTool attribute to uiInformation (won't be persisted)
philippotto Apr 22, 2021
0d47c54
also move set-tool actions into correct modules
philippotto Apr 22, 2021
2ae2aba
add userconfig for legacy-bindings; if true, default to skeleton tool…
philippotto Apr 22, 2021
00cbeec
format
philippotto Apr 22, 2021
b907eb8
make skeleton tool work without modifiers (in non-legacy mode)
philippotto Apr 23, 2021
184fc62
implement smart drag for moving nodes
philippotto Apr 23, 2021
d9de6ad
always show node specific context menu (regardless of pressing shift)
philippotto Apr 23, 2021
82e2932
add skeleton layer to layer settings
MichaelBuessemeyer Apr 23, 2021
c80147d
Merge branch 'master' of github.com:scalableminds/webknossos into pan…
MichaelBuessemeyer Apr 23, 2021
c594021
fix general tab padding
MichaelBuessemeyer Apr 23, 2021
c40e554
adapt brush tools and extend context menu
philippotto Apr 26, 2021
aab290b
extend volume context menu a bit
philippotto Apr 26, 2021
1744011
add separate erase tools for brushing/tracing. only expose erase-brus…
philippotto Apr 28, 2021
124f940
adapt status bar to legacy-mode-setting
philippotto Apr 28, 2021
95387e3
add second erase-tool to toolbar and fix contour geometry when erasin…
philippotto Apr 28, 2021
6798a48
only show one erase tool at a time
philippotto Apr 28, 2021
bf73434
don't adapt erase tools via modifiers
philippotto Apr 28, 2021
ce88087
adapt test to eraser
philippotto Apr 29, 2021
dbcb6ca
implement quick'n'dirty animation for hiding eraser buttons
philippotto Apr 29, 2021
dd3996b
temporarily disable most CI checks
philippotto Apr 29, 2021
a22cc0e
Merge branch 'master' of github.com:scalableminds/webknossos into pan…
MichaelBuessemeyer Apr 29, 2021
30b82c7
rename general tab
MichaelBuessemeyer Apr 29, 2021
41b3015
no split in right border tabs & better flow typing
MichaelBuessemeyer Apr 29, 2021
7689152
put layer settings first in left sidebar
MichaelBuessemeyer Apr 29, 2021
dccd059
undo mergin errors
MichaelBuessemeyer Apr 30, 2021
d94dd0f
add node, tree and cell id to status bar && remove unused tabs
MichaelBuessemeyer Apr 30, 2021
7cd6abf
Merge branch 'master' into panel-content-reorganization
MichaelBuessemeyer Apr 30, 2021
bf65dfc
adding strange icons
MichaelBuessemeyer Apr 30, 2021
334b9b7
adding merger mode and soma clicking to navbar
MichaelBuessemeyer Apr 30, 2021
605e044
simplify legacy click handler
philippotto May 3, 2021
3dafe17
switch to skeleton tool if there is a skeleton and legacy mode is ena…
philippotto May 3, 2021
fbc8e6e
rename legacy to classic; add tooltip to explain setting and when it'…
philippotto May 3, 2021
4ebc97f
rename context menu file
philippotto May 3, 2021
81693b3
rename context component
philippotto May 3, 2021
d0539ce
experiment with modifiers for erasing while in draw mode
philippotto May 5, 2021
ce5929a
update icons
MichaelBuessemeyer May 6, 2021
a951678
improve toggle buttons
MichaelBuessemeyer May 6, 2021
ba2912e
add brush size icon
MichaelBuessemeyer May 6, 2021
b2a7156
reordering files
MichaelBuessemeyer May 6, 2021
c503941
add brush size
MichaelBuessemeyer May 6, 2021
1d80fa3
Merge branch 'master' of github.com:scalableminds/webknossos into pan…
MichaelBuessemeyer May 6, 2021
c6ebc2d
add uint64 segmentation warning to statusbar active cell id element
MichaelBuessemeyer May 6, 2021
192f43b
fix css & improve merger mode icon
MichaelBuessemeyer May 7, 2021
e593b3c
add hovered cell id to node context menu + copy functionality
MichaelBuessemeyer May 7, 2021
f3febd8
fix border toggle icons in dark mode
MichaelBuessemeyer May 7, 2021
35d7ac6
don't show tooltip hints when pressing modifiers in skeleton tool whe…
philippotto May 10, 2021
cb90c4e
avoid unnecessary rerenders
philippotto May 10, 2021
f729439
use moreIconStyle
philippotto May 10, 2021
c379b0b
allow volume erasure by pressing ctrl + shift while in draw tool
philippotto May 12, 2021
d5302ad
add flood-fill to context menu
philippotto May 12, 2021
c46aad4
adapt context menu order depending ona active tool
philippotto May 12, 2021
797dd6a
compact button groups in skeleton + commend tab + add option to hide …
MichaelBuessemeyer May 14, 2021
760155a
monochrome merger mode and soma clicking icons
MichaelBuessemeyer May 14, 2021
86d43e7
use segment instead of cell for UI
MichaelBuessemeyer May 14, 2021
d41ce83
put bbox name input next to bbox toggle
MichaelBuessemeyer May 14, 2021
1c81a58
change icon for adding new bbox
MichaelBuessemeyer May 14, 2021
3ce52fb
show segmentation opacity in view mode
MichaelBuessemeyer May 14, 2021
028e252
make statusbar control hints dependent on modifiers
philippotto May 17, 2021
ce5deb1
Merge branch 'master' of github.com:scalableminds/webknossos into new…
philippotto May 18, 2021
a8dcb8a
rename cell to segment
philippotto May 19, 2021
dee59fe
fix z-index of context menu
philippotto May 19, 2021
827aa59
adapt tooltip for skeleton tool to (non)-classic mode
philippotto May 19, 2021
8e599e5
add create-tree-button which replaces the create-cell-button when the…
philippotto May 19, 2021
484ec46
bump maximum node radius during picking by 50%
philippotto May 19, 2021
2084e30
make classic-mode name more concise
philippotto May 19, 2021
007f054
adapt wheel-hint in navbar to zooming
philippotto May 19, 2021
3bc26ca
don't show 'select segment 0' in context menu
philippotto May 20, 2021
188e866
fix context menu for volume-only annotations
philippotto May 20, 2021
f832ccd
allow repeated context menu clicks
philippotto May 20, 2021
494fa73
add title to skeleton tab icon buttons
MichaelBuessemeyer May 21, 2021
4c7bed1
fix spacing of settings elements
MichaelBuessemeyer May 21, 2021
348cdd0
trigger tree context menu of skeleton tab via rightclick
MichaelBuessemeyer May 21, 2021
9491d0f
always hide mapping selection when mapping id option is turned of
MichaelBuessemeyer May 21, 2021
226beae
fix jobs link in toast after dataset-upload
philippotto May 21, 2021
4a958cd
try to fix exiting context menu
philippotto May 21, 2021
ebb731b
allow repeated context-menus, close context-menu on blur and on escape
philippotto May 25, 2021
642039e
hide volumetracing actions in dataset view mode
philippotto May 25, 2021
f72fa0d
fix layout of mouse control hints and fix action labels
philippotto May 25, 2021
20f14a6
incorporate feedback
philippotto May 25, 2021
7c811a4
restore ci checks
philippotto May 25, 2021
3707981
restore tooltip text on disabled merger-mode switch
philippotto May 25, 2021
c0f97b8
adapt eraser tools to move when pressing alt
philippotto May 25, 2021
758c7f8
don't require shift-click to select a node in 3D viewport if using no…
philippotto May 25, 2021
3e0848d
apply voxelS correction from pr feedback
philippotto May 25, 2021
4c35748
remove unused var
philippotto May 25, 2021
1f6249f
add to application.conf, handle setting in recommended task settings…
philippotto May 26, 2021
0b0ba33
update snapshots
philippotto May 31, 2021
51f9c4b
update documentation to new controls and also mention the classic mode
philippotto Jun 1, 2021
6ed0a39
add NUX for new controls to encourage ditching the legacy mode
philippotto Jun 1, 2021
91fb456
link to docs in nux and tweak styling
philippotto Jun 1, 2021
6d40fdb
Merge branch 'new-controls' of github.com:scalableminds/webknossos in…
philippotto Jun 3, 2021
a0c9239
incorporate changes of statusbar.js from panel reorganization
philippotto Jun 3, 2021
9ff3243
Merge branch 'master' of github.com:scalableminds/webknossos into new…
philippotto Jun 3, 2021
bfcb9c4
remove unused setVisible argument
MichaelBuessemeyer Jun 3, 2021
dce78e5
remove outdated todo
MichaelBuessemeyer Jun 3, 2021
539d384
Merge branch 'panel-content-reorganization' of github.com:scalablemin…
MichaelBuessemeyer Jun 3, 2021
e0aa4d7
only show change brush size when a brush tool is active
MichaelBuessemeyer Jun 3, 2021
408fb22
various fixes / changes
MichaelBuessemeyer Jun 4, 2021
6c4c078
add tooltips to tab titles
MichaelBuessemeyer Jun 4, 2021
4ed9193
apply layouting / styling feedback
MichaelBuessemeyer Jun 4, 2021
5924727
Merge branch 'master' of github.com:scalableminds/webknossos into pan…
MichaelBuessemeyer Jun 4, 2021
00151c8
Merge branch 'master' into panel-content-reorganization
MichaelBuessemeyer Jun 7, 2021
501b956
hide divider in context menu if it's not needed
philippotto Jun 7, 2021
0e2d0b5
tweak styling of edit icons in status bar
philippotto Jun 7, 2021
d627d6b
use a composite icon for new-tree in toolbar
philippotto Jun 8, 2021
75e4c40
remove invisible-layer-warning
philippotto Jun 8, 2021
023b0cf
tweak last layouting issues (margins, border-radius etc.)
philippotto Jun 8, 2021
e8c97bc
update migration guide with application.conf flag
philippotto Jun 8, 2021
ec27e81
Apply language improving suggestions from code review
MichaelBuessemeyer Jun 8, 2021
7d59a38
add full name of tab to tab description title
MichaelBuessemeyer Jun 8, 2021
2730420
pretty code
MichaelBuessemeyer Jun 8, 2021
9081d36
fix color of the soma & merger mode buttons and improve their describ…
MichaelBuessemeyer Jun 8, 2021
4bcfaee
Merge branch 'master' of github.com:scalableminds/webknossos into pan…
philippotto Jun 9, 2021
e79489e
shrink size of skeleton mode icons and add shortcut hint to tooltips …
philippotto Jun 9, 2021
f00c1b8
make mapping view visible in dataset view mode
philippotto Jun 9, 2021
cb384e1
Merge branch 'master' of github.com:scalableminds/webknossos into pan…
philippotto Jul 1, 2021
c6b5fd8
update changelog
philippotto Jul 1, 2021
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
45 changes: 37 additions & 8 deletions frontend/javascripts/oxalis/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,17 +97,46 @@ export const OrthoViewCrosshairColors: OrthoViewMap<[number, number]> = {
};

export const BorderTabs = {
DatasetInfoTabView: { id: "DatasetInfoTabView", name: "Info" },
CommentTabView: { id: "CommentTabView", name: "Comments" },
MeshesView: { id: "MeshesView", name: "Meshes" },
SkeletonTabView: { id: "SkeletonTabView", name: "Skeleton" },
AbstractTreeTab: { id: "AbstractTreeTab", name: "AbsTree" },
DatasetInfoTabView: {
id: "DatasetInfoTabView",
name: "Info",
description: "Information about the dataset",
},
CommentTabView: {
id: "CommentTabView",
name: "Comments",
description: "Add comments to skeleton nodes",
},
MeshesView: {
id: "MeshesView",
name: "Meshes",
description: "Load, compute and organize Meshes of segments",
},
SkeletonTabView: {
id: "SkeletonTabView",
name: "Skeleton",
description: "Create and organize skeletons",
},
AbstractTreeTab: {
id: "AbstractTreeTab",
name: "AbsTree",
description: "Views an abstract version of the active skeleton",
MichaelBuessemeyer marked this conversation as resolved.
Show resolved Hide resolved
},
ControlsAndRenderingSettingsTab: {
id: "ControlsAndRenderingSettingsTab",
name: "Controls/Rendering",
name: "Settings",
description: "Change general settings about controls and rendering.",
},
BoundingBoxTab: {
id: "BoundingBoxTab",
name: "BBoxes",
description: "Add and organize bounding boxes",
},
LayerSettingsTab: {
id: "LayerSettingsTab",
name: "Layers",
description: "Change settings of each data layer",
},
BoundingBoxTab: { id: "BoundingBoxTab", name: "BBoxes" },
LayerSettingsTab: { id: "LayerSettingsTab", name: "Layer" },
};

export const OrthoViewGrayCrosshairColor = 0x222222;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,7 @@ export class EraseTool {
_altKey: boolean,
): Object {
return {
leftDrag: `Erase (${activeTool === AnnotationToolEnum.BRUSH ? "Brush" : "Trace"})`,
leftDrag: `Erase (${activeTool === AnnotationToolEnum.ERASE_BRUSH ? "Brush" : "Trace"})`,
rightClick: "Context Menu",
};
}
Expand Down

This file was deleted.

159 changes: 116 additions & 43 deletions frontend/javascripts/oxalis/view/action-bar/toolbar_view.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,26 @@ import {
getDisabledInfoForTools,
adaptActiveToolToShortcuts,
} from "oxalis/model/accessors/tool_accessor";
import { createTreeAction } from "oxalis/model/actions/skeletontracing_actions";
import {
createTreeAction,
setMergerModeEnabledAction,
} from "oxalis/model/actions/skeletontracing_actions";
import { getActiveTree } from "oxalis/model/accessors/skeletontracing_accessor";
import { LogSliderSetting } from "oxalis/view/components/setting_input_views";
import { userSettings } from "types/schemas/user_settings.schema";
import { toNullable } from "libs/utils";
import SkeletonActionsView, { narrowButtonStyle } from "./skeleton_actions_view";

const narrowButtonStyle = {
paddingLeft: 10,
paddingRight: 8,
};

const imgStyleForSpaceyIcons = {
width: 20,
height: 20,
lineHeight: 10,
marginTop: -2,
};

function getSkeletonToolHint(activeTool, isShiftPressed, isControlPressed, isAltPressed): ?string {
if (activeTool !== AnnotationToolEnum.SKELETON) {
Expand Down Expand Up @@ -156,6 +170,49 @@ function OverwriteModeSwitch({ isControlPressed, isShiftPressed, visible }) {
);
}

function AdditionalSkeletonModesButtons() {
const dispatch = useDispatch();
const isMergerModeEnabled = useSelector(
state => state.temporaryConfiguration.isMergerModeEnabled,
);
const isNewNodeNewTreeModeOn = useSelector(state => state.userConfiguration.newNodeNewTree);
const toggleNewNodeNewTreeMode = () =>
dispatch(updateUserSettingAction("newNodeNewTree", !isNewNodeNewTreeModeOn));
const toggleMergerMode = () => dispatch(setMergerModeEnabledAction(!isMergerModeEnabled));
const activeButtonStyle = { ...narrowButtonStyle, borderColor: "#1890ff" };
MichaelBuessemeyer marked this conversation as resolved.
Show resolved Hide resolved
const newNodeNewTreeModeButtonStyle = isNewNodeNewTreeModeOn
? activeButtonStyle
: narrowButtonStyle;
const mergerModeButtonStyle = isMergerModeEnabled ? activeButtonStyle : narrowButtonStyle;

return (
<React.Fragment>
<Tooltip title="Toggle the Single node Tree (soma clicking) mode">
MichaelBuessemeyer marked this conversation as resolved.
Show resolved Hide resolved
<ButtonComponent
style={newNodeNewTreeModeButtonStyle}
value="active"
onClick={toggleNewNodeNewTreeMode}
>
<img
style={imgStyleForSpaceyIcons}
src="/assets/images/soma-clicking-icon.svg"
alt="Single Node Tree Mode"
/>
</ButtonComponent>
</Tooltip>
<Tooltip title="Toggle Merger Mode">
MichaelBuessemeyer marked this conversation as resolved.
Show resolved Hide resolved
<ButtonComponent style={mergerModeButtonStyle} value="active" onClick={toggleMergerMode}>
<img
style={imgStyleForSpaceyIcons}
src="/assets/images/merger-mode-icon.svg"
alt="Merger Mode"
/>
</ButtonComponent>
</Tooltip>
</React.Fragment>
);
}

const mapId = id => {
const { cube } = Model.getSegmentationLayer();
return cube.mapId(id);
Expand Down Expand Up @@ -207,18 +264,55 @@ function CreateTreeButton() {
return (
<Badge dot style={{ boxShadow: "none", background: rgbColorString }}>
<Tooltip title={`Create a new Tree – ${activeTreeHint}`}>
<ButtonComponent onClick={handleCreateTree} style={{ width: 36, paddingLeft: 10 }}>
<ButtonComponent onClick={handleCreateTree} style={narrowButtonStyle}>
<img
src="/assets/images/new-tree.svg"
alt="New Tree Icon"
style={{ width: 16, height: 16 }}
style={imgStyleForSpaceyIcons}
/>
</ButtonComponent>
</Tooltip>
</Badge>
);
}

function ChangeBrushSizeButton() {
const brushSize = useSelector(state => state.userConfiguration.brushSize);

return (
<Tooltip title="Change the brush size">
<Popover
content={
<div style={{ width: 230 }}>
<div style={{ marginBottom: 8 }}>Set the brush size:</div>
<LogSliderSetting
label=""
roundTo={0}
min={userSettings.brushSize.minimum}
max={userSettings.brushSize.maximum}
step={5}
spans={[0, 14, 10]}
value={brushSize}
onChange={handleUpdateBrushSize}
/>
</div>
}
trigger="click"
placement="bottom"
style={{ cursor: "pointer" }}
>
<ButtonComponent style={{ width: 36, padding: 0 }} value="active">
<img
src="/assets/images/brush-size-icon.svg"
alt="Merger Mode"
style={{ width: 20, height: 20 }}
/>
</ButtonComponent>
</Popover>
</Tooltip>
);
}

export default function ToolbarView() {
const hasVolume = useSelector(state => state.tracing.volume != null);
const hasSkeleton = useSelector(state => state.tracing.skeleton != null);
Expand Down Expand Up @@ -264,8 +358,6 @@ export default function ToolbarView() {
isAltPressed,
);

const brushSize = useSelector(state => state.userConfiguration.brushSize);

const skeletonToolHint =
hasSkeleton && useLegacyBindings
? getSkeletonToolHint(activeTool, isShiftPressed, isControlPressed, isAltPressed)
Expand All @@ -286,6 +378,10 @@ export default function ToolbarView() {
const showCreateTreeButton = hasSkeleton && adaptedActiveTool === AnnotationToolEnum.SKELETON;
const showCreateCellButton =
isVolumeSupported && !showCreateTreeButton && adaptedActiveTool !== AnnotationToolEnum.MOVE;
const showChangeBrushSizeButton =
showCreateCellButton &&
(adaptedActiveTool === AnnotationToolEnum.BRUSH ||
adaptedActiveTool === AnnotationToolEnum.ERASE_BRUSH);

return (
<div
Expand Down Expand Up @@ -452,48 +548,25 @@ export default function ToolbarView() {
) : null}
</Radio.Group>

{showCreateTreeButton ? (
<Space size={0} className="tight-button-group" style={{ marginLeft: 10 }}>
<CreateTreeButton />
<AdditionalSkeletonModesButtons />
</Space>
) : null}

{showCreateCellButton || showChangeBrushSizeButton ? (
<Space size={0} style={{ marginLeft: 12 }} className="tight-button-group">
{showCreateCellButton ? <CreateCellButton /> : null}
{showChangeBrushSizeButton ? <ChangeBrushSizeButton /> : null}
</Space>
) : null}

<OverwriteModeSwitch
isControlPressed={isControlPressed}
isShiftPressed={isShiftPressed}
visible={ToolsWithOverwriteCapabilities.includes(adaptedActiveTool)}
/>

<Space size={0} style={{ marginLeft: 12 }} className="tight-button-group">
{showCreateCellButton ? <CreateCellButton /> : null}
{showCreateTreeButton ? <CreateTreeButton /> : null}
<Tooltip title="Change the brush size">
<Popover
content={
<div style={{ width: 230 }}>
<div style={{ marginBottom: 8 }}>Set the brush size:</div>
<LogSliderSetting
label=""
roundTo={0}
min={userSettings.brushSize.minimum}
max={userSettings.brushSize.maximum}
step={5}
spans={[0, 14, 10]}
value={brushSize}
onChange={handleUpdateBrushSize}
/>
</div>
}
trigger="click"
placement="bottom"
style={{ cursor: "pointer" }}
>
<ButtonComponent style={{ width: 36, padding: 0 }} value="active">
<img
src="/assets/images/brush-size-icon.svg"
alt="Merger Mode"
style={{ width: 20, height: 20 }}
/>
</ButtonComponent>
</Popover>
</Tooltip>
</Space>

{hasSkeleton ? <SkeletonActionsView /> : null}
</div>
);
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// @flow
import { Row, Col, Slider, InputNumber, Switch, Tooltip, Input, Select, Popover } from "antd";
import { DeleteOutlined, DownloadOutlined } from "@ant-design/icons";
import { DeleteOutlined, DownloadOutlined, EditOutlined } from "@ant-design/icons";
import * as React from "react";
import _ from "lodash";

Expand Down Expand Up @@ -276,13 +276,11 @@ export function NumberInputPopoverSetting(props: NumberInputPopoverSettingProps)
</div>
);
return (
<Popover
content={numberInput}
trigger="click"
placement={placement}
style={{ cursor: "pointer" }}
>
{label} {value != null ? value : "-"}
<Popover content={numberInput} trigger="click" placement={placement}>
<span style={{ cursor: "pointer" }}>
{label} {value != null ? value : "-"}
<EditOutlined style={{ fontSize: 11 }} />
</span>
</Popover>
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import FlexLayout, { TabNode, TabSetNode } from "flexlayout-react";
import { connect } from "react-redux";
import type { Dispatch } from "redux";
import Store, { type OxalisState, type BorderOpenStatus } from "oxalis/store";
import { Layout } from "antd";
import { Layout, Tooltip } from "antd";
import _ from "lodash";
import Toast from "libs/toast";
import messages from "messages";
Expand All @@ -17,7 +17,7 @@ import {
} from "oxalis/view/layouting/default_layout_configs";

import Statusbar from "oxalis/view/statusbar";
import { OrthoViews, ArbitraryViews } from "oxalis/constants";
import { OrthoViews, ArbitraryViews, BorderTabs } from "oxalis/constants";
import AbstractTreeTab from "oxalis/view/right-border-tabs/abstract_tree_tab";
import CommentTabView from "oxalis/view/right-border-tabs/comment_tab/comment_tab_view";
import DatasetInfoTabView from "oxalis/view/right-border-tabs/dataset_info_tab_view";
Expand Down Expand Up @@ -250,6 +250,11 @@ class FlexLayoutWrapper extends React.PureComponent<Props, State> {
<FlexLayout.Layout
model={model}
factory={(...args) => this.layoutFactory(...args)}
titleFactory={renderedNode => (
<Tooltip title={BorderTabs[renderedNode.getId()].description}>
MichaelBuessemeyer marked this conversation as resolved.
Show resolved Hide resolved
{renderedNode.getName()}{" "}
</Tooltip>
)}
onModelChange={() => {
// Update / inform parent layout about the changes.
// This will trigger the parents onModelChange and this will then save the model changes.
Expand Down
Loading