Merge lp://qastaging/~nick-dedekind/unity/dash-results.focus+size into lp://qastaging/unity

Proposed by Nick Dedekind
Status: Merged
Approved by: Michal Hruby
Approved revision: no longer in the source branch.
Merged at revision: 2687
Proposed branch: lp://qastaging/~nick-dedekind/unity/dash-results.focus+size
Merge into: lp://qastaging/unity
Diff against target: 356 lines (+56/-128)
4 files modified
dash/ResultRendererTile.cpp (+34/-120)
dash/ResultRendererTile.h (+0/-4)
unity-shared/DashStyle.cpp (+18/-3)
unity-shared/DashStyle.h (+4/-1)
To merge this branch: bzr merge lp://qastaging/~nick-dedekind/unity/dash-results.focus+size
Reviewer Review Type Date Requested Status
Andrea Azzarone (community) Needs Fixing
John Lea (community) design Approve
Michal Hruby (community) Approve
Review via email: mp+123747@code.qastaging.launchpad.net

Commit message

Updated dash result highlight focus to 106x106 pixels with 20% white opacity. Increased dash result file image size to 96x96.

Description of the change

Updated dash result highlight focus to 106x106 pixels with 20% white opacity. Increased dash result file image size to 96x96.

To post a comment you must log in.
Revision history for this message
Andrea Azzarone (azzar1) wrote :

45 - if (container->blurred_icon && state == ResultRendererState::RESULT_RENDERER_NORMAL)
46 - {
47 - GfxContext.QRP_1Tex(icon_left_hand_side - 5 - x_offset,
48 - icon_top_side - 5 - y_offset,
49 - container->blurred_icon->GetWidth(),
50 - container->blurred_icon->GetHeight(),
51 - container->blurred_icon->GetDeviceTexture(),
52 - texxform,
53 - nux::Color(0.15f, 0.15f, 0.15f, 0.15f));
54 - }

Why have you removed this code?

g_str_has_prefix(icon_name.c_str(), "/") ? style.GetTileImageSize() : style.GetTileGIconSize()

g_str_has_prefix returns a gboolean. Maybe I'm wrong but with a gboolean it is preferable to check if value is == FALSE or != FALSE.

gboolean var;
...
if (var != FALSE)
{
 /* 1 */
}
else
{
 /* 2 */
}

or

if (!var)
{
  /* 2 */
}
else
{
 /* 1 */
}

Also provide screenshot for the design review.

review: Needs Information
Revision history for this message
Nick Dedekind (nick-dedekind) wrote :

Re the removal of code; design don't want the blur on the icon any more.

As to the gboolean==TRUE/FALSE, Technically I don't think it matters unless someday glib decides to change it's #defs.
But I can change it for readabilities sake.

Revision history for this message
Andrea Azzarone (azzar1) wrote :

> Re the removal of code; design don't want the blur on the icon any more.

We no longer need container->blurred_icon right? Can you remove the defination too?

>
> As to the gboolean==TRUE/FALSE, Technically I don't think it matters unless
> someday glib decides to change it's #defs.
> But I can change it for readabilities sake.

I was partially wrong. You should not do == TRUE but == true is fine.

Revision history for this message
Michal Hruby (mhr3) wrote :

> > As to the gboolean==TRUE/FALSE, Technically I don't think it matters unless
> > someday glib decides to change it's #defs.
> > But I can change it for readabilities sake.
>
> I was partially wrong. You should not do == TRUE but == true is fine.

FALSE equals 0, so using ternary operator is fine. The only dangerous op is `gboolean_var == true ?`, which is never true.

Revision history for this message
Andrea Azzarone (azzar1) wrote :

> > > As to the gboolean==TRUE/FALSE, Technically I don't think it matters
> unless
> > > someday glib decides to change it's #defs.
> > > But I can change it for readabilities sake.
> >
> > I was partially wrong. You should not do == TRUE but == true is fine.
>
> FALSE equals 0, so using ternary operator is fine. The only dangerous op is
> `gboolean_var == true ?`, which is never true.

From https://lists.launchpad.net/unity-dev/msg00231.html

«bool bool_test = 42;
gboolean g_test = 42;

bool_test == true -> true // 42 is converted to true at assignment time
g_test == TRUE -> false
g_test == FALSE -> false
bool(g_test) -> true

if statements and assignment to bool will implicitly cast the gboolean to a bool. This uses the standard definition for true and false, and as such, a value like 42 is considered true.

If you feel like you really must check for a value, please check for FALSE, or != FALSE. This is the only true safe way to check an integral value for "true".»

Btw in this case the function returns a gboolean so there is no problem at all.

Revision history for this message
Michal Hruby (mhr3) wrote :

FWIW the gboolean issue is solved by my branch that deps on this (and removes the call completely). Approving.

review: Approve
Revision history for this message
John Lea (johnlea) :
review: Approve (design)
Revision history for this message
Unity Merger (unity-merger) wrote :

The Jenkins job https://jenkins.qa.ubuntu.com/job/automerge-unity/1278/console reported an error when processing this lp:~nick-dedekind/unity/dash-results.focus+size branch.
Not merging it.

Revision history for this message
Unity Merger (unity-merger) wrote :

The Jenkins job https://jenkins.qa.ubuntu.com/job/automerge-unity/1279/console reported an error when processing this lp:~nick-dedekind/unity/dash-results.focus+size branch.
Not merging it.

Revision history for this message
Unity Merger (unity-merger) wrote :

The Jenkins job https://jenkins.qa.ubuntu.com/job/automerge-unity/1281/console reported an error when processing this lp:~nick-dedekind/unity/dash-results.focus+size branch.
Not merging it.

Revision history for this message
Unity Merger (unity-merger) wrote :

The Jenkins job https://jenkins.qa.ubuntu.com/job/automerge-unity/1283/console reported an error when processing this lp:~nick-dedekind/unity/dash-results.focus+size branch.
Not merging it.

Revision history for this message
Andrea Azzarone (azzar1) wrote :

Please remove BaseTexturePtr blurred_icon declaration.

review: Needs Fixing

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.