Merge lp:~larochelle-brian/unity/SwitcherView-Font-resubmit into lp:unity

Proposed by brian larochelle
Status: Work in progress
Proposed branch: lp:~larochelle-brian/unity/SwitcherView-Font-resubmit
Merge into: lp:unity
Diff against target: 38 lines (+3/-4)
1 file modified
launcher/SwitcherView.cpp (+3/-4)
To merge this branch: bzr merge lp:~larochelle-brian/unity/SwitcherView-Font-resubmit
Reviewer Review Type Date Requested Status
Andrea Azzarone Pending
Review via email: mp+174524@code.launchpad.net

Description of the change

revised per andyrock's suggestions. based on new cleaner unity branch. removing original proposed branch

To post a comment you must log in.
Revision history for this message
Marco Trevisan (Treviño) (3v1n0) wrote :

This is fine, but would you mind to add a new field to StaticCairo text to define font size and then use pango_font_description_set_size in GetTextExtents and DrawText to, in case it's valid, override the given value?

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

> This is fine, but would you mind to add a new field to StaticCairo text to
> define font size and then use pango_font_description_set_size in
> GetTextExtents and DrawText to, in case it's valid, override the given value?

Don't ask too much Marco :D

Hey Brian, I don't like code duplication of

text_view_->SetText("<span font='10'><b>" + selection->tooltip_text() + "</b></span>");

Can you remove it? Move it in a function for example ;)

Revision history for this message
brian larochelle (larochelle-brian) wrote :

Andrea - sure, np. I'd like to learn as much as I can, so I'd like to poke around with Marco's suggestions first.
thanks :)

Revision history for this message
Christopher Townsend (townsend) wrote :

Hi Brian,

I'm going to set the Status to "Work in progress". When you are ready, please set the status back to "Needs review".

Thanks!

Unmerged revisions

3426. By brian larochelle

alt+tab switches doesn't follow system font.
remove SetFont, and wrap text with size and bold in html <span> tags, hardcoded
to 10 and bold.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'launcher/SwitcherView.cpp'
2--- launcher/SwitcherView.cpp 2013-06-14 00:23:34 +0000
3+++ launcher/SwitcherView.cpp 2013-07-13 03:26:25 +0000
4@@ -63,7 +63,6 @@
5 text_view_->SetMaximumWidth(tile_size * spread_size);
6 text_view_->SetLines(1);
7 text_view_->SetTextColor(nux::color::White);
8- text_view_->SetFont("Ubuntu Bold 10");
9
10 icon_size.changed.connect (sigc::mem_fun (this, &SwitcherView::OnIconSizeChanged));
11 tile_size.changed.connect (sigc::mem_fun (this, &SwitcherView::OnTileSizeChanged));
12@@ -124,7 +123,7 @@
13 text_view_->SetVisible(!model->detail_selection);
14
15 if (!model->detail_selection)
16- text_view_->SetText(model->Selection()->tooltip_text());
17+ text_view_->SetText("<span font='10'><b>" + model->Selection()->tooltip_text() + "</b></span>");
18 }
19
20 void SwitcherView::OnIconSizeChanged (int size)
21@@ -169,7 +168,7 @@
22
23 if (!detail)
24 {
25- text_view_->SetText(model_->Selection()->tooltip_text());
26+ text_view_->SetText("<span font='10'><b>" + model_->Selection()->tooltip_text() + "</b></span>");
27 render_targets_.clear();
28 }
29
30@@ -180,7 +179,7 @@
31 void SwitcherView::OnSelectionChanged(AbstractLauncherIcon::Ptr const& selection)
32 {
33 if (selection)
34- text_view_->SetText(selection->tooltip_text());
35+ text_view_->SetText("<span font='10'><b>" + selection->tooltip_text() + "</b></span>");
36
37 SaveLast();
38 QueueDraw();