-
-
Notifications
You must be signed in to change notification settings - Fork 919
Make new document with doubleclicking on empty tab space #3228
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
base: master
Are you sure you want to change the base?
Conversation
Is the issue you have linked correct? |
i have fixed it now ,sorry |
|
||
<LayoutCol on:pointerdown={() => panelType && editor.handle.setActivePanel(panelType)} class={`panel ${className}`.trim()} {classes} style={styleName} {styles}> | ||
<LayoutRow class="tab-bar" classes={{ "min-widths": tabMinWidths }}> | ||
<LayoutRow class="tab-bar" classes={{ "min-widths": tabMinWidths }} on:dblclick={() => editor.handle.newDocumentDialog()}> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you add the click handler to a new element that fills the portion of the bar not occupied by tabs, you won’t need to stop event propagation. I think it feels a little cleaner.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you explain a little more?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think its about making 2 new LayoutCol. Left one should have contain existing document tab and the right one could have on:dblclick=()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you explain a little more?
I mean add a extra child to the tab bar at the end that takes all remaining space.
That child would have the dblclick listener.
Take a look at how I did it in a similar case
<LayoutRow on:mousedown={() => editor.handle.appWindowDrag()} on:dblclick={() => editor.handle.appWindowMaximize()} /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh okay lemme do it like that
@timon-schelling can you please take a look at it? |
let document = snap_data.document; | ||
let next_handle_start = self.next_handle_start; | ||
let handle_start = self.latest_point()?.handle_start; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please don't include formatting changes etc. completely outside of the PR scope.
You probably included this by accident, would be helpful if you could double check what you are committing in the future.
No worries, just a heads-up.
{/if} | ||
</LayoutRow> | ||
{/each} | ||
{#if panelType == 'Document'} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Panel is a component used in different contexts... You could instead create a prop for dblclickEmptySpaceAction
(I'm tired, could not think of a better name) and use that prop here
clickAction={(tabIndex) => editor.handle.selectDocument($portfolio.documents[tabIndex].id)} |
clickAction
This is issue number #3215
Make new document with double clicking on empty tab space
Allowing user to create a new file by double clicking on the empty tab space
Recording.2025-09-26.202723.1.mp4
Closes #3215