Skip to content

Commit 3802f86

Browse files
committed
fixed lined breaks in segments list
1 parent b4f4a06 commit 3802f86

File tree

4 files changed

+48
-50
lines changed

4 files changed

+48
-50
lines changed

CHANGELOG.unreleased.md

+1
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ For upgrade instructions, please check the [migration guide](MIGRATIONS.released
4141
- Fixed a bug where zarr-streamed datasets would produce (very rare) rendering errors. [#6782](https://github.com/scalableminds/webknossos/pull/6782)
4242
- Fixed a bug where publicly shared annotations were not viewable by users without an account. [#6784](https://github.com/scalableminds/webknossos/pull/6784)
4343
- Fixed that the proofreading tool allowed to split/merge with segment 0 which led to an inconsistent state. [#6793](https://github.com/scalableminds/webknossos/pull/6793)
44+
- Fixed some layouting issues with line breaks in segment list/dataset info tab [#6799](https://github.com/scalableminds/webknossos/pull/6799)
4445

4546
### Removed
4647

frontend/javascripts/components/text_with_description.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ type EditableProps = EditableTextLabelProp & {
1010
description: string;
1111
};
1212
type NonEditableProps = {
13-
markdown?: boolean
13+
markdown?: boolean;
1414
isEditable: false;
1515
description: string;
1616
value: string;

frontend/javascripts/oxalis/view/components/editable_text_label.tsx

+2-4
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,6 @@ class EditableTextLabel extends React.PureComponent<EditableTextLabelProp, State
112112
render() {
113113
const iconStyle = {
114114
cursor: "pointer",
115-
marginTop: 5
116115
};
117116
const margin = this.props.margin != null ? this.props.margin : "0 10px";
118117
const inputComponentProps: InputProps = {
@@ -125,14 +124,12 @@ class EditableTextLabel extends React.PureComponent<EditableTextLabelProp, State
125124
},
126125
size: "small",
127126
autoFocus: true,
128-
// @ts-ignore
129-
rows: this.props.rows,
130127
};
131128
const isInvalidStyleMaybe = this.props.isInvalid ? { color: "var(--ant-error)" } : {};
132129

133130
if (this.state.isEditing) {
134131
return (
135-
<span style={{ display: "inline-flex" }}>
132+
<span style={{ display: "inline-flex", alignItems: "center" }}>
136133
{this.props.rows === 1 ? (
137134
<React.Fragment>
138135
<Input {...inputComponentProps} onBlur={() => this.handleOnChange} />
@@ -163,6 +160,7 @@ class EditableTextLabel extends React.PureComponent<EditableTextLabelProp, State
163160
style={{
164161
margin,
165162
display: "inline-flex",
163+
alignItems: "center",
166164
}}
167165
className={this.props.onClick != null ? "clickable-text" : undefined}
168166
onClick={this.props.onClick}

frontend/javascripts/oxalis/view/right-border-tabs/segments_tab/segment_list_item.tsx

+44-45
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ function ColoredDotIconForSegment({ segmentColorHSLA }: { segmentColorHSLA: Vect
4040
style={{
4141
paddingLeft: "10px",
4242
backgroundColor: hslaCss,
43-
marginTop: 5,
4443
}}
4544
/>
4645
);
@@ -471,53 +470,53 @@ function _SegmentListItem({
471470
trigger={["contextMenu"]}
472471
>
473472
<Tooltip title={getSegmentTooltip(segment)}>
474-
<div style={{display: "inline-flex"}}>
475-
<ColoredDotIconForSegment segmentColorHSLA={segmentColorHSLA} />
476-
<EditableTextLabel
477-
value={segment.name || `Segment ${segment.id}`}
478-
label="Segment Name"
479-
onClick={() => onSelectSegment(segment)}
480-
onChange={(name) => {
481-
if (visibleSegmentationLayer != null) {
482-
updateSegment(
483-
segment.id,
484-
{
485-
name,
486-
},
487-
visibleSegmentationLayer.name,
488-
);
489-
}
490-
}}
491-
margin="0 5px"
492-
disableEditing={!allowUpdate}
493-
/>
494-
<Tooltip title="Open context menu (also available via right-click)">
495-
<EllipsisOutlined
496-
onClick={() => handleSegmentDropdownMenuVisibility(segment.id, true)}
473+
<div style={{ display: "inline-flex", alignItems: "center" }}>
474+
<ColoredDotIconForSegment segmentColorHSLA={segmentColorHSLA} />
475+
<EditableTextLabel
476+
value={segment.name || `Segment ${segment.id}`}
477+
label="Segment Name"
478+
onClick={() => onSelectSegment(segment)}
479+
onChange={(name) => {
480+
if (visibleSegmentationLayer != null) {
481+
updateSegment(
482+
segment.id,
483+
{
484+
name,
485+
},
486+
visibleSegmentationLayer.name,
487+
);
488+
}
489+
}}
490+
margin="0 5px"
491+
disableEditing={!allowUpdate}
497492
/>
498-
</Tooltip>
499-
{/* Show Default Segment Name if another one is already defined*/}
500-
{getSegmentIdDetails()}
501-
{segment.id === centeredSegmentId ? (
502-
<Tooltip title="This segment is currently centered in the data viewports.">
503-
<i
504-
className="fas fa-crosshairs deemphasized-segment-name"
505-
style={{
506-
marginLeft: 4,
507-
}}
508-
/>
509-
</Tooltip>
510-
) : null}
511-
{segment.id === activeCellId ? (
512-
<Tooltip title="The currently active segment id belongs to this segment.">
513-
<i
514-
className="fas fa-paint-brush deemphasized-segment-name"
515-
style={{
516-
marginLeft: 4,
517-
}}
493+
<Tooltip title="Open context menu (also available via right-click)">
494+
<EllipsisOutlined
495+
onClick={() => handleSegmentDropdownMenuVisibility(segment.id, true)}
518496
/>
519497
</Tooltip>
520-
) : null}
498+
{/* Show Default Segment Name if another one is already defined*/}
499+
{getSegmentIdDetails()}
500+
{segment.id === centeredSegmentId ? (
501+
<Tooltip title="This segment is currently centered in the data viewports.">
502+
<i
503+
className="fas fa-crosshairs deemphasized-segment-name"
504+
style={{
505+
marginLeft: 4,
506+
}}
507+
/>
508+
</Tooltip>
509+
) : null}
510+
{segment.id === activeCellId ? (
511+
<Tooltip title="The currently active segment id belongs to this segment.">
512+
<i
513+
className="fas fa-paint-brush deemphasized-segment-name"
514+
style={{
515+
marginLeft: 4,
516+
}}
517+
/>
518+
</Tooltip>
519+
) : null}
521520
</div>
522521
</Tooltip>
523522
</Dropdown>

0 commit comments

Comments
 (0)