Merge lp:~grindhold/sakura/fading_addendum into lp:~dabisu/sakura/sakura

Proposed by grindhold
Status: Merged
Merge reported by: David Gómez
Merged at revision: not available
Proposed branch: lp:~grindhold/sakura/fading_addendum
Merge into: lp:~dabisu/sakura/sakura
Diff against target: 74 lines (+37/-15)
1 file modified
src/sakura.c (+37/-15)
To merge this branch: bzr merge lp:~grindhold/sakura/fading_addendum
Reviewer Review Type Date Requested Status
David Gómez Approve
Review via email: mp+299621@code.launchpad.net

Description of the change

i modified my fading feature, so it works with light themes, too
before it only worked with dark themes :/

To post a comment you must log in.
Revision history for this message
David Gómez (dabisu) :
review: Approve
Revision history for this message
David Gómez (dabisu) wrote :

Thanks! Merged.

Revision history for this message
David Gómez (dabisu) wrote :

Could you check it the last version in the repository? Fading was working ok before but now it seems some recent change has broke it.

Revision history for this message
grindhold (grindhold) wrote :

On 10/07/2016 07:42 PM, David Gómez wrote:
> Could you check it the last version in the repository? Fading was working ok before but now it seems some recent change has broke it.

ahrgs. okay, i'll investigate when i have time. right now i have tasks
for two libraries on my agenda. thanks for the hint.

have a nice weekend

Revision history for this message
David Gómez (dabisu) wrote :

Thanks, no hurry. I was looking at it myself but couldn't find the problem.
I'll give it another shot when i have more time and i'm not so sleepy.

On Fri, Oct 7, 2016 at 8:21 PM, grindhold <email address hidden> wrote:

> On 10/07/2016 07:42 PM, David Gómez wrote:
> > Could you check it the last version in the repository? Fading was
> working ok before but now it seems some recent change has broke it.
>
> ahrgs. okay, i'll investigate when i have time. right now i have tasks
> for two libraries on my agenda. thanks for the hint.
>
> have a nice weekend
>
>
> --
> https://code.launchpad.net/~grindhold/sakura/fading_addendum/+merge/299621
> You are reviewing the proposed merge of lp:~grindhold/sakura/fading_addendum
> into lp:sakura.
>

--

David Gómez

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/sakura.c'
2--- src/sakura.c 2016-07-07 10:20:41 +0000
3+++ src/sakura.c 2016-07-09 21:39:36 +0000
4@@ -43,7 +43,7 @@
5 #define _(String) gettext(String)
6 #define N_(String) (String)
7 #define GETTEXT_PACKAGE "sakura"
8-#define FADE_PERCENT 50
9+#define FADE_PERCENT 60
10
11 #define SAY(format,...) do {\
12 if (strcmp("Debug", BUILDTYPE)==0) {\
13@@ -1325,25 +1325,47 @@
14 static void
15 sakura_fade_out()
16 {
17- for( int i=0; i<NUM_COLORSETS; i++) {
18- GdkRGBA x = sakura.forecolors[i];
19- x.red = x.red/100.0 * FADE_PERCENT;
20- x.green = x.green/100.0 * FADE_PERCENT;
21- x.blue = x.blue/100.0 * FADE_PERCENT;
22- sakura.forecolors[i]=x;
23- }
24+ GdkRGBA x = sakura.forecolors[sakura.last_colorset-1];
25+ if( (x.red + x.green + x.blue) / 3.0 > 0.5) {
26+ for( int i=0; i<NUM_COLORSETS; i++) {
27+ GdkRGBA x = sakura.forecolors[i];
28+ x.red = x.red/100.0 * FADE_PERCENT;
29+ x.green = x.green/100.0 * FADE_PERCENT;
30+ x.blue = x.blue/100.0 * FADE_PERCENT;
31+ sakura.forecolors[i]=x;
32+ }
33+ } else {
34+ for( int i=0; i<NUM_COLORSETS; i++) {
35+ GdkRGBA x = sakura.forecolors[i];
36+ x.red = 1.0-x.red/100.0 * FADE_PERCENT;
37+ x.green = 1.0-x.green/100.0 * FADE_PERCENT;
38+ x.blue = 1.0-x.blue/100.0 * FADE_PERCENT;
39+ sakura.forecolors[i]=x;
40+ }
41+ }
42 }
43
44 static void
45 sakura_fade_in()
46 {
47- for( int i=0; i<NUM_COLORSETS; i++) {
48- GdkRGBA x = sakura.forecolors[i];
49- x.red = x.red/FADE_PERCENT * 100.0;
50- x.green = x.green/FADE_PERCENT * 100.0;
51- x.blue = x.blue/FADE_PERCENT * 100.0;
52- sakura.forecolors[i]=x;
53- }
54+ GdkRGBA x = sakura.forecolors[sakura.last_colorset-1];
55+ if( (x.red + x.green + x.blue) / 3.0 > 0.5) {
56+ for( int i=0; i<NUM_COLORSETS; i++) {
57+ GdkRGBA x = sakura.forecolors[i];
58+ x.red = x.red/FADE_PERCENT * 100.0;
59+ x.green = x.green/FADE_PERCENT * 100.0;
60+ x.blue = x.blue/FADE_PERCENT * 100.0;
61+ sakura.forecolors[i]=x;
62+ }
63+ } else {
64+ for( int i=0; i<NUM_COLORSETS; i++) {
65+ GdkRGBA x = sakura.forecolors[i];
66+ x.red = 1.0-x.red/FADE_PERCENT * 100.0;
67+ x.green = 1.0-x.green/FADE_PERCENT * 100.0;
68+ x.blue = 1.0-x.blue/FADE_PERCENT * 100.0;
69+ sakura.forecolors[i]=x;
70+ }
71+ }
72 }
73
74 static void

Subscribers

People subscribed via source and target branches