This commit is contained in:
Jaroslav Reznik 2012-05-26 01:14:10 +02:00
parent 00c981f7d6
commit 0327978449
8 changed files with 7 additions and 273 deletions

1
.gitignore vendored
View File

@ -1,2 +1,3 @@
/kdelibs-4.6.5.tar.bz2
/kdelibs-4.8.3.tar.xz
/kdelibs-4.8.80.tar.xz

View File

@ -1,103 +0,0 @@
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&amp;a=commitdiff&amp;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

View File

@ -1,37 +0,0 @@
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&amp;a=commitdiff&amp;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);

View File

@ -1,22 +0,0 @@
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&amp;a=commitdiff&amp;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;

View File

@ -1,54 +0,0 @@
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&amp;a=commitdiff&amp;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;

View File

@ -1,42 +0,0 @@
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&amp;a=commitdiff&amp;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;

View File

@ -24,8 +24,8 @@
%global dbusmenu_qt_version %(pkg-config --modversion dbusmenu-qt 2>/dev/null || echo %{dbusmenu_qt_ver})
Summary: KDE Libraries
Version: 4.8.3
Release: 4%{?dist}
Version: 4.8.80
Release: 1%{?dist}
Name: kdelibs
Epoch: 6
@ -146,13 +146,6 @@ Patch53: kdelibs-4.7.2-kjs-s390.patch
# fix kdeclarative install location (by wstephenson as found in kde-packager list)
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
# Not Upstreamed? why not ? -- Rex
Patch200: kdelibs-4.3.1-CVE-2009-2702.patch
@ -362,11 +355,6 @@ popd
# 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
%patch200 -p1 -b .CVE-2009-2702
@ -622,6 +610,9 @@ rm -rf %{buildroot}
%changelog
* Fri May 25 2012 Jaroslav Reznik <jreznik@redhat.com> - 6:4.8.80-1
- 4.8.80
* Fri May 25 2012 Rex Dieter <rdieter@fedoraproject.org>
- 6:4.8.3-4
- include upstream kmessagewidget fixes

View File

@ -1 +1 @@
c4987c838164bd9ee2787e77243fe4a9 kdelibs-4.8.3.tar.xz
f9f753f099175fad0cdb6424fb396e47 kdelibs-4.8.80.tar.xz