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
@@ -51,4 +51,5 @@
#include "TEWidget.h"
#include "session.h"
+#include <qpe/config.h>
#include <qcursor.h>
@@ -153,5 +154,5 @@ 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);
@@ -286,5 +287,18 @@ TEWidget::TEWidget(QWidget *parent, const char *name) : QFrame(parent,name)
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);
@@ -652,5 +666,5 @@ void TEWidget::mousePressEvent(QMouseEvent* ev)
iPntSel = pntSel = pos;
actSel = 1; // left mouse button pressed but nothing selected yet.
- grabMouse( /*crossCursor*/ ); // handle with care!
+ grabMouse( /*crossCursor*/ ); // handle with care!
}
else
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
@@ -225,5 +225,6 @@ void Konsole::init(const char* _pgm, QStrList & _args)
configMenu = new QPopupMenu( this);
colorMenu = new QPopupMenu( this);
-
+ scrollMenu = new QPopupMenu( this);
+
bool listHidden;
cfg.setGroup("Menubar");
@@ -264,4 +265,5 @@ void Konsole::init(const char* _pgm, QStrList & _args)
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 );
@@ -317,4 +319,9 @@ 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);
@@ -764,2 +771,24 @@ void Konsole::setColor()
}
+
+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
@@ -71,5 +71,5 @@ private slots:
void newSession();
void changeCommand(const QString &, int);
-
+ void scrollMenuSelected(int);
private:
void init(const char* _pgm, QStrList & _args);
@@ -113,5 +113,5 @@ private:
QStrList se_args;
- QPopupMenu* fontList,*configMenu,*colorMenu;
+ QPopupMenu* fontList,*configMenu,*colorMenu,*scrollMenu;
QComboBox *commonCombo;
// history scrolling I think