-
Notifications
You must be signed in to change notification settings - Fork 7.6k
[New feature] Add flip-view and close buttons to pane-headers #11749
Conversation
Love it, gave me an idea -> |
@@ -159,17 +159,33 @@ define(function (require, exports, module) { | |||
EventDispatcher = require("utils/EventDispatcher"), | |||
FileSystem = require("filesystem/FileSystem"), | |||
InMemoryFile = require("document/InMemoryFile"), | |||
//WorkingSetView = require("project/WorkingSetView"), |
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.
Forget to remove a line?
@zaggino yeah that is an great idea to me! |
Added an unit test |
The panes now contain a Clicking the |
few comments:
|
Thanks for the comments @zaggino. I'll look into those asap, esp. 4), not sure what's up with that 🔨 It seems that I was putting some behavior for 2) and 3) behind some prefs: |
Ah right, I didn't read the code before testing this so I didn't knew about the various preferences. But show on |
@zaggino You didn't miss anything, the prefs haven't been implemented yet :) |
Ah right, keep the work coming then, it'd be great to see this in 1.6 :) |
Made additions and modifications according to @zaggino 's comments
|
// Define showPaneHeaderButtons, which controls when to show close and flip-view buttons | ||
// on the header. Possible values "hover", "always" and "never" | ||
PreferencesManager.definePreference("pane.showPaneHeaderButtons", "string", "hover", { | ||
description: Strings.DESCRIPTION_SHOW_PANE_HEADER_BUTTONS |
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.
You seems to have forgotten to add "hover" "always" "never"
to values
array here so it can be shown in the hints.
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.
Thanks @sprintr , fixed that.
@petetnt I can't see the close button when i tested this out. Do I need to do something more to enable close butoon? |
@abose good catch, the close button is there but you cannot see it when you are using a |
@abose It's now fixed 🔨 |
@abose fixed that regression (nitpicky CSS inheriting 🚒). |
Thanks for this feature @petetnt . |
Ready to be merged as far as I am concerned unless others have something else to add. |
[New feature] Add flip-view and close buttons to pane-headers
🎆 🎉 👍 |
cool stuff, nice work @petetnt ;) |
@petetnt Congrats on the new feature. |
This new feature improves the Splitscreen UX by adding buttons to panel headers that allow user to quickly flip the current view to another pane. It's not a complete solution, but another alternative to dragging the files over to another panel which can be a bit cumbersome, as evidenced in #11308, #11448, #11345 and others.
When Split View is enabled, arrow buttons are added to the panel that indicate flipping
Clicking such button flips the view to the other panel, revealing the last used file in the pane it was flipped from
If there's no files open in the new other pane, the button obviously isn't there
This of course works in vertical split mode too:
The first commit doesn't include unit tests because Jasmine Spec Runner won't work for whatever reason: while I am looking at that issue, any feedback, improvements or questions are welcome.
edit: Build failed because the API rate limit exceedededit: 2
The panes now contain a
close buttons
too as similar to what @zaggino suggested.Clicking the
x
closes the file, or prompts for confirmation if a file is dirty. If pane contains no files, theclose button
collapses the views by setting the layout scheme to1x1