Lens button set narrow width which is needed
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Unity |
Fix Released
|
High
|
Andrea Azzarone | ||
unity (Ubuntu) |
Fix Released
|
High
|
Andrea Azzarone |
Bug Description
Lens button width is narrow rather than is needed, therefore parts
of button label are shortened and/or become unreadable in specific
text.
How to reproduce(easy):
1. Set locale to ja_JP.UTF-8 by language-selector
2. Open application lens by Super+A
3. Open "Filter results" ("結果の絞り込み" in Japanese)
4. Check label of top-left bottun
Expected result: "すべて" ("All" in English)
Actual result: "..."
How to reproduce(by recompile unity):
1. Replace _("All") to _("XXXXX") at 2 places
in plugins/
2. Recompile unity
3. Open application lens by Super+A
4. Open "Filter results"
5. Check label of top-left bottun
Expected result:
"XXXXX" (Because there is enough space, shouldn't shorten label)
Actual result: "XXX..."
And if you set more long label, **always** is shortened "about two
characters". For example, "XXXXXYYYYY"(10 chars) is rendered as
"XXXXXYY...".
Tanaka and Akabe reported by Japanese(LP: #852948), and they
attached screenshot.
https:/
https:/
Related branches
- Brandon Schaefer (community): Approve
-
Diff: 47 lines (+6/-2)2 files modifieddash/FilterBasicButton.cpp (+2/-1)
unity-shared/DashStyle.cpp (+4/-1)
tags: | added: patch |
Changed in unity: | |
status: | Incomplete → Confirmed |
Changed in unity (Ubuntu): | |
status: | Incomplete → Confirmed |
Changed in unity: | |
milestone: | none → 4.26.0 |
importance: | Undecided → High |
Changed in unity (Ubuntu): | |
importance: | Undecided → High |
Changed in nux: | |
status: | Incomplete → Confirmed |
summary: |
- Lens button set narraw width which is needed + Lens button set narrow width which is needed |
Changed in nux (Ubuntu): | |
status: | New → Confirmed |
Changed in unity: | |
milestone: | 4.26.0 → 4.28.0 |
Changed in unity: | |
milestone: | 4.28.0 → 4.30.0 |
Changed in unity: | |
milestone: | 4.30.0 → none |
Changed in nux: | |
importance: | Undecided → High |
Changed in nux (Ubuntu): | |
importance: | Undecided → High |
Changed in nux: | |
status: | Confirmed → Invalid |
Changed in unity: | |
assignee: | nobody → Andrea Azzarone (andyrock) |
Changed in unity (Ubuntu): | |
assignee: | nobody → Andrea Azzarone (andyrock) |
Changed in unity: | |
milestone: | none → 6.6 |
Changed in unity (Ubuntu): | |
status: | Confirmed → Invalid |
Changed in unity: | |
status: | Confirmed → In Progress |
Changed in nux (Ubuntu): | |
status: | Confirmed → In Progress |
status: | In Progress → Invalid |
Changed in unity (Ubuntu): | |
status: | Invalid → Confirmed |
status: | Confirmed → In Progress |
Changed in nux: | |
importance: | High → Undecided |
no longer affects: | nux |
no longer affects: | nux (Ubuntu) |
Changed in unity: | |
status: | In Progress → Fix Committed |
Changed in unity (Ubuntu): | |
status: | In Progress → Fix Committed |
Changed in unity: | |
milestone: | 6.6 → 7.0 |
no longer affects: | unity/6.0 |
Changed in unity: | |
milestone: | 7.0 → 6.6 |
Changed in unity: | |
status: | Fix Committed → Fix Released |
Short conclusion of reason:
If default UI font is not "Ubuntu 10", UI is broken.
Following is long long details (please correct me if I'm wrong): unity:: FilterBasicButt on) has 2 labels. FilterBasicButt on, and DashStyle: :Button.
First of all, Unity button(
1. Calculated label: It is member of nux::Button wich is inherited
by FilterBasicButton, and this label is used to calculate box
size by nux::StaticText.
2. Displayed label: It is member of unity::
rendered via unity::
nux::StaticText calculate box size by font t::_font_ string) and Pango/Cairo renderer (see ::GetTextSize) . Then to redraw label t::UpdateTextRe ndering) , set minimum/maximum box size :SetMinMaxSize.
(nux::StaticTex
nux::StaticText
(nux::StaticTex
calculated it by nux::Area:
nux::StaticText ::_font_ string is setted default value at "Ubuntu 10".
And _font_string is not changed in instance liftime (i.e. always use
"Ubuntu 10").
This size is refered by calling nux::Area: :GetGeometry FilterBasicButt on::InitTheme. And it is used to set cairo surface_ create( ).
at unity::
image size at cairo_image_
unity:: DashStyle: :Button is rendered its label at DashStyle: :Impl:: Text. At the time, unity get font from
unity::
GtkSettings (in my environment "Ubuntu 11") and use it to layout.
Impl::Text method calculates label width and set margin below steps. surface_ get_width( ), and save to "w". set_width( layout, w * PANGO_SCALE);
1. Get cairo width by cairo_image_
i.e. width base "Ubuntu 10"
2. Cut side margin: w -= 2*horizMargin
3. Set canvas width: pango_layout_
4. Centering and draw label with system font ("Ubuntu 11").
However label width with Ubuntu 11 is wider than Ubuntu 10,
therefore button label is shorten.
Why do not reproduce in "All":
"All" is very narrow text, therefore error is small relatively, and
unity can render it.