Merge remote-tracking branch 'origin/KDE/4.7' into origin-frameworks

Conflicts:
	tier1/libkcoreaddons/src/io/kdirwatch.cpp
This commit is contained in:
David Faure 2011-11-16 14:44:08 +01:00
commit bdf1f5c2dc
9 changed files with 38 additions and 7 deletions

View File

@ -9,6 +9,7 @@ if(KDE_PLATFORM_FEATURE_BINARY_COMPATIBLE_FEATURE_REDUCTION)
set(PLASMA_NO_PACKAGEKIT TRUE)
set(PLASMA_NO_PACKAGE_EXTRADATA TRUE)
set(PLASMA_NO_KUTILS TRUE)
set(PLASMA_NO_GLOBAL_SHORTCUTS TRUE)
endif(KDE_PLATFORM_FEATURE_BINARY_COMPATIBLE_FEATURE_REDUCTION)
if(NOT Q_WS_X11)

View File

@ -1996,6 +1996,7 @@ void AppletPrivate::addStandardConfigurationPages(KConfigDialog *dialog)
void AppletPrivate::addGlobalShortcutsPage(KConfigDialog *dialog)
{
#ifndef PLASMA_NO_GLOBAL_SHORTCUTS
if (isContainment) {
return;
}
@ -2015,6 +2016,7 @@ void AppletPrivate::addGlobalShortcutsPage(KConfigDialog *dialog)
QObject::connect(dialog, SIGNAL(applyClicked()), q, SLOT(configDialogFinished()), Qt::UniqueConnection);
QObject::connect(dialog, SIGNAL(okClicked()), q, SLOT(configDialogFinished()), Qt::UniqueConnection);
#endif
}
void AppletPrivate::addPublishPage(KConfigDialog *dialog)

View File

@ -6,4 +6,5 @@
#cmakedefine PLASMA_NO_SOLID
#cmakedefine PLASMA_NO_KIO
#cmakedefine PLASMA_NO_KUTILS
#cmakedefine PLASMA_NO_GLOBAL_SHORTCUTS

View File

@ -304,6 +304,18 @@ void FocusIndicator::syncGeometry()
}
}
void FocusIndicator::setFrameSvg(FrameSvg *frameSvg)
{
if (m_background != frameSvg) {
m_background = frameSvg;
}
}
FrameSvg *FocusIndicator::frameSvg() const
{
return m_background;
}
}
#include <focusindicator_p.moc>

View File

@ -43,6 +43,9 @@ public:
void animateVisibility(const bool visible);
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
void setFrameSvg(FrameSvg *svg);
FrameSvg *frameSvg() const;
protected:
bool eventFilter(QObject *watched, QEvent *event);
void resizeEvent(QGraphicsSceneResizeEvent *event);

View File

@ -56,6 +56,7 @@ public:
FrameSvg *background;
FrameSvg *lineEditBackground;
FocusIndicator *focusIndicator;
int animId;
qreal opacity;
QRectF activeRect;
@ -99,6 +100,13 @@ void ComboBoxPrivate::syncBorders()
q->setFont(Theme::defaultTheme()->font(Theme::DefaultFont));
customFont = false;
}
if (q->nativeWidget()->isEditable()) {
focusIndicator->setFrameSvg(lineEditBackground);
} else {
focusIndicator->setFrameSvg(background);
}
focusIndicator->setFlag(QGraphicsItem::ItemStacksBehindParent, !q->nativeWidget()->isEditable() || !lineEditBackground->hasElement("hint-focus-over-base"));
}
@ -119,7 +127,7 @@ ComboBox::ComboBox(QGraphicsWidget *parent)
d->style = Style::sharedStyle();
new FocusIndicator(this, d->background);
d->focusIndicator = new FocusIndicator(this, d->background);
setNativeWidget(new KComboBox);
connect(d->background, SIGNAL(repaintNeeded()), SLOT(syncBorders()));
d->initTheming();

View File

@ -96,13 +96,14 @@ void DeclarativeWidgetPrivate::execute(const QString &fileName)
return;
}
component->loadUrl(fileName);
KDeclarative kdeclarative;
kdeclarative.setDeclarativeEngine(engine);
kdeclarative.initialize();
//binds things like kconfig and icons
kdeclarative.setupBindings();
component->loadUrl(fileName);
scriptEngine = kdeclarative.scriptEngine();
registerDataEngineMetaTypes(scriptEngine);
@ -198,9 +199,6 @@ DeclarativeWidget::DeclarativeWidget(QGraphicsWidget *parent)
d->engine = new QDeclarativeEngine(this);
d->engine->setNetworkAccessManagerFactory(new DeclarativeNetworkAccessManagerFactory);
foreach(const QString &importPath, KGlobal::dirs()->findDirs("module", "imports")) {
d->engine->addImportPath(importPath);
}
d->component = new QDeclarativeComponent(d->engine, this);
}

View File

@ -64,7 +64,10 @@ LineEdit::LineEdit(QGraphicsWidget *parent)
d->background->setImagePath("widgets/lineedit");
d->background->setCacheAllRenderedFrames(true);
new FocusIndicator(this, d->background);
FocusIndicator *indicator = new FocusIndicator(this, d->background);
if (d->background->hasElement("hint-focus-over-base")) {
indicator->setFlag(QGraphicsItem::ItemStacksBehindParent, false);
}
setNativeWidget(new KLineEdit);
}

View File

@ -76,6 +76,9 @@ SpinBox::SpinBox(QGraphicsWidget *parent)
d->background->setImagePath("widgets/lineedit");
d->background->setCacheAllRenderedFrames(true);
if (d->background->hasElement("hint-focus-over-base")) {
d->focusIndicator->setFlag(QGraphicsItem::ItemStacksBehindParent, false);
}
d->style = Plasma::Style::sharedStyle();
native->setStyle(d->style.data());