mirror of
https://github.com/SpartanJ/eepp.git
synced 2026-08-18 06:55:48 +03:00
Allow to split editors views by dragging tabs into the tab widget corners.
This commit is contained in:
@@ -651,8 +651,7 @@ void AppConfig::loadDocuments( UICodeEditorSplitter* editorSplitter, json j,
|
||||
}
|
||||
} else if ( j["type"] == "splitter" ) {
|
||||
UISplitter* splitter = editorSplitter->split(
|
||||
j["orientation"] == "horizontal" ? UICodeEditorSplitter::SplitDirection::Right
|
||||
: UICodeEditorSplitter::SplitDirection::Bottom,
|
||||
j["orientation"] == "horizontal" ? SplitDirection::Right : SplitDirection::Bottom,
|
||||
curTabWidget->getTabSelected()->getOwnedWidget()->asType<UICodeEditor>(), false );
|
||||
|
||||
if ( nullptr == splitter )
|
||||
|
||||
@@ -201,26 +201,22 @@ class App : public UICodeEditorSplitter::Client {
|
||||
[this] { mTerminalManager->createTerminalInSplitter(); } );
|
||||
t.setCommand( "terminal-split-right", [this] {
|
||||
auto cwd = getCurrentWorkingDir();
|
||||
mSplitter->split( UICodeEditorSplitter::SplitDirection::Right,
|
||||
mSplitter->getCurWidget(), false );
|
||||
mSplitter->split( SplitDirection::Right, mSplitter->getCurWidget(), false );
|
||||
mTerminalManager->createNewTerminal( "", nullptr, cwd );
|
||||
} );
|
||||
t.setCommand( "terminal-split-bottom", [this] {
|
||||
auto cwd = getCurrentWorkingDir();
|
||||
mSplitter->split( UICodeEditorSplitter::SplitDirection::Bottom,
|
||||
mSplitter->getCurWidget(), false );
|
||||
mSplitter->split( SplitDirection::Bottom, mSplitter->getCurWidget(), false );
|
||||
mTerminalManager->createNewTerminal( "", nullptr, cwd );
|
||||
} );
|
||||
t.setCommand( "terminal-split-left", [this] {
|
||||
auto cwd = getCurrentWorkingDir();
|
||||
mSplitter->split( UICodeEditorSplitter::SplitDirection::Left, mSplitter->getCurWidget(),
|
||||
false );
|
||||
mSplitter->split( SplitDirection::Left, mSplitter->getCurWidget(), false );
|
||||
mTerminalManager->createNewTerminal( "", nullptr, cwd );
|
||||
} );
|
||||
t.setCommand( "terminal-split-top", [this] {
|
||||
auto cwd = getCurrentWorkingDir();
|
||||
mSplitter->split( UICodeEditorSplitter::SplitDirection::Top, mSplitter->getCurWidget(),
|
||||
false );
|
||||
mSplitter->split( SplitDirection::Top, mSplitter->getCurWidget(), false );
|
||||
mTerminalManager->createNewTerminal( "", nullptr, cwd );
|
||||
} );
|
||||
t.setCommand( "reopen-closed-tab", [this] { reopenClosedTab(); } );
|
||||
|
||||
@@ -42,15 +42,13 @@ UITerminal* TerminalManager::createTerminalInSplitter( const std::string& workin
|
||||
switch ( config.term.newTerminalOrientation ) {
|
||||
case NewTerminalOrientation::Vertical: {
|
||||
auto cwd = workingDir.empty() ? mApp->getCurrentWorkingDir() : workingDir;
|
||||
splitter->split( UICodeEditorSplitter::SplitDirection::Right,
|
||||
splitter->getCurWidget(), false );
|
||||
splitter->split( SplitDirection::Right, splitter->getCurWidget(), false );
|
||||
term = createNewTerminal( "", nullptr, cwd, "", {}, fallback );
|
||||
break;
|
||||
}
|
||||
case NewTerminalOrientation::Horizontal: {
|
||||
auto cwd = workingDir.empty() ? mApp->getCurrentWorkingDir() : workingDir;
|
||||
splitter->split( UICodeEditorSplitter::SplitDirection::Bottom,
|
||||
splitter->getCurWidget(), false );
|
||||
splitter->split( SplitDirection::Bottom, splitter->getCurWidget(), false );
|
||||
term = createNewTerminal( "", nullptr, cwd, "", {}, fallback );
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user