Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(133)

Issue 360213002: Add Flex to views::BoxLayout. (Closed)

Created:
6 years, 5 months ago by calamity
Modified:
6 years, 5 months ago
Reviewers:
sashab, benwells, sky
CC:
chrome-apps-syd-reviews_chromium.org, chromium-reviews, Ilya Sherman, msw+watch_chromium.org, sadrul, dyu1, benquan, tfarina, mkwst+watchlist_chromium.org, oshima+watch_chromium.org, estade+watch_chromium.org, rouslan+autofillwatch_chromium.org, kalyank, gcasto+watchlist_chromium.org, alicet1, stevenjb+watch_chromium.org, ben+ash_chromium.org, Dane Wallinga
Project:
chromium
Visibility:
Public.

Description

Add Flex to views::BoxLayout. This CL adds a per-view flex property to BoxLayout. The flex property functions similarly to the CSS flexbox concept of flex, using the child view's preferred size as the flex basis and then adding or removing space within each flexed so that all views fit within the parent. This CL also removes MAIN_AXIS_ALIGNMENT_FILL as it is superceded by SetDefaultFlex(). BUG=386475 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=285514

Patch Set 1 : #

Total comments: 10

Patch Set 2 : address comments #

Total comments: 8

Patch Set 3 : address comments #

Total comments: 7

Patch Set 4 : address comments #

Total comments: 4

Patch Set 5 : reworked algorithm #

Patch Set 6 : rebase #

Total comments: 2

Patch Set 7 : address comment #

Total comments: 8

Patch Set 8 : address sky's comments #

Patch Set 9 : lock BoxLayout to a single host #

Patch Set 10 : rebase #

Unified diffs Side-by-side diffs Delta from patch set Stats (+483 lines, -153 lines) Patch
M ash/system/chromeos/network/network_state_list_detailed_view.cc View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -1 line 0 comments Download
M ash/system/tray/system_tray_bubble.cc View 1 2 1 chunk +1 line, -1 line 0 comments Download
M ash/system/tray/tray_background_view.cc View 1 2 3 4 5 2 chunks +2 lines, -2 lines 0 comments Download
M ash/system/tray_accessibility.cc View 1 2 1 chunk +1 line, -1 line 0 comments Download
M athena/home/bottom_home_view.cc View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -2 lines 0 comments Download
M chrome/browser/ui/views/message_center/message_center_widget_delegate.cc View 1 2 1 chunk +1 line, -1 line 0 comments Download
M ui/message_center/views/message_center_view.cc View 1 2 1 chunk +1 line, -1 line 0 comments Download
M ui/views/bubble/tray_bubble_view.cc View 1 2 1 chunk +1 line, -1 line 0 comments Download
M ui/views/layout/box_layout.h View 1 2 3 4 5 6 7 8 4 chunks +33 lines, -5 lines 0 comments Download
M ui/views/layout/box_layout.cc View 1 2 3 4 5 6 7 8 2 chunks +121 lines, -47 lines 0 comments Download
M ui/views/layout/box_layout_unittest.cc View 1 2 3 4 5 6 7 8 7 chunks +320 lines, -91 lines 0 comments Download

Messages

