You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
tde-packaging/opensuse/tdebase/3_5_BRANCH.diff

1177 lines
36 KiB

package: kdebase-3.5.10.tar.bz2
kdemod: kdebase
Index: BRANCH_STATUS
===================================================================
--- /dev/null
+++ BRANCH_STATUS
@@ -0,0 +1,2 @@
+current HEAD: 865247
+svn di between //tags/KDE/3.5.10/kdebase and //branches/KDE/3.5/kdebase
Index: kcontrol/background/bgrender.cpp
===================================================================
--- kcontrol/background/bgrender.cpp.orig
+++ kcontrol/background/bgrender.cpp
@@ -1163,9 +1163,8 @@ void KVirtualBGRenderer::desktopResized(
m_pPixmap = new QPixmap(m_size);
m_pPixmap->fill(Qt::black);
}
-
- for (unsigned i=0; i<m_numRenderers; ++i)
- m_renderer[i]->desktopResized();
+
+ initRenderers();
}
Index: kcontrol/info/opengl.cpp
===================================================================
--- kcontrol/info/opengl.cpp.orig
+++ kcontrol/info/opengl.cpp
@@ -608,7 +608,6 @@ static QListViewItem *get_gl_info(Displa
}
else {
kdDebug() << "Error: glXMakeCurrent failed\n";
- glXDestroyContext(dpy, ctx);
}
glXDestroyContext(dpy, ctx);
Index: kicker/taskbar/taskbar.cpp
===================================================================
--- kicker/taskbar/taskbar.cpp.orig
+++ kicker/taskbar/taskbar.cpp
@@ -61,8 +61,6 @@ TaskBar::TaskBar( QWidget *parent, const
m_textShadowEngine(0),
m_ignoreUpdates(false)
{
- setFrameStyle( NoFrame );
-
arrowType = LeftArrow;
blocklayout = true;
@@ -81,6 +79,8 @@ TaskBar::TaskBar( QWidget *parent, const
connect(&m_relayoutTimer, SIGNAL(timeout()),
this, SLOT(reLayout()));
+ connect(this, SIGNAL(contentsMoving(int, int)), SLOT(setBackground()));
+
// connect manager
connect(TaskManager::the(), SIGNAL(taskAdded(Task::Ptr)),
this, SLOT(add(Task::Ptr)));
@@ -647,7 +647,7 @@ void TaskBar::reLayoutEventually()
if (!blocklayout && !m_ignoreUpdates)
{
- m_relayoutTimer.start(100, true);
+ m_relayoutTimer.start(25, true);
}
}
@@ -814,24 +814,16 @@ void TaskBar::reLayout()
QTimer::singleShot(100, this, SLOT(publishIconGeometry()));
}
-void TaskBar::viewportResizeEvent( QResizeEvent* e )
-{
- Panner::viewportResizeEvent(e);
- setViewportBackground();
-}
-
void TaskBar::setViewportBackground()
{
const QPixmap *bg = parentWidget()->backgroundPixmap();
- viewport()->unsetPalette();
-
if (bg)
{
QPixmap pm(parentWidget()->size());
pm.fill(parentWidget(), pos() + viewport()->pos());
viewport()->setPaletteBackgroundPixmap(pm);
- viewport()->setBackgroundOrigin( WidgetOrigin );
+ viewport()->setBackgroundOrigin(WidgetOrigin);
}
else
viewport()->setPaletteBackgroundColor(paletteBackgroundColor());
Index: kicker/taskbar/taskbar.h
===================================================================
--- kicker/taskbar/taskbar.h.orig
+++ kicker/taskbar/taskbar.h
@@ -63,12 +63,11 @@ public:
QImage* blendGradient(const QSize& size);
- void setBackground();
-
KTextShadowEngine *textShadowEngine();
public slots:
void configure();
+ void setBackground();
signals:
void containerCountChanged();
@@ -98,7 +97,6 @@ protected:
void viewportMouseReleaseEvent( QMouseEvent* );
void viewportMouseDoubleClickEvent( QMouseEvent* );
void viewportMouseMoveEvent( QMouseEvent* );
- void viewportResizeEvent( QResizeEvent * );
void wheelEvent(QWheelEvent*);
void propagateMouseEvent( QMouseEvent* );
void resizeEvent( QResizeEvent* );
Index: kicker/libkicker/panner.cpp
===================================================================
--- kicker/libkicker/panner.cpp.orig
+++ kicker/libkicker/panner.cpp
@@ -35,28 +35,28 @@ CONNECTION WITH THE SOFTWARE OR THE USE
#include "panner.h"
#include "panner.moc"
-
Panner::Panner( QWidget* parent, const char* name )
- : QScrollView( parent, name ),
+ : QWidget( parent, name ),
_luSB(0),
- _rdSB(0)
+ _rdSB(0),
+ _cwidth(0), _cheight(0),
+ _cx(0), _cy(0)
{
KGlobal::locale()->insertCatalogue("libkicker");
setBackgroundOrigin( AncestorOrigin );
_updateScrollButtonsTimer = new QTimer(this);
connect(_updateScrollButtonsTimer, SIGNAL(timeout()), this, SLOT(reallyUpdateScrollButtons()));
-
- setResizePolicy(Manual);
- setVScrollBarMode( QScrollView::AlwaysOff );
- setHScrollBarMode( QScrollView::AlwaysOff );
-
- viewport()->setBackgroundMode( PaletteBackground );
- viewport()->setBackgroundOrigin( AncestorOrigin );
+ _clipper = new QWidget(this);
+ _clipper->setBackgroundOrigin(AncestorOrigin);
+ _clipper->installEventFilter( this );
+ _viewport = new QWidget(_clipper);
+ _viewport->setBackgroundOrigin(AncestorOrigin);
+
// layout
_layout = new QBoxLayout(this, QBoxLayout::LeftToRight);
- _layout->addWidget(viewport(), 1);
+ _layout->addWidget(_clipper, 1);
setOrientation(Horizontal);
}
@@ -64,6 +64,37 @@ Panner::~Panner()
{
}
+void Panner::createScrollButtons()
+{
+ if (_luSB)
+ {
+ return;
+ }
+
+ // left/up scroll button
+ _luSB = new SimpleArrowButton(this);
+ _luSB->installEventFilter(this);
+ //_luSB->setAutoRepeat(true);
+ _luSB->setMinimumSize(12, 12);
+ _luSB->hide();
+ _layout->addWidget(_luSB);
+ connect(_luSB, SIGNAL(pressed()), SLOT(startScrollLeftUp()));
+ connect(_luSB, SIGNAL(released()), SLOT(stopScroll()));
+
+ // right/down scroll button
+ _rdSB = new SimpleArrowButton(this);
+ _rdSB->installEventFilter(this);
+ //_rdSB->setAutoRepeat(true);
+ _rdSB->setMinimumSize(12, 12);
+ _rdSB->hide();
+ _layout->addWidget(_rdSB);
+ connect(_rdSB, SIGNAL(pressed()), SLOT(startScrollRightDown()));
+ connect(_rdSB, SIGNAL(released()), SLOT(stopScroll()));
+
+ // set up the buttons
+ setupButtons();
+}
+
void Panner::setupButtons()
{
if (orientation() == Horizontal)
@@ -110,55 +141,54 @@ void Panner::setOrientation(Orientation
reallyUpdateScrollButtons();
}
-void Panner::resizeEvent( QResizeEvent* e )
+void Panner::resizeEvent( QResizeEvent* )
{
- QScrollView::resizeEvent( e );
- updateScrollButtons();
+ //QScrollView::resizeEvent( e );
+ //updateScrollButtons();
}
void Panner::scrollRightDown()
{
if(orientation() == Horizontal) // scroll right
- scrollBy( 40, 0 );
+ scrollBy( _step, 0 );
else // scroll down
- scrollBy( 0, 40 );
+ scrollBy( 0, _step );
+ if (_step < 64)
+ _step++;
}
void Panner::scrollLeftUp()
{
if(orientation() == Horizontal) // scroll left
- scrollBy( -40, 0 );
+ scrollBy( -_step, 0 );
else // scroll up
- scrollBy( 0, -40 );
+ scrollBy( 0, -_step );
+ if (_step < 64)
+ _step++;
}
-void Panner::createScrollButtons()
+void Panner::startScrollRightDown()
{
- if (_luSB)
- {
- return;
- }
-
- // left/up scroll button
- _luSB = new SimpleArrowButton(this);
- _luSB->installEventFilter(this);
- _luSB->setAutoRepeat(true);
- _luSB->setMinimumSize(12, 12);
- _luSB->hide();
- _layout->addWidget(_luSB);
- connect(_luSB, SIGNAL(clicked()), SLOT(scrollLeftUp()));
+ _scrollTimer = new QTimer(this);
+ connect(_scrollTimer, SIGNAL(timeout()), SLOT(scrollRightDown()));
+ _scrollTimer->start(50);
+ _step = 8;
+ scrollRightDown();
+}
- // right/down scroll button
- _rdSB = new SimpleArrowButton(this);
- _rdSB->installEventFilter(this);
- _rdSB->setAutoRepeat(true);
- _rdSB->setMinimumSize(12, 12);
- _rdSB->hide();
- _layout->addWidget(_rdSB);
- connect(_rdSB, SIGNAL(clicked()), SLOT(scrollRightDown()));
+void Panner::startScrollLeftUp()
+{
+ _scrollTimer = new QTimer(this);
+ connect(_scrollTimer, SIGNAL(timeout()), SLOT(scrollLeftUp()));
+ _scrollTimer->start(50);
+ _step = 8;
+ scrollLeftUp();
+}
- // set up the buttons
- setupButtons();
+void Panner::stopScroll()
+{
+ delete _scrollTimer;
+ _scrollTimer = 0;
}
void Panner::reallyUpdateScrollButtons()
@@ -176,7 +206,7 @@ void Panner::reallyUpdateScrollButtons()
delta = contentsHeight() - height();
}
- if (delta > 1)
+ if (delta >= 1)
{
createScrollButtons();
@@ -184,21 +214,11 @@ void Panner::reallyUpdateScrollButtons()
// we need to do this every single time
_luSB->show();
_rdSB->show();
-
- if (orientation() == Horizontal)
- {
- setMargins(0, 0, _luSB->width() + _rdSB->width(), 0);
- }
- else
- {
- setMargins(0, 0, 0, _luSB->height() + _rdSB->height());
- }
}
else if (_luSB && _luSB->isVisibleTo(this))
{
_luSB->hide();
_rdSB->hide();
- setMargins(0, 0, 0, 0);
}
}
@@ -207,8 +227,170 @@ void Panner::updateScrollButtons()
_updateScrollButtonsTimer->start(200, true);
}
+void Panner::setContentsPos(int x, int y)
+{
+ if (x < 0)
+ x = 0;
+ else if (x > (contentsWidth() - visibleWidth()))
+ x = contentsWidth() - visibleWidth();
+
+ if (y < 0)
+ y = 0;
+ else if (y > (contentsHeight() - visibleHeight()))
+ y = contentsHeight() - visibleHeight();
+
+ if (x == contentsX() && y == contentsY())
+ return;
+
+ _viewport->move(-x, -y);
+ emit contentsMoving(x, y);
+}
+
+void Panner::scrollBy(int dx, int dy)
+{
+ setContentsPos(contentsX() + dx, contentsY() + dy);
+}
+
void Panner::resizeContents( int w, int h )
{
- QScrollView::resizeContents( w, h );
+ _viewport->resize(w, h);
+ setContentsPos(contentsX(), contentsY());
updateScrollButtons();
}
+
+QPoint Panner::contentsToViewport( const QPoint& p ) const
+{
+ return QPoint(p.x() - contentsX() - _clipper->x(), p.y() - contentsY() - _clipper->y());
+}
+
+QPoint Panner::viewportToContents( const QPoint& vp ) const
+{
+ return QPoint(vp.x() + contentsX() + _clipper->x(), vp.y() + contentsY() + _clipper->y());
+}
+
+void Panner::contentsToViewport( int x, int y, int& vx, int& vy ) const
+{
+ const QPoint v = contentsToViewport(QPoint(x,y));
+ vx = v.x();
+ vy = v.y();
+}
+
+void Panner::viewportToContents( int vx, int vy, int& x, int& y ) const
+{
+ const QPoint c = viewportToContents(QPoint(vx,vy));
+ x = c.x();
+ y = c.y();
+}
+
+void Panner::ensureVisible( int x, int y )
+{
+ ensureVisible(x, y, 50, 50);
+}
+
+void Panner::ensureVisible( int x, int y, int xmargin, int ymargin )
+{
+ int pw=visibleWidth();
+ int ph=visibleHeight();
+
+ int cx=-contentsX();
+ int cy=-contentsY();
+ int cw=contentsWidth();
+ int ch=contentsHeight();
+
+ if ( pw < xmargin*2 )
+ xmargin=pw/2;
+ if ( ph < ymargin*2 )
+ ymargin=ph/2;
+
+ if ( cw <= pw ) {
+ xmargin=0;
+ cx=0;
+ }
+ if ( ch <= ph ) {
+ ymargin=0;
+ cy=0;
+ }
+
+ if ( x < -cx+xmargin )
+ cx = -x+xmargin;
+ else if ( x >= -cx+pw-xmargin )
+ cx = -x+pw-xmargin;
+
+ if ( y < -cy+ymargin )
+ cy = -y+ymargin;
+ else if ( y >= -cy+ph-ymargin )
+ cy = -y+ph-ymargin;
+
+ if ( cx > 0 )
+ cx=0;
+ else if ( cx < pw-cw && cw>pw )
+ cx=pw-cw;
+
+ if ( cy > 0 )
+ cy=0;
+ else if ( cy < ph-ch && ch>ph )
+ cy=ph-ch;
+
+ setContentsPos( -cx, -cy );
+}
+
+bool Panner::eventFilter( QObject *obj, QEvent *e )
+{
+ if ( obj == _viewport || obj == _clipper )
+ {
+ switch ( e->type() )
+ {
+ case QEvent::Resize:
+ viewportResizeEvent((QResizeEvent *)e);
+ break;
+ case QEvent::MouseButtonPress:
+ viewportMousePressEvent( (QMouseEvent*)e );
+ if ( ((QMouseEvent*)e)->isAccepted() )
+ return true;
+ break;
+ case QEvent::MouseButtonRelease:
+ viewportMouseReleaseEvent( (QMouseEvent*)e );
+ if ( ((QMouseEvent*)e)->isAccepted() )
+ return true;
+ break;
+ case QEvent::MouseButtonDblClick:
+ viewportMouseDoubleClickEvent( (QMouseEvent*)e );
+ if ( ((QMouseEvent*)e)->isAccepted() )
+ return true;
+ break;
+ case QEvent::MouseMove:
+ viewportMouseMoveEvent( (QMouseEvent*)e );
+ if ( ((QMouseEvent*)e)->isAccepted() )
+ return true;
+ break;
+ default:
+ break;
+ }
+ }
+
+ return QWidget::eventFilter( obj, e ); // always continue with standard event processing
+}
+
+void Panner::viewportResizeEvent( QResizeEvent* )
+{
+}
+
+void Panner::viewportMousePressEvent( QMouseEvent* e)
+{
+ e->ignore();
+}
+
+void Panner::viewportMouseReleaseEvent( QMouseEvent* e )
+{
+ e->ignore();
+}
+
+void Panner::viewportMouseDoubleClickEvent( QMouseEvent* e )
+{
+ e->ignore();
+}
+
+void Panner::viewportMouseMoveEvent( QMouseEvent* e )
+{
+ e->ignore();
+}
Index: kicker/libkicker/panner.h
===================================================================
--- kicker/libkicker/panner.h.orig
+++ kicker/libkicker/panner.h
@@ -24,14 +24,14 @@ CONNECTION WITH THE SOFTWARE OR THE USE
#ifndef __panner_h__
#define __panner_h__
-#include <qscrollview.h>
+#include <qwidget.h>
#include "simplebutton.h"
class QBoxLayout;
class QTimer;
-class KDE_EXPORT Panner : public QScrollView
+class KDE_EXPORT Panner : public QWidget
{
Q_OBJECT
@@ -43,17 +43,55 @@ public:
Qt::Orientation orientation() const { return _orient; }
virtual void setOrientation(Orientation orientation);
+
+ QWidget *viewport() const { return _viewport; }
+
+ QRect contentsRect() const { return QRect(0, 0, width(), height()); }
+
+ int contentsX() const { return _viewport ? -_viewport->x() : 0; }
+ int contentsY() const { return _viewport ? -_viewport->y() : 0; }
+ int contentsWidth() const { return _viewport ? _viewport->width() : 0; }
+ int contentsHeight() const { return _viewport ? _viewport->height() : 0; }
+ void setContentsPos(int x, int y);
+
+ int visibleWidth() const { return _clipper->width(); }
+ int visibleHeight() const { return _clipper->height(); }
+
+ void contentsToViewport( int x, int y, int& vx, int& vy ) const;
+ void viewportToContents( int vx, int vy, int& x, int& y ) const;
+ QPoint contentsToViewport( const QPoint& ) const;
+ QPoint viewportToContents( const QPoint& ) const;
+
+ void addChild(QWidget *child) { child->show(); }
+ void removeChild(QWidget *child) { child->hide(); }
+ int childX(QWidget *child) const { return child->x(); }
+ int childY(QWidget *child) const { return child->y(); }
+ void moveChild(QWidget *child, int x, int y) { child->move(x, y); }
+
+ void ensureVisible( int x, int y );
+ void ensureVisible( int x, int y, int xmargin, int ymargin );
public slots:
virtual void resizeContents( int w, int h );
+ void startScrollRightDown();
+ void startScrollLeftUp();
+ void stopScroll();
void scrollRightDown();
void scrollLeftUp();
void reallyUpdateScrollButtons();
+ void scrollBy(int dx, int dy);
+
+signals:
+ void contentsMoving(int x, int y);
protected:
- void resizeEvent(QResizeEvent *ev);
- void contentsWheelEvent(QWheelEvent *){;}
- void viewportWheelEvent(QWheelEvent *){;}
+ virtual bool eventFilter( QObject *obj, QEvent *e );
+ virtual void resizeEvent(QResizeEvent *ev);
+ virtual void viewportResizeEvent( QResizeEvent* );
+ virtual void viewportMousePressEvent( QMouseEvent* );
+ virtual void viewportMouseReleaseEvent( QMouseEvent* );
+ virtual void viewportMouseDoubleClickEvent( QMouseEvent* );
+ virtual void viewportMouseMoveEvent( QMouseEvent* );
private:
void setupButtons();
@@ -65,6 +103,13 @@ private:
SimpleArrowButton *_luSB; // Left Scroll Button
SimpleArrowButton *_rdSB; // Right Scroll Button
QTimer *_updateScrollButtonsTimer;
+ QTimer *_scrollTimer;
+
+ QWidget *_clipper;
+ QWidget *_viewport;
+ int _cwidth, _cheight;
+ int _cx, _cy;
+ int _step;
};
#endif
Index: kicker/extensions/taskbar/taskbarextension.cpp
===================================================================
--- kicker/extensions/taskbar/taskbarextension.cpp.orig
+++ kicker/extensions/taskbar/taskbarextension.cpp
@@ -170,7 +170,6 @@ void TaskBarExtension::setBackgroundThem
}
unsetPalette();
- m_container->unsetPalette();
if (KickerSettings::useBackgroundTheme())
{
@@ -215,17 +214,17 @@ void TaskBarExtension::setBackgroundThem
KickerLib::colorize(bgImage);
}
setPaletteBackgroundPixmap(bgImage);
- m_container->setPaletteBackgroundPixmap(bgImage);
}
}
+
+ m_container->setBackground();
}
void TaskBarExtension::updateBackground(const QPixmap& bgImage)
{
unsetPalette();
setPaletteBackgroundPixmap(bgImage);
- m_container->unsetPalette();
- m_container->setPaletteBackgroundPixmap(bgImage);
+ m_container->setBackground();
}
void TaskBarExtension::resizeEvent(QResizeEvent *e)
Index: kicker/kicker/core/container_extension.cpp
===================================================================
--- kicker/kicker/core/container_extension.cpp.orig
+++ kicker/kicker/core/container_extension.cpp
@@ -126,6 +126,7 @@ void ExtensionContainer::init()
connect(Kicker::the()->kwinModule(), SIGNAL(currentDesktopChanged(int)),
this, SLOT( currentDesktopChanged(int)));
+ setBackgroundOrigin(AncestorOrigin);
setFrameStyle(NoFrame);
setLineWidth(0);
setMargin(0);
@@ -163,7 +164,7 @@ void ExtensionContainer::init()
{
_userHidden = static_cast<UserHidden>(tmp);
}
-
+
if (m_extension)
{
// if we have an extension, we need to grab the extension-specific
Index: kicker/kicker/core/containerarea.cpp
===================================================================
--- kicker/kicker/core/containerarea.cpp.orig
+++ kicker/kicker/core/containerarea.cpp
@@ -90,15 +90,12 @@ ContainerArea::ContainerArea(KConfig* _c
m_addAppletDialog(0)
{
setBackgroundOrigin( WidgetOrigin );
- viewport()->setBackgroundOrigin( AncestorOrigin );
- m_contents = new QWidget(viewport());
- m_contents->setBackgroundOrigin(AncestorOrigin);
+ m_contents = viewport();
m_layout = new ContainerAreaLayout(m_contents);
- // Install an event filter to propagate layout hints coming from
- // m_contents.
+ // Install an event filter to propagate layout hints coming from m_contents.
m_contents->installEventFilter(this);
setBackground();
Index: kicker/kicker/core/panelextension.cpp
===================================================================
--- kicker/kicker/core/panelextension.cpp.orig
+++ kicker/kicker/core/panelextension.cpp
@@ -74,7 +74,6 @@ PanelExtension::PanelExtension(const QSt
connect(_containerArea, SIGNAL(maintainFocus(bool)), this, SIGNAL(maintainFocus(bool)));
_layout->addWidget(_containerArea);
- _containerArea->setFrameStyle(QFrame::NoFrame);
_containerArea->viewport()->installEventFilter(this);
_containerArea->configure();
Index: kicker/applets/systemtray/systemtrayapplet.h
===================================================================
--- kicker/applets/systemtray/systemtrayapplet.h.orig
+++ kicker/applets/systemtray/systemtrayapplet.h
@@ -118,6 +118,7 @@ public:
TrayEmbed( bool kdeTray, QWidget* parent = NULL );
bool kdeTray() const { return kde_tray; }
void setBackground();
+ void getIconSize(int defaultIconSize);
private:
bool kde_tray;
};
Index: kicker/applets/systemtray/systemtrayapplet.cpp
===================================================================
--- kicker/applets/systemtray/systemtrayapplet.cpp.orig
+++ kicker/applets/systemtray/systemtrayapplet.cpp
@@ -54,6 +54,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE
#include <X11/Xlib.h>
+#define ICON_MARGIN 1
+
extern "C"
{
KDE_EXPORT KPanelApplet* init(QWidget *parent, const QString& configFile)
@@ -459,9 +461,9 @@ void SystemTrayApplet::embedWindow( WId
delete emb;
return;
}
-
+
connect(emb, SIGNAL(embeddedWindowDestroyed()), SLOT(updateTrayWindows()));
- emb->setMinimumSize(m_iconSize, m_iconSize);
+ emb->getIconSize(m_iconSize);
if (shouldHide(w))
{
@@ -471,7 +473,7 @@ void SystemTrayApplet::embedWindow( WId
}
else
{
- emb->hide();
+ //emb->hide();
emb->setBackground();
emb->show();
m_shownWins.append(emb);
@@ -515,7 +517,7 @@ void SystemTrayApplet::updateVisibleWins
{
for (; emb != lastEmb; ++emb)
{
- (*emb)->hide();
+ //(*emb)->hide();
(*emb)->setBackground();
(*emb)->show();
}
@@ -744,8 +746,7 @@ int SystemTrayApplet::widthForHeight(int
}
int currentHeight = height();
- int minHeight = m_iconSize + 4;
- if (currentHeight != h && currentHeight != minHeight)
+ if (currentHeight != h)
{
SystemTrayApplet* me = const_cast<SystemTrayApplet*>(this);
me->setMinimumSize(0, 0);
@@ -764,8 +765,7 @@ int SystemTrayApplet::heightForWidth(int
}
int currentWidth = width();
- int minSize = m_iconSize + 4;
- if (currentWidth != w && currentWidth != minSize)
+ if (currentWidth != w)
{
SystemTrayApplet* me = const_cast<SystemTrayApplet*>(this);
me->setMinimumSize(0, 0);
@@ -782,10 +782,8 @@ void SystemTrayApplet::moveEvent( QMoveE
}
-void SystemTrayApplet::resizeEvent( QResizeEvent* e )
+void SystemTrayApplet::resizeEvent( QResizeEvent* )
{
- KPanelApplet::resizeEvent(e);
-
layoutTray();
// we need to give ourselves a chance to adjust our size before calling this
QTimer::singleShot(0, this, SIGNAL(updateLayout()));
@@ -808,7 +806,7 @@ void SystemTrayApplet::layoutTray()
int i = 0, line, nbrOfLines, heightWidth;
bool showExpandButton = m_expandButton && m_expandButton->isVisibleTo(this);
delete m_layout;
- m_layout = new QGridLayout(this, 1, 1, 2, 2);
+ m_layout = new QGridLayout(this, 1, 1, ICON_MARGIN, ICON_MARGIN);
if (m_expandButton)
{
@@ -828,18 +826,18 @@ void SystemTrayApplet::layoutTray()
//
// The margin and spacing specified in the layout implies that:
- // [-- 2 pixels --] [-- first icon --] [-- 2 pixels --] ... [-- 2 pixels --] [-- last icon --] [-- 2 pixels --]
+ // [-- ICON_MARGIN pixels --] [-- first icon --] [-- ICON_MARGIN pixels --] ... [-- ICON_MARGIN pixels --] [-- last icon --] [-- ICON_MARGIN pixels --]
//
- // So, if we say that iconWidth is the icon width plus the 2 pixels spacing, then the available width for the icons
- // is the widget width minus 2 pixels margin. Forgetting these 2 pixels broke the layout algorithm in KDE <= 3.5.9.
+ // So, if we say that iconWidth is the icon width plus the ICON_MARGIN pixels spacing, then the available width for the icons
+ // is the widget width minus ICON_MARGIN pixels margin. Forgetting these ICON_MARGIN pixels broke the layout algorithm in KDE <= 3.5.9.
//
- // This fix makes the workaround in the heightForWidth() and widthForHeight() methods unneeded.
+ // This fix makes the workarounds in the heightForWidth() and widthForHeight() methods unneeded.
//
if (orientation() == Vertical)
{
- int iconWidth = maxIconWidth() + 2; // +2 for the margins that implied by the layout
- heightWidth = width() - 2;
+ int iconWidth = maxIconWidth() + ICON_MARGIN; // +2 for the margins that implied by the layout
+ heightWidth = width() - ICON_MARGIN;
// to avoid nbrOfLines=0 we ensure heightWidth >= iconWidth!
heightWidth = heightWidth < iconWidth ? iconWidth : heightWidth;
nbrOfLines = heightWidth / iconWidth;
@@ -860,12 +858,12 @@ void SystemTrayApplet::layoutTray()
emb != lastEmb; ++emb)
{
line = i % nbrOfLines;
- (*emb)->hide();
+ //(*emb)->hide();
(*emb)->show();
m_layout->addWidget(*emb, col, line,
Qt::AlignHCenter | Qt::AlignVCenter);
- if (line + 1 == nbrOfLines)
+ if ((line + 1) == nbrOfLines)
{
++col;
}
@@ -879,12 +877,12 @@ void SystemTrayApplet::layoutTray()
emb != lastEmb; ++emb)
{
line = i % nbrOfLines;
- (*emb)->hide();
+ //(*emb)->hide();
(*emb)->show();
m_layout->addWidget(*emb, col, line,
Qt::AlignHCenter | Qt::AlignVCenter);
- if (line + 1 == nbrOfLines)
+ if ((line + 1) == nbrOfLines)
{
++col;
}
@@ -894,8 +892,8 @@ void SystemTrayApplet::layoutTray()
}
else // horizontal
{
- int iconHeight = maxIconHeight() + 2; // +2 for the margins that implied by the layout
- heightWidth = height() - 2;
+ int iconHeight = maxIconHeight() + ICON_MARGIN; // +2 for the margins that implied by the layout
+ heightWidth = height() - ICON_MARGIN;
heightWidth = heightWidth < iconHeight ? iconHeight : heightWidth; // to avoid nbrOfLines=0
nbrOfLines = heightWidth / iconHeight;
@@ -914,12 +912,12 @@ void SystemTrayApplet::layoutTray()
for (TrayEmbedList::const_iterator emb = m_hiddenWins.begin(); emb != lastEmb; ++emb)
{
line = i % nbrOfLines;
- (*emb)->hide();
+ //(*emb)->hide();
(*emb)->show();
m_layout->addWidget(*emb, line, col,
Qt::AlignHCenter | Qt::AlignVCenter);
- if (line + 1 == nbrOfLines)
+ if ((line + 1) == nbrOfLines)
{
++col;
}
@@ -933,12 +931,12 @@ void SystemTrayApplet::layoutTray()
emb != lastEmb; ++emb)
{
line = i % nbrOfLines;
- (*emb)->hide();
+ //(*emb)->hide();
(*emb)->show();
m_layout->addWidget(*emb, line, col,
Qt::AlignHCenter | Qt::AlignVCenter);
- if (line + 1 == nbrOfLines)
+ if ((line + 1) == nbrOfLines)
{
++col;
}
@@ -975,6 +973,21 @@ TrayEmbed::TrayEmbed( bool kdeTray, QWid
: QXEmbed( parent ), kde_tray( kdeTray )
{
hide();
+}
+
+void TrayEmbed::getIconSize(int defaultIconSize)
+{
+ QSize minSize = minimumSizeHint();
+
+ int width = minSize.width();
+ int height = minSize.height();
+
+ if (width < 1 || width > defaultIconSize)
+ width = defaultIconSize;
+ if (height < 1 || height > defaultIconSize)
+ height = defaultIconSize;
+
+ setFixedSize(width, height);
setBackground();
}
@@ -994,9 +1007,7 @@ void TrayEmbed::setBackground()
if (!isHidden())
{
- hide();
- show();
+ XClearArea(x11Display(), embeddedWinId(), 0, 0, 0, 0, True);
}
- //XClearArea(x11Display(), embeddedWinId(), 0, 0, 0, 0, True);
}
Index: kicker/applets/clock/clock.h
===================================================================
--- kicker/applets/clock/clock.h.orig
+++ kicker/applets/clock/clock.h
@@ -41,6 +41,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE
#include <kickertip.h>
#include "settings.h"
+#include "kshadowengine.h"
class QTimer;
class QBoxLayout;
@@ -152,6 +153,9 @@ class PlainClock : public QLabel, public
bool showDayOfWeek();
protected:
+ void paintEvent(QPaintEvent *e);
+ void drawContents(QPainter *p);
+
QString _timeStr;
};
@@ -279,6 +283,8 @@ class ClockApplet : public KPanelApplet,
QDate clockGetDate();
virtual void updateKickerTip(KickerTip::Data&);
+
+ KTextShadowEngine *shadowEngine();
k_dcop:
void reconfigure();
@@ -335,6 +341,7 @@ class ClockApplet : public KPanelApplet,
QStringList _remotezonelist;
KPopupMenu* menu;
ClockAppletToolTip m_tooltip;
+ KTextShadowEngine *m_shadowEngine;
};
Index: kicker/applets/clock/Makefile.am
===================================================================
--- kicker/applets/clock/Makefile.am.orig
+++ kicker/applets/clock/Makefile.am
@@ -1,7 +1,7 @@
pic_DATA = lcd.png
picdir = $(kde_datadir)/clockapplet/pics
-INCLUDES = -I$(top_srcdir)/kicker/libkicker $(all_includes)
+INCLUDES = -I$(top_srcdir)/kicker/libkicker -I../../libkicker $(all_includes)
kde_module_LTLIBRARIES = clock_panelapplet.la
Index: kicker/applets/clock/clock.cpp
===================================================================
--- kicker/applets/clock/clock.cpp.orig
+++ kicker/applets/clock/clock.cpp
@@ -57,6 +57,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE
#include <global.h> // libkickermain
+#include "kickerSettings.h"
#include "clock.h"
#include "datepicker.h"
#include "zone.h"
@@ -219,6 +220,7 @@ ClockWidget::~ClockWidget()
PlainClock::PlainClock(ClockApplet *applet, Prefs *prefs, QWidget *parent, const char *name)
: QLabel(parent, name), ClockWidget(applet, prefs)
{
+ setWFlags(WNoAutoErase);
setBackgroundOrigin(AncestorOrigin);
loadSettings();
updateClock();
@@ -228,7 +230,7 @@ PlainClock::PlainClock(ClockApplet *appl
int PlainClock::preferedWidthForHeight(int ) const
{
QString maxLengthTime = KGlobal::locale()->formatTime( QTime( 23, 59 ), _prefs->plainShowSeconds());
- return fontMetrics().width( maxLengthTime+2 );
+ return fontMetrics().width( maxLengthTime ) + 8;
}
@@ -244,7 +246,7 @@ void PlainClock::updateClock()
if (_force || newStr != _timeStr) {
_timeStr = newStr;
- setText(_timeStr);
+ update();
}
}
@@ -266,6 +268,32 @@ bool PlainClock::showDayOfWeek()
return _prefs->plainShowDayOfWeek();
}
+void PlainClock::paintEvent(QPaintEvent *)
+{
+ QPainter p;
+ QPixmap buf(size());
+ buf.fill(this, 0, 0);
+ p.begin(&buf);
+ p.setFont(font());
+ p.setPen(paletteForegroundColor());
+ drawContents(&p);
+ drawFrame(&p);
+ p.end();
+ p.begin(this);
+ p.drawPixmap(0, 0, buf);
+ p.end();
+}
+
+void PlainClock::drawContents(QPainter *p)
+{
+ QRect tr(0, 0, width(), height());
+
+ if (!KickerSettings::transparent())
+ p->drawText(tr, AlignCenter, _timeStr);
+ else
+ _applet->shadowEngine()->drawText(*p, tr, AlignCenter, _timeStr, size());
+}
+
//************************************************************
@@ -834,12 +862,22 @@ void FuzzyClock::drawContents(QPainter *
p->setFont(_prefs->fuzzyFont());
p->setPen(_prefs->fuzzyForegroundColor());
- if (_applet->getOrientation() == Vertical) {
+
+ QRect tr;
+
+ if (_applet->getOrientation() == Vertical)
+ {
p->rotate(90);
- p->drawText(4, -2, height() - 8, -(width()) + 2, AlignCenter, _timeStr);
- } else {
- p->drawText(4, 2, width() - 8, height() - 4, AlignCenter, _timeStr);
+ tr = QRect(4, -2, height() - 8, -(width()) + 2);
}
+ else
+ tr = QRect(4, 2, width() - 8, height() - 4);
+
+ if (!KickerSettings::transparent())
+ p->drawText(tr, AlignCenter, _timeStr);
+ else
+ _applet->shadowEngine()->drawText(*p, tr, AlignCenter, _timeStr, size());
+
alreadyDrawing = false;
}
@@ -872,7 +910,8 @@ ClockApplet::ClockApplet(const QString&
_prefs(new Prefs(sharedConfig())),
zone(new Zone(config())),
menu(0),
- m_tooltip(this)
+ m_tooltip(this),
+ m_shadowEngine(0)
{
DCOPObject::setObjId("ClockApplet");
_prefs->readConfig();
@@ -910,6 +949,7 @@ ClockApplet::ClockApplet(const QString&
ClockApplet::~ClockApplet()
{
+ delete m_shadowEngine;
//reverse for the moment
KGlobal::locale()->removeCatalogue("clockapplet");
KGlobal::locale()->removeCatalogue("timezones"); // For time zone translations
@@ -929,6 +969,16 @@ ClockApplet::~ClockApplet()
config()->sync();
}
+
+KTextShadowEngine *ClockApplet::shadowEngine()
+{
+ if (!m_shadowEngine)
+ m_shadowEngine = new KTextShadowEngine();
+
+ return m_shadowEngine;
+}
+
+
int ClockApplet::widthForHeight(int h) const
{
if (orientation() == Qt::Vertical)
Index: kioslave/media/mediamanager/halbackend.cpp
===================================================================
--- kioslave/media/mediamanager/halbackend.cpp.orig
+++ kioslave/media/mediamanager/halbackend.cpp
@@ -851,13 +851,6 @@ QStringList HALBackend::mountoptions(con
result << tmp;
}
- if ( valids.contains("locale") )
- {
- value = config.readBoolEntry( "locale", true );
- tmp = QString( "locale=%1" ).arg( value ? "true" : "false" );
- result << tmp;
- }
-
if (valids.contains("utf8"))
{
value = config.readBoolEntry("utf8", true);
@@ -878,6 +871,17 @@ QStringList HALBackend::mountoptions(con
result << "shortname=lower";
}
+ // pass our locale to the ntfs-3g driver so it can translate local characters
+ if (valids.contains("locale") && fstype == "ntfs-3g")
+ {
+ // have to obtain LC_CTYPE as returned by the `locale` command
+ // check in the same order as `locale` does
+ char *cType;
+ if ( (cType = getenv("LC_ALL")) || (cType = getenv("LC_CTYPE")) || (cType = getenv("LANG")) ) {
+ result << QString("locale=%1").arg(cType);
+ }
+ }
+
if (valids.contains("sync"))
{
value = config.readBoolEntry("sync", ( valids.contains("flush") && !fstype.endsWith("fat") ) && removable);
@@ -931,7 +935,7 @@ bool HALBackend::setMountoptions(const Q
QMap<QString,QString> valids = MediaManagerUtils::splitOptions(options);
- const char *names[] = { "ro", "quiet", "atime", "uid", "utf8", "flush", "sync", "locale", 0 };
+ const char *names[] = { "ro", "quiet", "atime", "uid", "utf8", "flush", "sync", 0 };
for (int index = 0; names[index]; ++index)
if (valids.contains(names[index]))
config.writeEntry(names[index], valids[names[index]] == "true");
@@ -951,10 +955,6 @@ bool HALBackend::setMountoptions(const Q
config.writeEntry("automount", valids["automount"]);
}
- if (valids.contains("locale") ) {
- config.writeEntry("locale", valids["locale"]);
- }
-
return true;
}
@@ -1153,11 +1153,6 @@ QString HALBackend::mount(const Medium *
soptions << QString("uid=%1").arg(getuid());
}
- if (valids["locale"] == "true")
- {
- soptions << QString("locale=%1").arg( KGlobal::locale()->language() );
- }
-
if (valids["ro"] == "true")
soptions << "ro";
@@ -1182,6 +1177,11 @@ QString HALBackend::mount(const Medium *
soptions << QString("shortname=%1").arg(valids["shortname"]);
}
+ if (valids.contains("locale"))
+ {
+ soptions << QString("locale=%1").arg(valids["locale"]);
+ }
+
if (valids.contains("journaling"))
{
QString option = valids["journaling"];
Index: knetattach/knetattach.ui
===================================================================
--- knetattach/knetattach.ui.orig
+++ knetattach/knetattach.ui
@@ -236,7 +236,7 @@
</sizepolicy>
</property>
<property name="maxValue">
- <number>32768</number>
+ <number>65535</number>
</property>
<property name="minValue">
<number>1</number>