diff --git a/CMakeLists.txt b/CMakeLists.txt index efb4bbb29..095a0998f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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) diff --git a/applet.cpp b/applet.cpp index 7cf056d86..fc748777a 100644 --- a/applet.cpp +++ b/applet.cpp @@ -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) diff --git a/config-plasma.h.cmake b/config-plasma.h.cmake index ebce7422b..936ab3a72 100644 --- a/config-plasma.h.cmake +++ b/config-plasma.h.cmake @@ -6,4 +6,5 @@ #cmakedefine PLASMA_NO_SOLID #cmakedefine PLASMA_NO_KIO #cmakedefine PLASMA_NO_KUTILS +#cmakedefine PLASMA_NO_GLOBAL_SHORTCUTS diff --git a/private/focusindicator.cpp b/private/focusindicator.cpp index f24217e05..1d0744fdd 100644 --- a/private/focusindicator.cpp +++ b/private/focusindicator.cpp @@ -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 diff --git a/private/focusindicator_p.h b/private/focusindicator_p.h index 9ac9e12aa..12a81d088 100644 --- a/private/focusindicator_p.h +++ b/private/focusindicator_p.h @@ -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); diff --git a/widgets/combobox.cpp b/widgets/combobox.cpp index 0de46d03e..48a492346 100644 --- a/widgets/combobox.cpp +++ b/widgets/combobox.cpp @@ -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(); diff --git a/widgets/declarativewidget.cpp b/widgets/declarativewidget.cpp index fdd32a7cc..59c653d9d 100644 --- a/widgets/declarativewidget.cpp +++ b/widgets/declarativewidget.cpp @@ -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); } diff --git a/widgets/lineedit.cpp b/widgets/lineedit.cpp index 9842379b2..708ef3a70 100644 --- a/widgets/lineedit.cpp +++ b/widgets/lineedit.cpp @@ -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); } diff --git a/widgets/spinbox.cpp b/widgets/spinbox.cpp index d76f7c459..bacdabdca 100644 --- a/widgets/spinbox.cpp +++ b/widgets/spinbox.cpp @@ -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());