[Konsole-devel] [Bug 80725] wish: colour in tabbar text
Kurt V.Hindenburg
kurt.hindenburg at kdemail.net
Sun May 15 22:35:18 UTC 2005
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
http://bugs.kde.org/show_bug.cgi?id=80725
------- Additional Comments From kurt.hindenburg kdemail net 2005-05-16 00:35 -------
SVN commit 414407 by hindenburg:
Add ESC code to change tab text color. Since t has to do with window
manipulation (according to xterm control seq), I decided to use it with
28. This doesn't do anything according to the specs as far as I can tell.
change tab text color : \e[28;<color>t color: 0-16,777,215
CCBUG: 80725
M +3 -0 trunk/KDE/kdebase/konsole/konsole/TEmuVt102.cpp
M +1 -0 trunk/KDE/kdebase/konsole/konsole/TEmulation.h
M +17 -0 trunk/KDE/kdebase/konsole/konsole/konsole.cpp
M +1 -0 trunk/KDE/kdebase/konsole/konsole/konsole.h
--- trunk/KDE/kdebase/konsole/konsole/TEmuVt102.cpp #414406:414407
@ -511,6 +511,9 @
// resize = \e[8;<row>;<col>t
case TY_CSI_PS('t', 8) : changeColLin( q /* col */, p /* lin */ ); break;
+// change tab text color : \e[28;<color>t color: 0-16,777,215
+ case TY_CSI_PS('t', 28) : emit changeTabTextColor ( p ); break;
+
case TY_CSI_PS('K', 0) : scr->clearToEndOfLine ( ); break;
case TY_CSI_PS('K', 1) : scr->clearToBeginOfLine ( ); break;
case TY_CSI_PS('K', 2) : scr->clearEntireLine ( ); break;
--- trunk/KDE/kdebase/konsole/konsole/TEmulation.h #414406:414407
@ -72,6 +72,7 @
void changeTitle(int arg, const char* str);
void notifySessionState(int state);
void zmodemDetected();
+ void changeTabTextColor(int color);
public:
--- trunk/KDE/kdebase/konsole/konsole/konsole.cpp #414406:414407
@ -1984,6 +1984,18 @
}
// Called from emulation
+void Konsole::changeTabTextColor( int rgb )
+{
+ QColor color;
+ color.setRgb( rgb );
+ if ( !color.isValid() ) {
+ kdWarning()<<" Invalid RGB color "<<rgb<<endl;
+ return;
+ }
+ tabwidget->setTabColor( se->widget(), color );
+}
+
+// Called from emulation
void Konsole::changeColLin(int columns, int lines)
{
if (b_allowResize && !b_fixedSize) {
@ -2685,6 +2697,8 @
this, SLOT(slotGetSessionSchema(TESession*, QString &)));
connect( s, SIGNAL(setSessionSchema(TESession*, const QString &)),
this, SLOT(slotSetSessionSchema(TESession*, const QString &)));
+ connect( s->getEmulation(),SIGNAL(changeTabTextColor(int)),
+ this,SLOT(changeTabTextColor(int)) );
s->widget()->setVTFont(defaultFont);// Hack to set font again after newSession
s->setSchemaNo(schmno);
@ -3387,6 +3401,7 @
disconnect( _se->getEmulation(),SIGNAL(ImageSizeChanged(int,int)), this,SLOT(notifySize(int,int)));
disconnect( _se->getEmulation(),SIGNAL(changeColLin(int, int)), this,SLOT(changeColLin(int,int)) );
disconnect( _se->getEmulation(),SIGNAL(changeColumns(int)), this,SLOT(changeColumns(int)) );
+ disconnect( _se->getEmulation(),SIGNAL(changeTabTextColor(int)), this,SLOT(changeTabTextColor(int)) );
disconnect( _se,SIGNAL(updateTitle()), this,SLOT(updateTitle()) );
disconnect( _se,SIGNAL(notifySessionState(TESession*,int)), this,SLOT(notifySessionState(TESession*,int)) );
@ -3486,6 +3501,8 @
connect( session->getEmulation(),SIGNAL(changeColumns(int)), this,SLOT(changeColumns(int)) );
connect( session->getEmulation(),SIGNAL(changeColLin(int, int)), this,SLOT(changeColLin(int,int)) );
+ connect( session->getEmulation(),SIGNAL(changeTabTextColor(int)), this,SLOT(changeTabTextColor(int)) );
+
activateSession(session);
}
--- trunk/KDE/kdebase/konsole/konsole/konsole.h #414406:414407
@ -156,6 +156,7 @
void updateKeytabMenu();
void updateRMBMenu();
+ void changeTabTextColor(int);
void changeColumns(int);
void changeColLin(int columns, int lines);
void notifySessionState(TESession* session,int state);
More information about the konsole-devel
mailing list