[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-panel-devel
Subject:    [Panel-devel] Plasma::ProgressBar into a boxLayout
From:       "Javier Goday" <jgoday () gmail ! com>
Date:       2007-11-02 16:44:45
Message-ID: aba568fb0711020944v37cb1c3bn897eef5ebaefe3ac () mail ! gmail ! com
[Download RAW message or body]

Hello everybody.
I'm having problems with adding Plasma::ProgressBar's widget into a boxLayout,
i have done a test with Plasma::PushButtons instead of ProgressBars
and everything works rigth, this way:

m_layout = new Plasma::VBoxLayout(this);
setLayout(m_layout);

Plasma::PushButton *button = new Plasma::PushButton("one button", this);
Plasma::PushButton *button2 = new Plasma::PushButton("another button", this);

m_layout->addItem(button);
m_layout->addItem(button2);

but with progressbars doesn't works :(
Plasma::ProgressBar *bar = new Plasma::ProgressBar(this);
m_layout->addItem(bar);

Seems that the problem is with the geometry of the progressbar,
if i change
the paintWidget method in the
kdebase/workspace/libs/plasma/widgets/progressbar class
this line
--> options.rect = option->rect;
instead of this one
--> options.rect = geometry().toRect();
everything goes right, but really don't know if this change has sense

Am i doing something wrong ?
Thanks in advance !

["progressbar.diff" (text/x-diff)]

Index: workspace/libs/plasma/widgets/progressbar.cpp
===================================================================
--- workspace/libs/plasma/widgets/progressbar.cpp	(revisiĆ³n: 732038)
+++ workspace/libs/plasma/widgets/progressbar.cpp	(copia de trabajo)
@@ -203,7 +203,7 @@
     options.text = text();
 
     options.invertedAppearance = d->invertedAppearance;
-    options.rect = geometry().toRect();
+    options.rect = option->rect;
 
     style->drawControl(QStyle::CE_ProgressBar, &options, painter, widget);
 }


_______________________________________________
Panel-devel mailing list
Panel-devel@kde.org
https://mail.kde.org/mailman/listinfo/panel-devel


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic