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

Unified Diff: ash/common/system/tray/tri_view.cc

Issue 2487603005: Adjust TriView. (Closed)
Patch Set: Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« ash/common/system/tray/tri_view.h ('K') | « ash/common/system/tray/tri_view.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/common/system/tray/tri_view.cc
diff --git a/ash/common/system/tray/tri_view.cc b/ash/common/system/tray/tri_view.cc
index b4742673c8652afb1c938675fd0cff11a7d2d316..5f9bba6c6653d6107c6518735eebd81ea4cb7324 100644
--- a/ash/common/system/tray/tri_view.cc
+++ b/ash/common/system/tray/tri_view.cc
@@ -27,6 +27,17 @@ views::BoxLayout::Orientation GetOrientation(TriView::Orientation orientation) {
return views::BoxLayout::kHorizontal;
}
+std::unique_ptr<views::LayoutManager> CreateDefaultLayoutManager(
+ TriView::Orientation orientation) {
+ auto box_layout =
+ base::MakeUnique<views::BoxLayout>(GetOrientation(orientation), 0, 0, 0);
+ box_layout->set_main_axis_alignment(
+ views::BoxLayout::MAIN_AXIS_ALIGNMENT_CENTER);
+ box_layout->set_cross_axis_alignment(
+ views::BoxLayout::CROSS_AXIS_ALIGNMENT_CENTER);
+ return box_layout;
+}
+
} // namespace
TriView::TriView() : TriView(0) {}
@@ -62,6 +73,8 @@ TriView::TriView(Orientation orientation, int padding_between_containers)
GetLayoutManager(Container::END)
->SetLayoutManager(CreateDefaultLayoutManager(orientation));
+ box_layout_->set_cross_axis_alignment(
+ views::BoxLayout::CROSS_AXIS_ALIGNMENT_START);
bruthig 2016/11/10 18:33:40 Just looking for confirmation, in your comment her
Evan Stade 2016/11/10 19:18:05 no, all we needed to do to fix the toggle was chan
bruthig 2016/11/10 20:51:16 Acknowledged.
SetLayoutManager(box_layout_);
enable_hierarchy_changed_dcheck_ = true;
@@ -71,10 +84,6 @@ TriView::~TriView() {
enable_hierarchy_changed_dcheck_ = false;
}
-void TriView::SetMinCrossAxisSize(int min_size) {
- box_layout_->set_minimum_cross_axis_size(min_size);
-}
-
void TriView::SetMinSize(Container container, const gfx::Size& size) {
GetLayoutManager(container)->SetMinSize(size);
}
@@ -131,22 +140,11 @@ void TriView::ViewHierarchyChanged(
}
}
-std::unique_ptr<views::LayoutManager> TriView::CreateDefaultLayoutManager(
- Orientation orientation) const {
- views::BoxLayout* box_layout =
- new views::BoxLayout(GetOrientation(orientation), 0, 0, 0);
- box_layout->set_main_axis_alignment(
- views::BoxLayout::MAIN_AXIS_ALIGNMENT_CENTER);
- box_layout->set_cross_axis_alignment(
- views::BoxLayout::CROSS_AXIS_ALIGNMENT_CENTER);
- return std::unique_ptr<views::LayoutManager>(box_layout);
-}
-
-views::View* TriView::GetContainer(Container container) const {
- return const_cast<views::View*>(child_at(static_cast<int>(container)));
+views::View* TriView::GetContainer(Container container) {
+ return child_at(static_cast<int>(container));
}
-SizeRangeLayout* TriView::GetLayoutManager(Container container) const {
+SizeRangeLayout* TriView::GetLayoutManager(Container container) {
switch (container) {
case Container::START:
return start_container_layout_manager_;
« ash/common/system/tray/tri_view.h ('K') | « ash/common/system/tray/tri_view.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698