[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-devel
Subject: Re: [KSudoku] Background color problem
From: "=?ISO-8859-1?Q?Percy_Camilo_Trive=F1o_Aucahuasi?=" <orgyforever () gmail ! com>
Date: 2008-05-31 5:54:17
Message-ID: 579229230805302254j7ab17753nec89ff9f240a4955 () mail ! gmail ! com
[Download RAW message or body]
[Attachment #2 (multipart/alternative)]
Sorry, here is the patch ; )
On Sat, May 31, 2008 at 12:41 AM, Percy Camilo Triveņo Aucahuasi <
orgyforever@gmail.com> wrote:
> Hi all, when I change the color style of my desktop, then the simbols in
> KSudoku dissapears, check this screenshots:
>
> Default look:
> http://www.imagehosting.com/show.php/1769977_whitewndcolorsettings.png.html
>
> Problem:
> http://www.imagehosting.com/show.php/1769975_blackwndcolorsettings.png.html
>
>
> This patch solved that problem. This is the screenshot with the patch:
>
> http://www.imagehosting.com/show.php/1769976_solved.png.html
>
> In the patch I'm using this lines to obtain the base color of the window:
>
> //********************************
> KColorScheme systemColorScheme(QPalette::Active);
> QColor baseWndColor =
> systemColorScheme.background(KColorScheme::NormalBackground).color();
> int luminance = 0.2126*baseWndColor.red() + 0.7152*baseWndColor.green() +
> 0.0722*baseWndColor.blue();
> if (luminance > (255 / 2.0))
> // set the color font/brush to black
> else
> // set the color font/brush to white
> //********************************
>
> Is that ok? or there is a better way?
>
> If it's ok ... may I commit? ; )
>
> Cheers,
> Percy
>
> pd: btw I already reported: http://bugs.kde.org/show_bug.cgi?id=162832
>
>
>
[Attachment #5 (text/html)]
Sorry, here is the patch ; )<br><br><div class="gmail_quote">On Sat, May 31, 2008 at \
12:41 AM, Percy Camilo Triveņo Aucahuasi <<a \
href="mailto:orgyforever@gmail.com">orgyforever@gmail.com</a>> \
wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, \
204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"> Hi all, when I change the color \
style of my desktop, then the simbols in KSudoku dissapears, check this \
screenshots:<br><br>Default look:<br><a \
href="http://www.imagehosting.com/show.php/1769977_whitewndcolorsettings.png.html" \
target="_blank">http://www.imagehosting.com/show.php/1769977_whitewndcolorsettings.png.html</a><br>
<br>Problem:<br><a href="http://www.imagehosting.com/show.php/1769975_blackwndcolorsettings.png.html" \
target="_blank">http://www.imagehosting.com/show.php/1769975_blackwndcolorsettings.png.html</a><br><br><br>This \
patch solved that problem. This is the screenshot with the patch:<br>
<br><a href="http://www.imagehosting.com/show.php/1769976_solved.png.html" \
target="_blank">http://www.imagehosting.com/show.php/1769976_solved.png.html</a><br><br>In \
the patch I'm using this lines to obtain the base color of the window:<br>
<br>//********************************<br>KColorScheme \
systemColorScheme(QPalette::Active);<br>QColor baseWndColor = \
systemColorScheme.background(KColorScheme::NormalBackground).color();<br>int \
luminance = 0.2126*baseWndColor.red() + 0.7152*baseWndColor.green() + \
0.0722*baseWndColor.blue();<br>
if (luminance > (255 / 2.0))<br>// set the color font/brush to black<br>else<br>// \
set the color font/brush to white<br>//********************************<br><br>Is \
that ok? or there is a better way?<br><br>If it's ok ... may I commit? ; )<br>
<br>Cheers,<br>Percy<br><br>pd: btw I already reported: <a \
href="http://bugs.kde.org/show_bug.cgi?id=162832" \
target="_blank">http://bugs.kde.org/show_bug.cgi?id=162832</a><br><br><br> \
</blockquote></div><br>
["valuelistwidget.diff" (text/x-diff)]
--- patchs/valuelistwidget.cpp 2008-05-31 00:09:09.000000000 -0500
+++ kde/src/KDE/kdegames/ksudoku/src/gui/views/valuelistwidget.cpp 2008-05-31 \
00:44:38.000000000 -0500 @@ -24,7 +24,6 @@
#include <QGraphicsSimpleTextItem>
#include <QWheelEvent>
-#include <KColorScheme>
namespace ksudoku {
@@ -32,19 +31,6 @@
: QGraphicsItem(parent, scene)
{
m_text = new QGraphicsSimpleTextItem(symbol, this, scene);
-
-///
- KColorScheme systemColorScheme(QPalette::Active);
- QColor baseWndColor = \
systemColorScheme.background(KColorScheme::NormalBackground).color();
-
- int luminance = 0.2126*baseWndColor.red() + 0.7152*baseWndColor.green() + \
0.0722*baseWndColor.blue();
-
- if (luminance > (255 / 2.0))
- m_text->setBrush(Qt::black);
- else
- m_text->setBrush(Qt::white);
-///
-
setSize(10);
}
@@ -109,23 +95,7 @@
m_selectionItem = new QGraphicsRectItem(-4.5, 0.5, 9, 9, 0, m_scene);
m_selectionItem->setPos(0, 0);
-
-///
- KColorScheme systemColorScheme(QPalette::Active);
- QColor baseWndColor = \
systemColorScheme.background(KColorScheme::NormalBackground).color();
-
- int luminance = 0.2126*baseWndColor.red() + 0.7152*baseWndColor.green() + \
0.0722*baseWndColor.blue();
-
- QPen pen;
-
- if (luminance > (255 / 2.0))
- pen.setColor(Qt::black);
- else
- pen.setColor(Qt::white);
-
- dynamic_cast< QGraphicsRectItem * >(m_selectionItem)->setPen(pen);
-///
-
+
m_maxValue = 1;
m_selectedValue = 1;
}
>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic