summaryrefslogtreecommitdiff
authorllornkcor <llornkcor>2002-02-03 15:33:27 (UTC)
committer llornkcor <llornkcor>2002-02-03 15:33:27 (UTC)
commitb7426bf997b8201667cecb0f66470e257b35ba60 (patch) (side-by-side diff)
tree69ac9d9afd7be78aa7e421e0ee103d4eeec5138f
parenta80b4c11934b93b3d067f812a68452617f202e61 (diff)
downloadopie-b7426bf997b8201667cecb0f66470e257b35ba60.zip
opie-b7426bf997b8201667cecb0f66470e257b35ba60.tar.gz
opie-b7426bf997b8201667cecb0f66470e257b35ba60.tar.bz2
re-introduced vert scrollbar, with position options
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/apps/embeddedkonsole/TEWidget.cpp20
-rw-r--r--core/apps/embeddedkonsole/konsole.cpp31
-rw-r--r--core/apps/embeddedkonsole/konsole.h4
3 files changed, 49 insertions, 6 deletions
diff --git a/core/apps/embeddedkonsole/TEWidget.cpp b/core/apps/embeddedkonsole/TEWidget.cpp
index f10bfb2..a56dc50 100644
--- a/core/apps/embeddedkonsole/TEWidget.cpp
+++ b/core/apps/embeddedkonsole/TEWidget.cpp
@@ -49,8 +49,9 @@
// #include "config.h"
#include "TEWidget.h"
#include "session.h"
+#include <qpe/config.h>
#include <qcursor.h>
#include <qregexp.h>
#include <qpainter.h>
@@ -151,9 +152,9 @@ const QPixmap *TEWidget::backgroundPixmap()
void TEWidget::setColorTable(const ColorEntry table[])
{
for (int i = 0; i < TABLE_COLORS; i++) color_table[i] = table[i];
-
+
const QPixmap* pm = backgroundPixmap();
if (!pm) setBackgroundColor(color_table[DEFAULT_BACK_COLOR].color);
update();
}
@@ -284,9 +285,22 @@ TEWidget::TEWidget(QWidget *parent, const char *name) : QFrame(parent,name)
scrollbar = new QScrollBar(this);
scrollbar->setCursor( arrowCursor );
connect(scrollbar, SIGNAL(valueChanged(int)), this, SLOT(scrollChanged(int)));
- scrollLoc = SCRNONE;
+
+ Config cfg("Konsole");
+ cfg.setGroup("ScrollBar");
+ switch( cfg.readNumEntry("Position",2)){
+ case 0:
+ scrollLoc = SCRNONE;
+ break;
+ case 1:
+ scrollLoc = SCRLEFT;
+ break;
+ case 2:
+ scrollLoc = SCRRIGHT;
+ break;
+ };
blinkT = new QTimer(this);
connect(blinkT, SIGNAL(timeout()), this, SLOT(blinkEvent()));
// blinking = FALSE;
@@ -650,9 +664,9 @@ void TEWidget::mousePressEvent(QMouseEvent* ev)
{
emit clearSelectionSignal();
iPntSel = pntSel = pos;
actSel = 1; // left mouse button pressed but nothing selected yet.
- grabMouse( /*crossCursor*/ ); // handle with care!
+ grabMouse( /*crossCursor*/ ); // handle with care!
}
else
{
emit mouseSignal( 0, pos.x() + 1, pos.y() + 1 ); // left button
diff --git a/core/apps/embeddedkonsole/konsole.cpp b/core/apps/embeddedkonsole/konsole.cpp
index d54fa1f..e2d4886 100644
--- a/core/apps/embeddedkonsole/konsole.cpp
+++ b/core/apps/embeddedkonsole/konsole.cpp
@@ -223,9 +223,10 @@ void Konsole::init(const char* _pgm, QStrList & _args)
fontChanged(cfont);
configMenu = new QPopupMenu( this);
colorMenu = new QPopupMenu( this);
-
+ scrollMenu = new QPopupMenu( this);
+
bool listHidden;
cfg.setGroup("Menubar");
if( cfg.readEntry("Hidden","FALSE") == "TRUE") {
configMenu->insertItem("Show command list");
@@ -262,8 +263,9 @@ void Konsole::init(const char* _pgm, QStrList & _args)
connect( fontList, SIGNAL( activated(int) ), this, SLOT( fontChanged(int) ));
connect( configMenu, SIGNAL( activated(int) ), this, SLOT( configMenuSelected(int) ));
connect( colorMenu, SIGNAL( activated(int) ), this, SLOT( colorMenuSelected(int) ));
+ connect( scrollMenu, SIGNAL(activated(int)),this,SLOT(scrollMenuSelected(int)));
menuBar->insertItem( tr("Font"), fontList );
menuBar->insertItem( tr("Options"), configMenu );
@@ -315,8 +317,13 @@ void Konsole::init(const char* _pgm, QStrList & _args)
}
connect( commonCombo, SIGNAL( activated(int) ), this, SLOT( enterCommand(int) ));
+ scrollMenu->insertItem("None");
+ scrollMenu->insertItem("Left");
+ scrollMenu->insertItem("Right");
+ configMenu->insertItem("ScrollBar",scrollMenu);
+
// create applications /////////////////////////////////////////////////////
setCentralWidget(tab);
// load keymaps ////////////////////////////////////////////////////////////
@@ -762,4 +769,26 @@ void Konsole::setColor()
int scheme = cfg.readNumEntry("Schema",1);
if(scheme != 1) colorMenuSelected( -scheme);
}
+
+void Konsole::scrollMenuSelected(int index)
+{
+ TEWidget* te = getTe();
+Config cfg("Konsole");
+ cfg.setGroup("Scrollbar");
+ switch( index){
+ case -21:
+ te->setScrollbarLocation(0);
+ cfg.writeEntry("Position",0);
+ break;
+ case -22:
+ te->setScrollbarLocation(1);
+ cfg.writeEntry("Position",1);
+ break;
+ case -23:
+ te->setScrollbarLocation(2);
+ cfg.writeEntry("Position",2);
+ break;
+ };
+
+}
diff --git a/core/apps/embeddedkonsole/konsole.h b/core/apps/embeddedkonsole/konsole.h
index 40003d4..b4e5d87 100644
--- a/core/apps/embeddedkonsole/konsole.h
+++ b/core/apps/embeddedkonsole/konsole.h
@@ -69,9 +69,9 @@ private slots:
void hitDown();
void switchSession(QWidget *);
void newSession();
void changeCommand(const QString &, int);
-
+ void scrollMenuSelected(int);
private:
void init(const char* _pgm, QStrList & _args);
void initSession(const char* _pgm, QStrList & _args);
void runSession(TESession* s);
@@ -111,9 +111,9 @@ private:
int cfont;
QCString se_pgm;
QStrList se_args;
- QPopupMenu* fontList,*configMenu,*colorMenu;
+ QPopupMenu* fontList,*configMenu,*colorMenu,*scrollMenu;
QComboBox *commonCombo;
// history scrolling I think
bool b_scroll;