diff options
| author | Mirco Müller <mirco.mueller@ubuntu.com> | 2011-12-15 03:52:31 -0500 |
|---|---|---|
| committer | Tarmac <> | 2011-12-15 03:52:31 -0500 |
| commit | ba02e4c94460de023db92a4f2068dfbee0a7ea42 (patch) | |
| tree | 2d3fb0baf82b690138ec11a63edc14116a763206 /plugins | |
| parent | d571717d8508e7c7b7656e8577f699627c4f1a51 (diff) | |
| parent | 4cb697c733181a498d57adf322533e9c91812757 (diff) | |
The left-, right-, top- and bottom-padding has been changed to comply with the three-pixel-margin seen in the mockups. For the edge-case of one-item Quicklists (e.g. Launcher Trashcan) the padding is fixed now too. Also the opacity of the background-tint has been tweaked in dialog with Design. Fixes LP: #767063. Fixes: https://bugs.launchpad.net/bugs/767063. Appoved by Sam Spilsbury.
(bzr r1782)
Diffstat (limited to 'plugins')
| -rw-r--r-- | plugins/unityshell/src/QuicklistView.cpp | 28 | ||||
| -rw-r--r-- | plugins/unityshell/src/QuicklistView.h | 4 |
2 files changed, 25 insertions, 7 deletions
diff --git a/plugins/unityshell/src/QuicklistView.cpp b/plugins/unityshell/src/QuicklistView.cpp index 261234daf..398cc1276 100644 --- a/plugins/unityshell/src/QuicklistView.cpp +++ b/plugins/unityshell/src/QuicklistView.cpp @@ -68,14 +68,24 @@ QuicklistView::QuicklistView() , _anchor_height(18) , _corner_radius(4) , _padding(13) + , _left_padding_correction(-1) + , _bottom_padding_correction_normal(-2) + , _bottom_padding_correction_single_item(-4) + , _offset_correction(-1) , _cairo_text_has_changed(true) , _compute_blur_bkg(true) , _current_item_index(0) { SetGeometry(nux::Geometry(0, 0, 1, 1)); - _left_space = new nux::SpaceLayout(_padding + _anchor_width + _corner_radius, - _padding + _anchor_width + _corner_radius, + _left_space = new nux::SpaceLayout(_padding + + _anchor_width + + _corner_radius + + _left_padding_correction, + _padding + + _anchor_width + + _corner_radius + + _left_padding_correction, 1, 1000); _right_space = new nux::SpaceLayout(_padding + _corner_radius, _padding + _corner_radius, @@ -533,12 +543,16 @@ void QuicklistView::PreLayoutManagement() if (TotalItemHeight < _anchor_height) { _top_space->SetMinMaxSize(1, (_anchor_height - TotalItemHeight) / 2 + 1 + _padding + _corner_radius); - _bottom_space->SetMinMaxSize(1, (_anchor_height - TotalItemHeight) / 2 + 1 + _padding + _corner_radius); + _bottom_space->SetMinMaxSize(1, (_anchor_height - TotalItemHeight) / 2 + 1 + + _padding + _corner_radius + + _bottom_padding_correction_single_item); } else { _top_space->SetMinMaxSize(_padding + _corner_radius, _padding + _corner_radius); - _bottom_space->SetMinMaxSize(_padding + _corner_radius, _padding + _corner_radius); + _bottom_space->SetMinMaxSize(_padding + _corner_radius - 2, + _padding + _corner_radius + + _bottom_padding_correction_normal); } _item_layout->SetMinimumWidth(MaxItemWidth); @@ -553,8 +567,8 @@ long QuicklistView::PostLayoutManagement(long LayoutResult) UpdateTexture(); - int x = _padding + _anchor_width + _corner_radius; - int y = _padding + _corner_radius; + int x = _padding + _anchor_width + _corner_radius + _offset_correction; + int y = _padding + _corner_radius + _offset_correction; std::list<QuicklistMenuItem*>::iterator it; for (it = _item_list.begin(); it != _item_list.end(); it++) @@ -1354,7 +1368,7 @@ void QuicklistView::UpdateTexture() cairo_t* cr_mask = cairo_mask->GetContext(); cairo_t* cr_outline = cairo_outline->GetContext(); - float tint_color[4] = {0.0f, 0.0f, 0.0f, 0.80f}; + float tint_color[4] = {0.0f, 0.0f, 0.0f, 0.60f}; float hl_color[4] = {1.0f, 1.0f, 1.0f, 0.65f}; float dot_color[4] = {1.0f, 1.0f, 1.0f, 0.10f}; float shadow_color[4] = {0.0f, 0.0f, 0.0f, 1.00f}; diff --git a/plugins/unityshell/src/QuicklistView.h b/plugins/unityshell/src/QuicklistView.h index a9a74158a..f26d419af 100644 --- a/plugins/unityshell/src/QuicklistView.h +++ b/plugins/unityshell/src/QuicklistView.h @@ -166,6 +166,10 @@ private: float _anchor_height; float _corner_radius; float _padding; + float _left_padding_correction; + float _bottom_padding_correction_normal; + float _bottom_padding_correction_single_item; + float _offset_correction; nux::HLayout* _hlayout; nux::VLayout* _vlayout; nux::VLayout* _item_layout; |
