Bug 81278 - Certain tab panes do no respect KDE color scheme
Summary: Certain tab panes do no respect KDE color scheme
Status: RESOLVED FIXED
Alias: None
Product: kdevelop
Classification: Applications
Component: Output Views (show other bugs)
Version: 3.0.3
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: kdevelop-bugs-null
URL:
Keywords:
: 78929 (view as bug list)
Depends on:
Blocks:
 
Reported: 2004-05-10 20:55 UTC by Nick Savoiu
Modified: 2006-12-21 01:49 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Snapshot of stack frames with background color problem (12.83 KB, image/png)
2006-12-20 19:13 UTC, Nick Savoiu
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Nick Savoiu 2004-05-10 20:55:01 UTC
Version:           3.0.3 (using KDE KDE 3.2.2)
Installed from:    Compiled From Sources
Compiler:          gcc3.2 
OS:          Linux

Please refer to: http://www.ics.uci.edu/~savoiu/kdevelop.png

I use a rather 'odd' color scheme. This has the unfortunate effect of rendering the output for the 'Application' tab rather hard to read since only the window background seems to respect the selected KDE color scheme. Similarly for the 'Grep' tab.

Ideally tabs should either respect the KDE color scheme or alter both foreground/background colors.
Comment 1 Jens Dagerbo 2004-07-17 01:28:35 UTC
*** Bug 78929 has been marked as a duplicate of this bug. ***
Comment 2 Matt Rogers 2004-12-12 05:58:34 UTC
when i change the color scheme here, the window background isn't even respected. I get white on black as if i was using the kde default color scheme. Ideally, all the color settings should be respected.
Comment 3 Nick Savoiu 2006-06-28 22:32:08 UTC
KDevelop 3.3.91 also has this problem in the Frame Stack (but only for the function names column not frame numbers one).
Comment 4 Jens Dagerbo 2006-12-16 20:17:10 UTC
Fixed recently by Matthew Woelke
Comment 5 Nick Savoiu 2006-12-20 19:12:49 UTC
The issue in comment #3 still exists. See attachment.
Comment 6 Nick Savoiu 2006-12-20 19:13:47 UTC
Created attachment 18991 [details]
Snapshot of stack frames with background color problem
Comment 7 Andreas Pakulat 2006-12-21 01:49:27 UTC
SVN commit 615311 by apaku:

Don't use hardcoded colors, this messes up KDE styling.

Volodya: If you think you really need 2 colors in the listview, lets discuss
this on the list and see what color role may fit the purpose.

BUG: 81278
CCMAIL: kdevelop-devel@kdevelop.org


 M  +29 -66    framestackwidget.cpp  
 M  +7 -16     framestackwidget.h  


--- branches/kdevelop/3.4/languages/cpp/debugger/framestackwidget.cpp #615310:615311
@@ -38,7 +38,7 @@
 {
 
 FramestackWidget::FramestackWidget(GDBController* controller,
-                                   QWidget *parent, 
+                                   QWidget *parent,
                                    const char *name, WFlags f)
         : QListView(parent, name, f),
           viewedThread_(0),
@@ -129,7 +129,7 @@
 {
     switch(e)
     {
-        case GDBController::program_state_changed: 
+        case GDBController::program_state_changed:
 
             kdDebug(9012) << "Clearning framestack\n";
             clear();
@@ -139,17 +139,17 @@
                                this, &FramestackWidget::handleThreadList));
 
             break;
-            
 
-         case GDBController::thread_or_frame_changed: 
 
+         case GDBController::thread_or_frame_changed:
+
              if (viewedThread_)
              {
                  // For non-threaded programs frame switch is no-op
                  // as far as framestack is concerned.
                  // FIXME: but need to highlight the current frame.
-                 
-                 if (ThreadStackItem* item 
+
+                 if (ThreadStackItem* item
                      = findThread(controller_->currentThread()))
                  {
                      viewedThread_ = item;
@@ -164,12 +164,12 @@
 
             break;
 
-        case GDBController::program_exited: 
-        case GDBController::debugger_exited: 
+        case GDBController::program_exited:
+        case GDBController::debugger_exited:
         {
             clear();
             break;
-        }        
+        }
         case GDBController::debugger_busy:
         case GDBController::debugger_ready:
         case GDBController::shared_library_loaded:
@@ -186,8 +186,8 @@
 
     controller_->addCommand(
         new GDBCommand(QString("-stack-info-depth %1").arg(max_frame+1),
-                       this, 
-                       &FramestackWidget::handleStackDepth));        
+                       this,
+                       &FramestackWidget::handleStackDepth));
 }
 
 void FramestackWidget::handleStackDepth(const GDBMI::ResultRecord& r)
