Kate: use mouse back/forward buttons to move between open documents

The direction of movement can be configured (reversed) through the
settings dialog.

Signed-off-by: Mavridis Philippe <mavridisf@gmail.com>
pull/490/head
Mavridis Philippe 1 month ago
parent e8d015be37
commit a9d34c1436
No known key found for this signature in database
GPG Key ID: F8D2D7E2F989A494

@ -176,6 +176,7 @@ void KateFileList::keyPressEvent(TQKeyEvent *e) {
// returning
void KateFileList::contentsMousePressEvent( TQMouseEvent *e )
{
if (e->button() != TQMouseEvent::LeftButton) return;
m_lastMouseDownPos = e->pos();
if ( ! itemAt( contentsToViewport( e->pos() ) ) )

@ -151,6 +151,8 @@ KateMainWindow::KateMainWindow (TDEConfig *sconfig, const TQString &sgroup)
m_dcop = new KateMainWindowDCOPIface (this);
m_mainWindow->installEventFilter(this);
// setup the most important widgets
setupMainWindow();
@ -213,6 +215,7 @@ void KateMainWindow::setupMainWindow ()
KateMDI::ToolView *ft = createToolView("kate_filelist", KMultiTabBar::Left, SmallIcon("application-vnd.tde.tdemultiple"), i18n("Documents"));
filelist = new KateFileList (this, m_viewManager, ft, "filelist");
filelist->readConfig(KateApp::self()->config(), "Filelist");
filelist->viewport()->installEventFilter(this);
KateMDI::ToolView *t = createToolView("kate_fileselector", KMultiTabBar::Left, SmallIcon("document-open"), i18n("Filesystem Browser"));
fileselector = new KateFileSelector( this, m_viewManager, t, "operator");
@ -888,6 +891,24 @@ void KateMainWindow::readProperties(TDEConfig *config)
config->setGroup(grp);
}
bool KateMainWindow::eventFilter(TQObject *obj, TQEvent *ev)
{
if (ev->type() == TQEvent::MouseButtonRelease)
{
TQMouseEvent *mouseEvent = static_cast<TQMouseEvent *>(ev);
switch (mouseEvent->button())
{
case TQMouseEvent::HistoryBackButton:
filelist->slotPrevDocument();
return true;
case TQMouseEvent::HistoryForwardButton:
filelist->slotNextDocument();
return true;
}
}
return false;
}
//-------------------------------------------
void KateMainWindow::slotSelectionChanged()
{

@ -179,6 +179,7 @@ class KateMainWindow : public KateMDI::MainWindow, virtual public KParts::PartBa
protected:
bool event( TQEvent * );
bool eventFilter(TQObject *obj, TQEvent *ev);
private:
static uint uniqueID;
@ -215,7 +216,7 @@ class KateMainWindow : public KateMDI::MainWindow, virtual public KParts::PartBa
KateExternalToolsMenuAction *externalTools;
GrepTool * greptool;
bool m_modignore, m_grrr;
bool m_modignore;
KateTabWidget *m_tabWidget;
};

Loading…
Cancel
Save