mirror of
https://bitbucket.org/smil3y/kdelibs.git
synced 2025-02-24 02:42:48 +00:00
plasma: remove redundant Plasma::ItemStatus::NeedsAttentionStatus
is used by the panel view to force-activated applet windows but since it is done on mouse press the window should become active anyway (unless there is something like focus stealing prevention getting in the way) Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
7ce4310781
commit
aa8fa5abaf
9 changed files with 1 additions and 127 deletions
|
@ -192,8 +192,7 @@ enum ItemStatus {
|
||||||
UnknownStatus = 0, /**< The status is unknown **/
|
UnknownStatus = 0, /**< The status is unknown **/
|
||||||
PassiveStatus = 1, /**< The Item is passive **/
|
PassiveStatus = 1, /**< The Item is passive **/
|
||||||
ActiveStatus = 2, /**< The Item is active **/
|
ActiveStatus = 2, /**< The Item is active **/
|
||||||
NeedsAttentionStatus = 3, /**< The Item needs attention **/
|
NeedsAttentionStatus = 3 /**< The Item needs attention **/
|
||||||
AcceptingInputStatus = 4 /**< The Item is accepting input **/
|
|
||||||
};
|
};
|
||||||
Q_ENUMS(ItemStatus)
|
Q_ENUMS(ItemStatus)
|
||||||
|
|
||||||
|
|
|
@ -108,18 +108,6 @@ void ComboBox::clear()
|
||||||
|
|
||||||
void ComboBox::focusOutEvent(QFocusEvent *event)
|
void ComboBox::focusOutEvent(QFocusEvent *event)
|
||||||
{
|
{
|
||||||
QGraphicsWidget *widget = parentWidget();
|
|
||||||
Plasma::Applet *applet = qobject_cast<Plasma::Applet *>(widget);
|
|
||||||
|
|
||||||
while (!applet && widget) {
|
|
||||||
widget = widget->parentWidget();
|
|
||||||
applet = qobject_cast<Plasma::Applet *>(widget);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (applet) {
|
|
||||||
applet->setStatus(Plasma::UnknownStatus);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (nativeWidget()->isEditable()) {
|
if (nativeWidget()->isEditable()) {
|
||||||
QEvent closeEvent(QEvent::CloseSoftwareInputPanel);
|
QEvent closeEvent(QEvent::CloseSoftwareInputPanel);
|
||||||
if (qApp) {
|
if (qApp) {
|
||||||
|
@ -140,22 +128,6 @@ void ComboBox::changeEvent(QEvent *event)
|
||||||
QGraphicsProxyWidget::changeEvent(event);
|
QGraphicsProxyWidget::changeEvent(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ComboBox::mousePressEvent(QGraphicsSceneMouseEvent *event)
|
|
||||||
{
|
|
||||||
QGraphicsWidget *widget = parentWidget();
|
|
||||||
Plasma::Applet *applet = qobject_cast<Plasma::Applet *>(widget);
|
|
||||||
|
|
||||||
while (!applet && widget) {
|
|
||||||
widget = widget->parentWidget();
|
|
||||||
applet = qobject_cast<Plasma::Applet *>(widget);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (applet) {
|
|
||||||
applet->setStatus(Plasma::AcceptingInputStatus);
|
|
||||||
}
|
|
||||||
QGraphicsProxyWidget::mousePressEvent(event);
|
|
||||||
}
|
|
||||||
|
|
||||||
int ComboBox::count() const
|
int ComboBox::count() const
|
||||||
{
|
{
|
||||||
return nativeWidget()->count();
|
return nativeWidget()->count();
|
||||||
|
|
|
@ -115,7 +115,6 @@ Q_SIGNALS:
|
||||||
protected:
|
protected:
|
||||||
void focusOutEvent(QFocusEvent *event);
|
void focusOutEvent(QFocusEvent *event);
|
||||||
void changeEvent(QEvent *event);
|
void changeEvent(QEvent *event);
|
||||||
void mousePressEvent(QGraphicsSceneMouseEvent *event);
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
ComboBoxPrivate * const d;
|
ComboBoxPrivate * const d;
|
||||||
|
|
|
@ -130,22 +130,6 @@ void LineEdit::changeEvent(QEvent *event)
|
||||||
QGraphicsProxyWidget::changeEvent(event);
|
QGraphicsProxyWidget::changeEvent(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
void LineEdit::mousePressEvent(QGraphicsSceneMouseEvent *event)
|
|
||||||
{
|
|
||||||
QGraphicsWidget *widget = parentWidget();
|
|
||||||
Plasma::Applet *applet = qobject_cast<Plasma::Applet *>(widget);
|
|
||||||
|
|
||||||
while (!applet && widget) {
|
|
||||||
widget = widget->parentWidget();
|
|
||||||
applet = qobject_cast<Plasma::Applet *>(widget);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (applet) {
|
|
||||||
applet->setStatus(Plasma::AcceptingInputStatus);
|
|
||||||
}
|
|
||||||
QGraphicsProxyWidget::mousePressEvent(event);
|
|
||||||
}
|
|
||||||
|
|
||||||
void LineEdit::focusInEvent(QFocusEvent *event)
|
void LineEdit::focusInEvent(QFocusEvent *event)
|
||||||
{
|
{
|
||||||
QGraphicsProxyWidget::focusInEvent(event);
|
QGraphicsProxyWidget::focusInEvent(event);
|
||||||
|
@ -153,24 +137,10 @@ void LineEdit::focusInEvent(QFocusEvent *event)
|
||||||
// as of Qt 4.7, apparently we have a bug here in QGraphicsProxyWidget
|
// as of Qt 4.7, apparently we have a bug here in QGraphicsProxyWidget
|
||||||
nativeWidget()->setFocus(event->reason());
|
nativeWidget()->setFocus(event->reason());
|
||||||
}
|
}
|
||||||
|
|
||||||
emit focusChanged(true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void LineEdit::focusOutEvent(QFocusEvent *event)
|
void LineEdit::focusOutEvent(QFocusEvent *event)
|
||||||
{
|
{
|
||||||
QGraphicsWidget *widget = parentWidget();
|
|
||||||
Plasma::Applet *applet = qobject_cast<Plasma::Applet *>(widget);
|
|
||||||
|
|
||||||
while (!applet && widget) {
|
|
||||||
widget = widget->parentWidget();
|
|
||||||
applet = qobject_cast<Plasma::Applet *>(widget);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (applet) {
|
|
||||||
applet->setStatus(Plasma::UnknownStatus);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (qApp) {
|
if (qApp) {
|
||||||
if (QGraphicsView *view = qobject_cast<QGraphicsView*>(qApp->focusWidget())) {
|
if (QGraphicsView *view = qobject_cast<QGraphicsView*>(qApp->focusWidget())) {
|
||||||
if (view->scene() && view->scene() == scene()) {
|
if (view->scene() && view->scene() == scene()) {
|
||||||
|
@ -181,8 +151,6 @@ void LineEdit::focusOutEvent(QFocusEvent *event)
|
||||||
}
|
}
|
||||||
|
|
||||||
QGraphicsProxyWidget::focusOutEvent(event);
|
QGraphicsProxyWidget::focusOutEvent(event);
|
||||||
|
|
||||||
emit focusChanged(false);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace Plasma
|
} // namespace Plasma
|
||||||
|
|
|
@ -100,7 +100,6 @@ public:
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void changeEvent(QEvent *event);
|
void changeEvent(QEvent *event);
|
||||||
void mousePressEvent(QGraphicsSceneMouseEvent *event);
|
|
||||||
void focusInEvent(QFocusEvent *event);
|
void focusInEvent(QFocusEvent *event);
|
||||||
void focusOutEvent(QFocusEvent *event);
|
void focusOutEvent(QFocusEvent *event);
|
||||||
|
|
||||||
|
@ -114,11 +113,6 @@ Q_SIGNALS:
|
||||||
* @since 4.4
|
* @since 4.4
|
||||||
*/
|
*/
|
||||||
void textChanged(const QString &text);
|
void textChanged(const QString &text);
|
||||||
/**
|
|
||||||
* Emitted when the widget receives or loses focus
|
|
||||||
* @since 4.7
|
|
||||||
*/
|
|
||||||
void focusChanged(bool focused);
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Q_PRIVATE_SLOT(d, void setPalette())
|
Q_PRIVATE_SLOT(d, void setPalette())
|
||||||
|
|
|
@ -115,36 +115,8 @@ void SpinBox::changeEvent(QEvent *event)
|
||||||
QGraphicsProxyWidget::changeEvent(event);
|
QGraphicsProxyWidget::changeEvent(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SpinBox::mousePressEvent(QGraphicsSceneMouseEvent *event)
|
|
||||||
{
|
|
||||||
QGraphicsWidget *widget = parentWidget();
|
|
||||||
Plasma::Applet *applet = qobject_cast<Plasma::Applet *>(widget);
|
|
||||||
|
|
||||||
while (!applet && widget) {
|
|
||||||
widget = widget->parentWidget();
|
|
||||||
applet = qobject_cast<Plasma::Applet *>(widget);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (applet) {
|
|
||||||
applet->setStatus(Plasma::AcceptingInputStatus);
|
|
||||||
}
|
|
||||||
QGraphicsProxyWidget::mousePressEvent(event);
|
|
||||||
}
|
|
||||||
|
|
||||||
void SpinBox::focusOutEvent(QFocusEvent *event)
|
void SpinBox::focusOutEvent(QFocusEvent *event)
|
||||||
{
|
{
|
||||||
QGraphicsWidget *widget = parentWidget();
|
|
||||||
Plasma::Applet *applet = qobject_cast<Plasma::Applet *>(widget);
|
|
||||||
|
|
||||||
while (!applet && widget) {
|
|
||||||
widget = widget->parentWidget();
|
|
||||||
applet = qobject_cast<Plasma::Applet *>(widget);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (applet) {
|
|
||||||
applet->setStatus(Plasma::UnknownStatus);
|
|
||||||
}
|
|
||||||
|
|
||||||
QEvent closeEvent(QEvent::CloseSoftwareInputPanel);
|
QEvent closeEvent(QEvent::CloseSoftwareInputPanel);
|
||||||
if (qApp) {
|
if (qApp) {
|
||||||
if (QGraphicsView *view = qobject_cast<QGraphicsView*>(qApp->focusWidget())) {
|
if (QGraphicsView *view = qobject_cast<QGraphicsView*>(qApp->focusWidget())) {
|
||||||
|
|
|
@ -70,7 +70,6 @@ public:
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void changeEvent(QEvent *event);
|
void changeEvent(QEvent *event);
|
||||||
void mousePressEvent(QGraphicsSceneMouseEvent *event);
|
|
||||||
void focusOutEvent(QFocusEvent *event);
|
void focusOutEvent(QFocusEvent *event);
|
||||||
|
|
||||||
public Q_SLOTS:
|
public Q_SLOTS:
|
||||||
|
|
|
@ -126,36 +126,8 @@ void TextEdit::changeEvent(QEvent *event)
|
||||||
QGraphicsProxyWidget::changeEvent(event);
|
QGraphicsProxyWidget::changeEvent(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
void TextEdit::mousePressEvent(QGraphicsSceneMouseEvent *event)
|
|
||||||
{
|
|
||||||
QGraphicsWidget *widget = parentWidget();
|
|
||||||
Plasma::Applet *applet = qobject_cast<Plasma::Applet *>(widget);
|
|
||||||
|
|
||||||
while (!applet && widget) {
|
|
||||||
widget = widget->parentWidget();
|
|
||||||
applet = qobject_cast<Plasma::Applet *>(widget);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (applet) {
|
|
||||||
applet->setStatus(Plasma::AcceptingInputStatus);
|
|
||||||
}
|
|
||||||
QGraphicsProxyWidget::mousePressEvent(event);
|
|
||||||
}
|
|
||||||
|
|
||||||
void TextEdit::focusOutEvent(QFocusEvent *event)
|
void TextEdit::focusOutEvent(QFocusEvent *event)
|
||||||
{
|
{
|
||||||
QGraphicsWidget *widget = parentWidget();
|
|
||||||
Plasma::Applet *applet = qobject_cast<Plasma::Applet *>(widget);
|
|
||||||
|
|
||||||
while (!applet && widget) {
|
|
||||||
widget = widget->parentWidget();
|
|
||||||
applet = qobject_cast<Plasma::Applet *>(widget);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (applet) {
|
|
||||||
applet->setStatus(Plasma::UnknownStatus);
|
|
||||||
}
|
|
||||||
|
|
||||||
QEvent closeEvent(QEvent::CloseSoftwareInputPanel);
|
QEvent closeEvent(QEvent::CloseSoftwareInputPanel);
|
||||||
if (qApp) {
|
if (qApp) {
|
||||||
if (QGraphicsView *view = qobject_cast<QGraphicsView*>(qApp->focusWidget())) {
|
if (QGraphicsView *view = qobject_cast<QGraphicsView*>(qApp->focusWidget())) {
|
||||||
|
|
|
@ -96,7 +96,6 @@ Q_SIGNALS:
|
||||||
protected:
|
protected:
|
||||||
void changeEvent(QEvent *event);
|
void changeEvent(QEvent *event);
|
||||||
void contextMenuEvent(QGraphicsSceneContextMenuEvent *event);
|
void contextMenuEvent(QGraphicsSceneContextMenuEvent *event);
|
||||||
void mousePressEvent(QGraphicsSceneMouseEvent *event);
|
|
||||||
void focusOutEvent(QFocusEvent *event);
|
void focusOutEvent(QFocusEvent *event);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
Loading…
Add table
Reference in a new issue