Total messages: 26 (0 generated)
calamity
6 years, 5 months ago (2014-07-01 06:28:22 UTC) #1
sashab
I'm thinking you should add a constructor that takes the default flex as a parameter. ...
6 years, 5 months ago (2014-07-01 06:52:04 UTC) #2
calamity
+benwells I don't think it's worth adding a constructor with default flex in it since ...
6 years, 5 months ago (2014-07-01 08:19:44 UTC) #3
sashab
Hmm, I'm starting to think maybe this change should actually be in a subclass of ...
6 years, 5 months ago (2014-07-02 01:09:35 UTC) #4
calamity
On 2014/07/02 01:09:35, sasha_b wrote: > Hmm, I'm starting to think maybe this change should ...
6 years, 5 months ago (2014-07-02 03:20:58 UTC) #5
sashab
After offline discussion I am happy keeping it as one class. We certainly don't want ...
6 years, 5 months ago (2014-07-02 06:39:32 UTC) #6
benwells
https://codereview.chromium.org/360213002/diff/60001/ui/views/layout/box_layout.cc File ui/views/layout/box_layout.cc (right): https://codereview.chromium.org/360213002/diff/60001/ui/views/layout/box_layout.cc#newcode31 ui/views/layout/box_layout.cc:31: flex_map_[index] = flex_weight; Nit: check flex_weight >= 0 https://codereview.chromium.org/360213002/diff/60001/ui/views/layout/box_layout.cc#newcode67 ...
6 years, 5 months ago (2014-07-02 08:02:26 UTC) #7
calamity
https://codereview.chromium.org/360213002/diff/60001/ui/views/layout/box_layout.cc File ui/views/layout/box_layout.cc (right): https://codereview.chromium.org/360213002/diff/60001/ui/views/layout/box_layout.cc#newcode31 ui/views/layout/box_layout.cc:31: flex_map_[index] = flex_weight; On 2014/07/02 08:02:26, benwells wrote: > ...
6 years, 5 months ago (2014-07-03 01:54:28 UTC) #8
benwells
https://codereview.chromium.org/360213002/diff/100001/ui/views/layout/box_layout.cc File ui/views/layout/box_layout.cc (right): https://codereview.chromium.org/360213002/diff/100001/ui/views/layout/box_layout.cc#newcode51 ui/views/layout/box_layout.cc:51: int main_free_space = 0; Nit: move this to just ...
6 years, 5 months ago (2014-07-03 07:29:59 UTC) #9
calamity
https://codereview.chromium.org/360213002/diff/100001/ui/views/layout/box_layout.cc File ui/views/layout/box_layout.cc (right): https://codereview.chromium.org/360213002/diff/100001/ui/views/layout/box_layout.cc#newcode51 ui/views/layout/box_layout.cc:51: int main_free_space = 0; On 2014/07/03 07:29:59, benwells wrote: ...
6 years, 5 months ago (2014-07-03 08:31:24 UTC) #10
benwells
As I won't be here next week feel free to send this on to an ...
6 years, 5 months ago (2014-07-04 07:27:57 UTC) #11
calamity
Since I reworked the padding code, it'd be good to get you to take another ...
6 years, 5 months ago (2014-07-07 05:11:18 UTC) #12
benwells
just one comment.... https://codereview.chromium.org/360213002/diff/200001/ui/views/layout/box_layout.cc File ui/views/layout/box_layout.cc (right): https://codereview.chromium.org/360213002/diff/200001/ui/views/layout/box_layout.cc#newcode141 ui/views/layout/box_layout.cc:141: DCHECK_LE(MainAxisPosition(child_area) + MainAxisSize(child_area), I think DCHECK_EQ(total_padding, ...
6 years, 5 months ago (2014-07-18 02:52:25 UTC) #13
calamity
+sky for OWNERS (particularly ui/views) https://codereview.chromium.org/360213002/diff/200001/ui/views/layout/box_layout.cc File ui/views/layout/box_layout.cc (right): https://codereview.chromium.org/360213002/diff/200001/ui/views/layout/box_layout.cc#newcode141 ui/views/layout/box_layout.cc:141: DCHECK_LE(MainAxisPosition(child_area) + MainAxisSize(child_area), On ...
6 years, 5 months ago (2014-07-18 03:20:03 UTC) #14
benwells
On 2014/07/18 03:20:03, calamity wrote: > +sky for OWNERS (particularly ui/views) > > https://codereview.chromium.org/360213002/diff/200001/ui/views/layout/box_layout.cc > ...
6 years, 5 months ago (2014-07-18 04:17:17 UTC) #15
sky
https://codereview.chromium.org/360213002/diff/220001/ui/views/layout/box_layout.cc File ui/views/layout/box_layout.cc (right): https://codereview.chromium.org/360213002/diff/220001/ui/views/layout/box_layout.cc#newcode31 ui/views/layout/box_layout.cc:31: DCHECK(index >= 0); DCHECK_GE for all these. https://codereview.chromium.org/360213002/diff/220001/ui/views/layout/box_layout.cc#newcode51 ui/views/layout/box_layout.cc:51: ...
6 years, 5 months ago (2014-07-18 15:54:00 UTC) #16
calamity
https://codereview.chromium.org/360213002/diff/220001/ui/views/layout/box_layout.cc File ui/views/layout/box_layout.cc (right): https://codereview.chromium.org/360213002/diff/220001/ui/views/layout/box_layout.cc#newcode31 ui/views/layout/box_layout.cc:31: DCHECK(index >= 0); On 2014/07/18 15:54:00, sky wrote: > ...
6 years, 5 months ago (2014-07-22 05:35:15 UTC) #17
calamity
Hmm. Actually, I'm a bit concerned that this implementation will have dangling pointers in the ...
6 years, 5 months ago (2014-07-22 05:58:46 UTC) #18
sky
On 2014/07/22 05:58:46, calamity wrote: > Hmm. Actually, I'm a bit concerned that this implementation ...
6 years, 5 months ago (2014-07-22 16:56:14 UTC) #19
calamity
On 2014/07/22 16:56:14, sky wrote: > On 2014/07/22 05:58:46, calamity wrote: > > Hmm. Actually, ...
6 years, 5 months ago (2014-07-23 05:06:39 UTC) #20
sky
SGTM. If the tests aren't using BoxLayout installed on a view I would update the ...
6 years, 5 months ago (2014-07-23 15:49:08 UTC) #21
calamity
Done.
6 years, 5 months ago (2014-07-24 07:36:01 UTC) #22
sky
LGTM
6 years, 5 months ago (2014-07-24 16:57:17 UTC) #23
calamity
The CQ bit was checked by calamity@chromium.org
6 years, 5 months ago (2014-07-25 04:16:01 UTC) #24
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/calamity@chromium.org/360213002/320001
6 years, 5 months ago (2014-07-25 04:18:22 UTC) #25
commit-bot: I haz the power
6 years, 5 months ago (2014-07-25 07:05:49 UTC) #26
Message was sent while issue was closed.
Change committed as 285514

Powered by Google App Engine
This is Rietveld 408576698