@@ -202,7 +202,7 @@
     controller_->addCommandToFront(
         new GDBCommand(QString("-stack-list-frames %1 %2")
                        .arg(minFrame_).arg(maxFrame_),
-                       this, &FramestackWidget::parseGDBBacktraceList));    
+                       this, &FramestackWidget::parseGDBBacktraceList));
 }
 
 void FramestackWidget::getBacktraceForThread(int threadNo)
@@ -217,7 +217,7 @@
 
         viewedThread_ = findThread(threadNo);
     }
-    
+
     getBacktrace();
 
     if (viewedThread_)
@@ -231,11 +231,11 @@
 
 void FramestackWidget::handleThreadList(const GDBMI::ResultRecord& r)
 {
-    // Gdb reply is: 
+    // Gdb reply is:
     //  ^done,thread-ids={thread-id="3",thread-id="2",thread-id="1"},
     // which syntactically is a tuple, but one has to access it
     // by index anyway.
-    const GDBMI::TupleValue& ids = 
+    const GDBMI::TupleValue& ids =
         dynamic_cast<const GDBMI::TupleValue&>(r["thread-ids"]);
 
     if (ids.results.size() > 1)
@@ -244,14 +244,14 @@
         // Note that this sequence of command will be executed in strict
         // sequences, so no other view can add its command in between and
         // get state for a wrong thread.
-                        
+
         // Really threaded program.
         for(unsigned i = 0, e = ids.results.size(); i != e; ++i)
         {
             QString id = ids.results[i]->value->literal();
 
             controller_->addCommand(
-                new GDBCommand(QString("-thread-select %1").arg(id).ascii(), 
+                new GDBCommand(QString("-thread-select %1").arg(id).ascii(),
                                this, &FramestackWidget::handleThread));
         }
 
@@ -261,7 +261,7 @@
     }
 
     // Get backtrace for the current thread. We need to do this
-    // here, and not in event handler for program_state_changed, 
+    // here, and not in event handler for program_state_changed,
     // viewedThread_ is initialized by 'handleThread' before
     // backtrace handler is called.
     getBacktrace();
@@ -276,7 +276,7 @@
     QString func_column;
     QString args_column;
     QString source_column;
-    
+
     formatFrame(r["frame"], func_column, source_column);
 
     ThreadStackItem* thread = new ThreadStackItem(this, id_num);
@@ -298,7 +298,7 @@
     if (!r.hasField("stack"))
         return;
 
-    const GDBMI::Value& frames = r["stack"];    
+    const GDBMI::Value& frames = r["stack"];
 
     if (frames.empty())
         return;
@@ -306,7 +306,7 @@
     Q_ASSERT(dynamic_cast<const GDBMI::ListValue*>(&frames));
 
     // Remove "..." item, if there's one.
-    QListViewItem* last;    
+    QListViewItem* last;
     if (viewedThread_)
     {
         last = viewedThread_->firstChild();
@@ -314,7 +314,7 @@
             while(last->nextSibling())
                 last = last->nextSibling();
     }
-    else 
+    else
     {
         last = lastItem();
     }
@@ -325,7 +325,7 @@
     for(unsigned i = 0, e = frames.size(); i != e; ++i)
     {
         const GDBMI::Value& frame = frames[i];
-      
+
         // For now, just produce string simular to gdb
         // console output. In future we might have a table,
         // or something better.
@@ -341,7 +341,7 @@
         name_column = "#" + level_s;
 
         formatFrame(frame, func_column, source_column);
-        
+
         FrameStackItem* item;
         if (viewedThread_)
             item = new FrameStackItem(viewedThread_, level, name_column);
@@ -350,7 +350,7 @@
         lastLevel = level;
 
         item->setText(1, func_column);
-        item->setText(2, source_column);        
+        item->setText(2, source_column);
     }
     if (has_more_frames)
     {
@@ -452,25 +452,11 @@
     }
 }
 
-
-void FramestackWidget::drawContentsOffset( QPainter * p, int ox, int oy,
-                                           int cx, int cy, int cw, int ch )
-{
-    QListView::drawContentsOffset(p, ox, oy, cx, cy, cw, ch);
-
-    int s1_x = header()->sectionPos(1);
-    int s1_w = header()->sectionSize(1);
-
-    QRect section1(s1_x, contentsHeight(), s1_w, viewport()->height());
-
-    p->fillRect(section1, QColor("#e4f4fe"));
-}
-
 // **************************************************************************
 // **************************************************************************
 // **************************************************************************
 
