ecode: Added font and font size terminal config. Added many i18n translate calls. Improved keybindings and commands when using terminal. Some minor bug fixing. Added terminal splitting keybindings.

This commit is contained in:
Martín Lucas Golini
2022-07-09 21:11:00 -03:00
parent 257fe7e11b
commit fc6fdffa48
12 changed files with 848 additions and 523 deletions

View File

@@ -189,7 +189,11 @@ class TerminalDisplay : public ITerminalDisplay {
virtual void onKeyDown( const Keycode& keyCode, const Uint32& chr, const Uint32& mod,
const Scancode& scancode );
Float getFontSize() const;
Font* getFont() const;
void setFont( Font* font );
const Float& getFontSize() const;
void setFontSize( const Float& FontSize );

View File

@@ -43,6 +43,14 @@ class UITerminal : public UIWidget {
KeyBindings& getKeyBindings();
Float getFontSize() const;
void setFontSize( Float fontSize );
Font* getFont() const;
void setFont( Font* font );
void setKeyBindings( const KeyBindings& keyBindings );
void addKeyBindingString( const std::string& shortcut, const std::string& command );
@@ -65,7 +73,9 @@ class UITerminal : public UIWidget {
bool hasCommand( const std::string& command );
static std::string getExclusiveModeToggleCommandName() { return "toggle-exclusive-mode"; }
static std::string getExclusiveModeToggleCommandName() {
return "terminal-toggle-exclusive-mode";
}
bool getExclusiveMode() const;

View File

@@ -1383,7 +1383,18 @@ void TerminalDisplay::onKeyDown( const Keycode& keyCode, const Uint32& /*chr*/,
}
}
Float TerminalDisplay::getFontSize() const {
Font* TerminalDisplay::getFont() const {
return mFont;
}
void TerminalDisplay::setFont( Font* font ) {
if ( mFont != font ) {
mFont = font;
onSizeChange();
}
}
const Float& TerminalDisplay::getFontSize() const {
return mFontSize;
}

View File

@@ -282,7 +282,8 @@ void UITerminal::scheduledUpdate( const Time& ) {
mVScroll->setVisible( !mTerm->getTerminal()->tisaltscr() )
->setEnabled( !mTerm->getTerminal()->tisaltscr() );
} else if ( ScrollBarMode::Auto == mVScrollMode ) {
if ( mViewType == Inclusive && mMouseClock.getElapsedTime() > Seconds( 1 ) )
if ( mViewType == Inclusive && mMouseClock.getElapsedTime() > Seconds( 1 ) &&
!mVScroll->isDragging() )
mVScroll->setVisible( false )->setEnabled( false );
}
}
@@ -303,6 +304,22 @@ KeyBindings& UITerminal::getKeyBindings() {
return mKeyBindings;
}
Float UITerminal::getFontSize() const {
return mTerm->getFontSize();
}
void UITerminal::setFontSize( Float fontSize ) {
mTerm->setFontSize( fontSize );
}
Font* UITerminal::getFont() const {
return mTerm->getFont();
}
void UITerminal::setFont( Font* font ) {
mTerm->setFont( font );
}
void UITerminal::setKeyBindings( const KeyBindings& keyBindings ) {
mKeyBindings = keyBindings;
}