Merge branch 'KDE/4.7' into ksecretsservice
This commit is contained in:
commit
da386deb15
@ -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>
|
||||
|
@ -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);
|
||||
|
@ -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();
|
||||
|
@ -94,13 +94,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);
|
||||
|
||||
@ -194,9 +195,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);
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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());
|
||||
|
Loading…
Reference in New Issue
Block a user