-FrameStackItem::FrameStackItem(FramestackWidget *parent, 
+FrameStackItem::FrameStackItem(FramestackWidget *parent,
                                unsigned frameNo,
                                const QString &name)
         : QListViewItem(parent, parent->lastChild()),
@@ -482,7 +468,7 @@
 
 // **************************************************************************
 
-FrameStackItem::FrameStackItem(ThreadStackItem *parent, 
+FrameStackItem::FrameStackItem(ThreadStackItem *parent,
                                unsigned frameNo,
                                const QString &name)
         : QListViewItem(parent, parent->lastChild()),
@@ -512,7 +498,7 @@
 // **************************************************************************
 
 void FrameStackItem::setOpen(bool open)
-{    
+{
 #if 0
     if (open)
     {
@@ -569,7 +555,7 @@
 
         // Imagine you have 20 frames and you want to find one blocked on
         // mutex. You don't want a new source file to be opened for each
-        // thread you open to find if that's the one you want to debug.        
+        // thread you open to find if that's the one you want to debug.
         ((FramestackWidget*)listView())->getBacktraceForThread(threadNo());
     }
 
@@ -589,31 +575,8 @@
     QListViewItem::setOpen(open);
 }
 
-void FrameStackItem::paintCell(QPainter * p, const QColorGroup & cg, 
-                               int column, int width, int align )
-{
-    QColorGroup cg2(cg);
-    if (column % 2)
-    {
-        cg2.setColor(QColorGroup::Base, QColor("#e4f4fe"));
-    }
-    QListViewItem::paintCell(p, cg2, column, width, align);
 }
 
-void ThreadStackItem::paintCell(QPainter * p, const QColorGroup & cg, 
-                               int column, int width, int align )
-{
-    QColorGroup cg2(cg);
-    if (column % 2)
-    {
-        cg2.setColor(QColorGroup::Base, QColor("#e4f4fe"));
-    }
-    QListViewItem::paintCell(p, cg2, column, width, align);
-}
-
-
-}
-
 /***************************************************************************/
 /***************************************************************************/
 /***************************************************************************/
--- branches/kdevelop/3.4/languages/cpp/debugger/framestackwidget.h #615310:615311
@@ -33,15 +33,13 @@
 class ThreadStackItem : public QListViewItem
 {
 public:
-    ThreadStackItem(FramestackWidget *parent, 
+    ThreadStackItem(FramestackWidget *parent,
                     unsigned threadNo);
     virtual ~ThreadStackItem();
 
     void setOpen(bool open);
     QListViewItem *lastChild() const;
 
-    void paintCell(QPainter * p, const QColorGroup & cg, 
-                   int column, int width, int align );
 
     int threadNo()
     { return threadNo_; }
@@ -59,10 +57,10 @@
 class FrameStackItem : public QListViewItem
 {
 public:
-    FrameStackItem(FramestackWidget *parent, 
+    FrameStackItem(FramestackWidget *parent,
                    unsigned frameNo,
                    const QString &name);
-    FrameStackItem(ThreadStackItem *parent, 
+    FrameStackItem(ThreadStackItem *parent,
                    unsigned frameNo,
                    const QString &name);
     virtual ~FrameStackItem();
@@ -70,8 +68,6 @@
     void setOpen(bool open);
     QListViewItem *lastChild() const;
 
-    void paintCell(QPainter * p, const QColorGroup & cg, 
-                   int column, int width, int align );
 
     int frameNo()
     { return frameNo_; }
@@ -95,25 +91,20 @@
 
 public:
     FramestackWidget( GDBController* controller,
-                      QWidget *parent=0,                       
+                      QWidget *parent=0,
                       const char *name=0, WFlags f=0 );
     virtual ~FramestackWidget();
 
     QListViewItem *lastChild() const;
-   
+
     ThreadStackItem *findThread(int threadNo);
     FrameStackItem *findFrame(int frameNo, int threadNo);
 
     int viewedThread()
     { return viewedThread_ ? viewedThread_->threadNo() : -1; }
 
-protected:
 
-    void drawContentsOffset( QPainter * p, int ox, int oy,
-                             int cx, int cy, int cw, int ch );
 
-
-
 private:
     /** Given gdb's 'frame' information, compute decent
         textual representation for display.
@@ -124,7 +115,7 @@
                      QString& func_column,
                      QString& source_column);
 
-    /** Cause gdb to produce backtrace for the current thread. 
+    /** Cause gdb to produce backtrace for the current thread.
 
         GDB reply will be route to parseArg and parseGDBBacktraceList,
         and will show up under viewedThread_ (if there are threads), or
@@ -137,7 +128,7 @@
 
         Switches viewedThread_ to the specified thread, switches gdb thread,
         call getBacktrace(), and switches the current thread back.
-    */        
+    */
     void getBacktraceForThread(int threadNo);
     friend class ThreadStackItem;