6:4.8.3-4
- include upstream kmessagewidget fixes - apply kdeclarative-install-location.patch
This commit is contained in:
parent
a183fa3b6b
commit
00c981f7d6
103
kdelibs-4.8.3-kmessagewidget_colors.patch
Normal file
103
kdelibs-4.8.3-kmessagewidget_colors.patch
Normal file
@ -0,0 +1,103 @@
|
|||||||
|
From: Aurélien Gâteau <agateau@kde.org>
|
||||||
|
Date: Mon, 30 Apr 2012 10:21:15 +0000
|
||||||
|
Subject: Rework colors to avoid white-on-black information widgets and flat backgrounds
|
||||||
|
X-Git-Url: http://quickgit.kde.org/?p=kdelibs.git&a=commitdiff&h=678d7190dd27c0c0a7f7757cd16b1ec0febbdf96
|
||||||
|
---
|
||||||
|
Rework colors to avoid white-on-black information widgets and flat backgrounds
|
||||||
|
---
|
||||||
|
|
||||||
|
|
||||||
|
--- a/kdeui/widgets/kmessagewidget.cpp
|
||||||
|
+++ b/kdeui/widgets/kmessagewidget.cpp
|
||||||
|
@@ -218,55 +218,66 @@ KMessageWidget::MessageType KMessageWidg
|
||||||
|
return d->messageType;
|
||||||
|
}
|
||||||
|
|
||||||
|
+static void getColorsFromColorScheme(KColorScheme::BackgroundRole bgRole, QColor* bg, QColor* fg)
|
||||||
|
+{
|
||||||
|
+ KColorScheme scheme(QPalette::Active, KColorScheme::Window);
|
||||||
|
+ *bg = scheme.background(bgRole).color();
|
||||||
|
+ *fg = scheme.foreground().color();
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
void KMessageWidget::setMessageType(KMessageWidget::MessageType type)
|
||||||
|
{
|
||||||
|
d->messageType = type;
|
||||||
|
KIcon icon;
|
||||||
|
- KColorScheme::BackgroundRole bgRole;
|
||||||
|
- KColorScheme::ForegroundRole fgRole;
|
||||||
|
- KColorScheme::ColorSet colorSet = KColorScheme::Window;
|
||||||
|
+ QColor bg0, bg1, bg2, border, fg;
|
||||||
|
switch (type) {
|
||||||
|
case Positive:
|
||||||
|
icon = KIcon("dialog-ok");
|
||||||
|
- bgRole = KColorScheme::PositiveBackground;
|
||||||
|
- fgRole = KColorScheme::PositiveText;
|
||||||
|
+ getColorsFromColorScheme(KColorScheme::PositiveBackground, &bg1, &fg);
|
||||||
|
break;
|
||||||
|
case Information:
|
||||||
|
icon = KIcon("dialog-information");
|
||||||
|
- bgRole = KColorScheme::NormalBackground;
|
||||||
|
- fgRole = KColorScheme::NormalText;
|
||||||
|
- colorSet = KColorScheme::Tooltip;
|
||||||
|
+ // There is no "information" background role in KColorScheme, use the
|
||||||
|
+ // colors of highlighted items instead
|
||||||
|
+ bg1 = palette().highlight().color();
|
||||||
|
+ fg = palette().highlightedText().color();
|
||||||
|
break;
|
||||||
|
case Warning:
|
||||||
|
icon = KIcon("dialog-warning");
|
||||||
|
- bgRole = KColorScheme::NeutralBackground;
|
||||||
|
- fgRole = KColorScheme::NeutralText;
|
||||||
|
+ getColorsFromColorScheme(KColorScheme::NeutralBackground, &bg1, &fg);
|
||||||
|
break;
|
||||||
|
case Error:
|
||||||
|
icon = KIcon("dialog-error");
|
||||||
|
- bgRole = KColorScheme::NegativeBackground;
|
||||||
|
- fgRole = KColorScheme::NegativeText;
|
||||||
|
+ getColorsFromColorScheme(KColorScheme::NegativeBackground, &bg1, &fg);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
- const int size = KIconLoader::global()->currentSize(KIconLoader::MainToolbar);
|
||||||
|
- d->iconLabel->setPixmap(icon.pixmap(size));
|
||||||
|
|
||||||
|
- KColorScheme scheme(QPalette::Active, colorSet);
|
||||||
|
- QBrush bg = scheme.background(bgRole);
|
||||||
|
- QBrush border = scheme.foreground(fgRole);
|
||||||
|
- QBrush fg = scheme.foreground();
|
||||||
|
+ // Colors
|
||||||
|
+ bg0 = bg1.lighter(110);
|
||||||
|
+ bg2 = bg1.darker(110);
|
||||||
|
+ border = KColorScheme::shade(bg1, KColorScheme::DarkShade);
|
||||||
|
+
|
||||||
|
d->content->setStyleSheet(
|
||||||
|
QString(".QFrame {"
|
||||||
|
- "background-color: %1;"
|
||||||
|
+ "background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,"
|
||||||
|
+ " stop: 0 %1,"
|
||||||
|
+ " stop: 0.1 %2,"
|
||||||
|
+ " stop: 1.0 %3);"
|
||||||
|
"border-radius: 5px;"
|
||||||
|
- "border: 1px solid %2;"
|
||||||
|
+ "border: 1px solid %4;"
|
||||||
|
"}"
|
||||||
|
- ".QLabel { color: %3; }"
|
||||||
|
+ ".QLabel { color: %5; }"
|
||||||
|
)
|
||||||
|
- .arg(bg.color().name())
|
||||||
|
- .arg(border.color().name())
|
||||||
|
- .arg(fg.color().name())
|
||||||
|
+ .arg(bg0.name())
|
||||||
|
+ .arg(bg1.name())
|
||||||
|
+ .arg(bg2.name())
|
||||||
|
+ .arg(border.name())
|
||||||
|
+ .arg(fg.name())
|
||||||
|
);
|
||||||
|
+
|
||||||
|
+ // Icon
|
||||||
|
+ const int size = KIconLoader::global()->currentSize(KIconLoader::MainToolbar);
|
||||||
|
+ d->iconLabel->setPixmap(icon.pixmap(size));
|
||||||
|
}
|
||||||
|
|
||||||
|
QSize KMessageWidget::sizeHint() const
|
||||||
|
|
37
kdelibs-4.8.3-kmessagewidget_heightForWidth.patch
Normal file
37
kdelibs-4.8.3-kmessagewidget_heightForWidth.patch
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
From: Aurélien Gâteau <agateau@kde.org>
|
||||||
|
Date: Sun, 29 Apr 2012 14:07:50 +0000
|
||||||
|
Subject: Implement KMessageWidget::heightForWidth
|
||||||
|
X-Git-Url: http://quickgit.kde.org/?p=kdelibs.git&a=commitdiff&h=76309dd8062862f977e3ebb1f6646af7117a816a
|
||||||
|
---
|
||||||
|
Implement KMessageWidget::heightForWidth
|
||||||
|
---
|
||||||
|
|
||||||
|
|
||||||
|
--- a/kdeui/widgets/kmessagewidget.cpp
|
||||||
|
+++ b/kdeui/widgets/kmessagewidget.cpp
|
||||||
|
@@ -301,6 +301,12 @@ void KMessageWidget::resizeEvent(QResize
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
+int KMessageWidget::heightForWidth(int width) const
|
||||||
|
+{
|
||||||
|
+ ensurePolished();
|
||||||
|
+ return d->content->heightForWidth(width);
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
void KMessageWidget::paintEvent(QPaintEvent* event)
|
||||||
|
{
|
||||||
|
QFrame::paintEvent(event);
|
||||||
|
|
||||||
|
--- a/kdeui/widgets/kmessagewidget.h
|
||||||
|
+++ b/kdeui/widgets/kmessagewidget.h
|
||||||
|
@@ -131,6 +131,8 @@ public:
|
||||||
|
|
||||||
|
QSize minimumSizeHint() const;
|
||||||
|
|
||||||
|
+ int heightForWidth(int width) const;
|
||||||
|
+
|
||||||
|
public Q_SLOTS:
|
||||||
|
void setText(const QString &text);
|
||||||
|
|
||||||
|
|
22
kdelibs-4.8.3-kmessagewidget_icon_position.patch
Normal file
22
kdelibs-4.8.3-kmessagewidget_icon_position.patch
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
From: Aurélien Gâteau <agateau@kde.org>
|
||||||
|
Date: Mon, 30 Apr 2012 10:26:55 +0000
|
||||||
|
Subject: Fix icon position
|
||||||
|
X-Git-Url: http://quickgit.kde.org/?p=kdelibs.git&a=commitdiff&h=6e7ce4b0462d52aa72184813a399c6751aa8d391
|
||||||
|
---
|
||||||
|
Fix icon position
|
||||||
|
---
|
||||||
|
|
||||||
|
|
||||||
|
--- a/kdeui/widgets/kmessagewidget.cpp
|
||||||
|
+++ b/kdeui/widgets/kmessagewidget.cpp
|
||||||
|
@@ -116,7 +116,8 @@ void KMessageWidgetPrivate::createLayout
|
||||||
|
|
||||||
|
if (wordWrap) {
|
||||||
|
QGridLayout* layout = new QGridLayout(content);
|
||||||
|
- layout->addWidget(iconLabel, 0, 0);
|
||||||
|
+ // Set alignment to make sure icon does not move down if text wraps
|
||||||
|
+ layout->addWidget(iconLabel, 0, 0, 1, 1, Qt::AlignHCenter | Qt::AlignTop);
|
||||||
|
layout->addWidget(textLabel, 0, 1);
|
||||||
|
|
||||||
|
QHBoxLayout* buttonLayout = new QHBoxLayout;
|
||||||
|
|
54
kdelibs-4.8.3-kmessagewidget_resizeEvent.patch
Normal file
54
kdelibs-4.8.3-kmessagewidget_resizeEvent.patch
Normal file
@ -0,0 +1,54 @@
|
|||||||
|
From: Aurélien Gâteau <agateau@kde.org>
|
||||||
|
Date: Sun, 29 Apr 2012 14:07:21 +0000
|
||||||
|
Subject: Correctly resize KMessageWidget content in resizeEvent
|
||||||
|
X-Git-Url: http://quickgit.kde.org/?p=kdelibs.git&a=commitdiff&h=353beb7a7b6000a44d97c0447ab1169bbc8662f2
|
||||||
|
---
|
||||||
|
Correctly resize KMessageWidget content in resizeEvent
|
||||||
|
---
|
||||||
|
|
||||||
|
|
||||||
|
--- a/kdeui/widgets/kmessagewidget.cpp
|
||||||
|
+++ b/kdeui/widgets/kmessagewidget.cpp
|
||||||
|
@@ -293,7 +293,11 @@ void KMessageWidget::resizeEvent(QResize
|
||||||
|
{
|
||||||
|
QFrame::resizeEvent(event);
|
||||||
|
if (d->timeLine->state() == QTimeLine::NotRunning) {
|
||||||
|
- d->content->resize(size());
|
||||||
|
+ int contentHeight = d->content->heightForWidth(width());
|
||||||
|
+ if (contentHeight == -1) {
|
||||||
|
+ contentHeight = d->content->sizeHint().height();
|
||||||
|
+ }
|
||||||
|
+ d->content->resize(width(), contentHeight);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@@ -307,16 +311,6 @@ void KMessageWidget::paintEvent(QPaintEv
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
-void KMessageWidget::showEvent(QShowEvent* event)
|
||||||
|
-{
|
||||||
|
- QFrame::showEvent(event);
|
||||||
|
- if (!event->spontaneous()) {
|
||||||
|
- int wantedHeight = d->content->sizeHint().height();
|
||||||
|
- d->content->setGeometry(0, 0, width(), wantedHeight);
|
||||||
|
- setFixedHeight(wantedHeight);
|
||||||
|
- }
|
||||||
|
-}
|
||||||
|
-
|
||||||
|
bool KMessageWidget::wordWrap() const
|
||||||
|
{
|
||||||
|
return d->wordWrap;
|
||||||
|
|
||||||
|
--- a/kdeui/widgets/kmessagewidget.h
|
||||||
|
+++ b/kdeui/widgets/kmessagewidget.h
|
||||||
|
@@ -159,8 +159,6 @@ protected:
|
||||||
|
|
||||||
|
void resizeEvent(QResizeEvent *event);
|
||||||
|
|
||||||
|
- void showEvent(QShowEvent *event);
|
||||||
|
-
|
||||||
|
private:
|
||||||
|
KMessageWidgetPrivate *const d;
|
||||||
|
friend class KMessageWidgetPrivate;
|
||||||
|
|
42
kdelibs-4.8.3-kmessagewidget_unbreak_abi.patch
Normal file
42
kdelibs-4.8.3-kmessagewidget_unbreak_abi.patch
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
From: Aurélien Gâteau <agateau@kde.org>
|
||||||
|
Date: Tue, 01 May 2012 17:20:01 +0000
|
||||||
|
Subject: Unbreak binary compatibility
|
||||||
|
X-Git-Url: http://quickgit.kde.org/?p=kdelibs.git&a=commitdiff&h=dc217720bd685a30ef7914f09ab8c1e321b92c88
|
||||||
|
---
|
||||||
|
Unbreak binary compatibility
|
||||||
|
|
||||||
|
/me puts his head under a brown bag
|
||||||
|
|
||||||
|
CCMAIL: cgiboudeaux@gmx.com
|
||||||
|
---
|
||||||
|
|
||||||
|
|
||||||
|
--- a/kdeui/widgets/kmessagewidget.cpp
|
||||||
|
+++ b/kdeui/widgets/kmessagewidget.cpp
|
||||||
|
@@ -331,6 +331,13 @@ void KMessageWidget::paintEvent(QPaintEv
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
+void KMessageWidget::showEvent(QShowEvent* event)
|
||||||
|
+{
|
||||||
|
+ // Keep this method here to avoid breaking binary compatibility:
|
||||||
|
+ // QFrame::showEvent() used to be reimplemented.
|
||||||
|
+ QFrame::showEvent(event);
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
bool KMessageWidget::wordWrap() const
|
||||||
|
{
|
||||||
|
return d->wordWrap;
|
||||||
|
|
||||||
|
--- a/kdeui/widgets/kmessagewidget.h
|
||||||
|
+++ b/kdeui/widgets/kmessagewidget.h
|
||||||
|
@@ -161,6 +161,8 @@ protected:
|
||||||
|
|
||||||
|
void resizeEvent(QResizeEvent *event);
|
||||||
|
|
||||||
|
+ void showEvent(QShowEvent *event);
|
||||||
|
+
|
||||||
|
private:
|
||||||
|
KMessageWidgetPrivate *const d;
|
||||||
|
friend class KMessageWidgetPrivate;
|
||||||
|
|
20
kdelibs.spec
20
kdelibs.spec
@ -25,7 +25,7 @@
|
|||||||
|
|
||||||
Summary: KDE Libraries
|
Summary: KDE Libraries
|
||||||
Version: 4.8.3
|
Version: 4.8.3
|
||||||
Release: 3%{?dist}
|
Release: 4%{?dist}
|
||||||
|
|
||||||
Name: kdelibs
|
Name: kdelibs
|
||||||
Epoch: 6
|
Epoch: 6
|
||||||
@ -146,6 +146,13 @@ Patch53: kdelibs-4.7.2-kjs-s390.patch
|
|||||||
# fix kdeclarative install location (by wstephenson as found in kde-packager list)
|
# fix kdeclarative install location (by wstephenson as found in kde-packager list)
|
||||||
Patch100: kdelibs-4.8.3-kdeclarative-install-location.patch
|
Patch100: kdelibs-4.8.3-kdeclarative-install-location.patch
|
||||||
|
|
||||||
|
# a bunch of kmessagewidget fixes
|
||||||
|
Patch101: kdelibs-4.8.3-kmessagewidget_resizeEvent.patch
|
||||||
|
Patch102: kdelibs-4.8.3-kmessagewidget_heightForWidth.patch
|
||||||
|
Patch103: kdelibs-4.8.3-kmessagewidget_colors.patch
|
||||||
|
Patch104: kdelibs-4.8.3-kmessagewidget_icon_position.patch
|
||||||
|
Patch106: kdelibs-4.8.3-kmessagewidget_unbreak_abi.patch
|
||||||
|
|
||||||
## security fix
|
## security fix
|
||||||
# Not Upstreamed? why not ? -- Rex
|
# Not Upstreamed? why not ? -- Rex
|
||||||
Patch200: kdelibs-4.3.1-CVE-2009-2702.patch
|
Patch200: kdelibs-4.3.1-CVE-2009-2702.patch
|
||||||
@ -354,6 +361,12 @@ popd
|
|||||||
%patch53 -p1 -b .kjs-s390
|
%patch53 -p1 -b .kjs-s390
|
||||||
|
|
||||||
# upstream patches
|
# upstream patches
|
||||||
|
%patch100 -p1 -b .kdeclarative-install-location
|
||||||
|
%patch101 -p1 -b .kmessagewidget_resizeEvent
|
||||||
|
%patch102 -p1 -b .kmessagewidget_heightForWidth
|
||||||
|
%patch103 -p1 -b .kmessagewidget_colors
|
||||||
|
%patch104 -p1 -b .kmessagewidget_icon_position
|
||||||
|
%patch106 -p1 -b .kmessagewidget_unbreak_abi
|
||||||
|
|
||||||
# security fixes
|
# security fixes
|
||||||
%patch200 -p1 -b .CVE-2009-2702
|
%patch200 -p1 -b .CVE-2009-2702
|
||||||
@ -609,6 +622,11 @@ rm -rf %{buildroot}
|
|||||||
|
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Fri May 25 2012 Rex Dieter <rdieter@fedoraproject.org>
|
||||||
|
- 6:4.8.3-4
|
||||||
|
- include upstream kmessagewidget fixes
|
||||||
|
- apply kdeclarative-install-location.patch
|
||||||
|
|
||||||
* Thu May 24 2012 Lukas Tinkl <ltinkl@redhat.com> - 6:4.8.3-3
|
* Thu May 24 2012 Lukas Tinkl <ltinkl@redhat.com> - 6:4.8.3-3
|
||||||
- update the udisks2 backend patch, fixing some bugs with storage drives
|
- update the udisks2 backend patch, fixing some bugs with storage drives
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user