Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
b1a77203
Commit
b1a77203
authored
Sep 16, 2016
by
Dragoș Tiselice
Committed by
GitHub
Sep 16, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed capitalization of toolbar. (#5895)
Fixes #4713.
parent
f0f99a45
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
42 additions
and
42 deletions
+42
-42
shrine_home.dart
examples/flutter_gallery/lib/demo/shrine/shrine_home.dart
+1
-1
app_bar.dart
packages/flutter/lib/src/material/app_bar.dart
+33
-33
constants.dart
packages/flutter/lib/src/material/constants.dart
+2
-2
flexible_space_bar.dart
packages/flutter/lib/src/material/flexible_space_bar.dart
+3
-3
text_selection.dart
packages/flutter/lib/src/widgets/text_selection.dart
+3
-3
No files found.
examples/flutter_gallery/lib/demo/shrine/shrine_home.dart
View file @
b1a77203
...
...
@@ -12,7 +12,7 @@ import 'shrine_page.dart';
import
'shrine_theme.dart'
;
import
'shrine_types.dart'
;
const
double
unitSize
=
kTool
B
arHeight
;
const
double
unitSize
=
kTool
b
arHeight
;
final
List
<
Product
>
_products
=
new
List
<
Product
>.
from
(
allProducts
());
final
Map
<
Product
,
Order
>
_shoppingCart
=
<
Product
,
Order
>{};
...
...
packages/flutter/lib/src/material/app_bar.dart
View file @
b1a77203
...
...
@@ -24,14 +24,14 @@ abstract class AppBarBottomWidget extends Widget {
double
get
bottomHeight
;
}
enum
_Tool
B
arSlot
{
enum
_Tool
b
arSlot
{
leading
,
title
,
actions
,
}
class
_Tool
B
arLayout
extends
MultiChildLayoutDelegate
{
_Tool
B
arLayout
({
this
.
centerTitle
});
class
_Tool
b
arLayout
extends
MultiChildLayoutDelegate
{
_Tool
b
arLayout
({
this
.
centerTitle
});
// If false the title should be left or right justified within the space bewteen
// the leading and actions widgets, depending on the locale's writing direction.
...
...
@@ -46,22 +46,22 @@ class _ToolBarLayout extends MultiChildLayoutDelegate {
void
performLayout
(
Size
size
)
{
double
actionsWidth
=
0.0
;
if
(
hasChild
(
_Tool
B
arSlot
.
leading
))
{
if
(
hasChild
(
_Tool
b
arSlot
.
leading
))
{
final
BoxConstraints
constraints
=
new
BoxConstraints
.
tight
(
new
Size
(
kLeadingWidth
,
size
.
height
));
layoutChild
(
_Tool
B
arSlot
.
leading
,
constraints
);
positionChild
(
_Tool
B
arSlot
.
leading
,
Offset
.
zero
);
layoutChild
(
_Tool
b
arSlot
.
leading
,
constraints
);
positionChild
(
_Tool
b
arSlot
.
leading
,
Offset
.
zero
);
}
if
(
hasChild
(
_Tool
B
arSlot
.
actions
))
{
if
(
hasChild
(
_Tool
b
arSlot
.
actions
))
{
final
BoxConstraints
constraints
=
new
BoxConstraints
.
loose
(
size
);
actionsWidth
=
layoutChild
(
_Tool
B
arSlot
.
actions
,
constraints
).
width
;
positionChild
(
_Tool
B
arSlot
.
actions
,
new
Offset
(
size
.
width
-
actionsWidth
,
0.0
));
actionsWidth
=
layoutChild
(
_Tool
b
arSlot
.
actions
,
constraints
).
width
;
positionChild
(
_Tool
b
arSlot
.
actions
,
new
Offset
(
size
.
width
-
actionsWidth
,
0.0
));
}
if
(
hasChild
(
_Tool
B
arSlot
.
title
))
{
if
(
hasChild
(
_Tool
b
arSlot
.
title
))
{
final
double
maxWidth
=
size
.
width
-
kTitleLeft
-
actionsWidth
;
final
BoxConstraints
constraints
=
new
BoxConstraints
.
loose
(
size
).
copyWith
(
maxWidth:
maxWidth
);
final
Size
titleSize
=
layoutChild
(
_Tool
B
arSlot
.
title
,
constraints
);
final
Size
titleSize
=
layoutChild
(
_Tool
b
arSlot
.
title
,
constraints
);
final
double
titleY
=
(
size
.
height
-
titleSize
.
height
)
/
2.0
;
double
titleX
=
kTitleLeft
;
...
...
@@ -75,12 +75,12 @@ class _ToolBarLayout extends MultiChildLayoutDelegate {
titleX
=
kTitleLeft
;
}
positionChild
(
_Tool
B
arSlot
.
title
,
new
Offset
(
titleX
,
titleY
));
positionChild
(
_Tool
b
arSlot
.
title
,
new
Offset
(
titleX
,
titleY
));
}
}
@override
bool
shouldRelayout
(
_Tool
B
arLayout
oldDelegate
)
=>
centerTitle
!=
oldDelegate
.
centerTitle
;
bool
shouldRelayout
(
_Tool
b
arLayout
oldDelegate
)
=>
centerTitle
!=
oldDelegate
.
centerTitle
;
}
// TODO(eseidel) Toolbar needs to change size based on orientation:
...
...
@@ -287,7 +287,7 @@ class AppBar extends StatelessWidget {
);
}
double
get
_tool
BarHeight
=>
kToolB
arHeight
;
double
get
_tool
barHeight
=>
kToolb
arHeight
;
/// The height of the bottom widget. The [Scaffold] uses this value to control
/// the size of the app bar when its appBarBehavior is [AppBarBehavior.scroll]
...
...
@@ -300,16 +300,16 @@ class AppBar extends StatelessWidget {
/// enough to accommodate whatever that widget contains.
///
/// See also [getExpandedHeightFor].
double
get
expandedHeight
=>
_expandedHeight
??
(
_tool
B
arHeight
+
bottomHeight
);
double
get
expandedHeight
=>
_expandedHeight
??
(
_tool
b
arHeight
+
bottomHeight
);
/// By default, the height of the toolbar and the bottom widget (if any).
/// If the height of the app bar is constrained to be less than this value
/// then the toolbar and bottom widget are scrolled upwards, out of view.
double
get
collapsedHeight
=>
_collapsedHeight
??
(
_tool
B
arHeight
+
bottomHeight
);
double
get
collapsedHeight
=>
_collapsedHeight
??
(
_tool
b
arHeight
+
bottomHeight
);
// Defines the opacity of the toolbar's text and icons.
double
_tool
B
arOpacity
(
double
appBarHeight
,
double
statusBarHeight
)
{
return
((
appBarHeight
-
bottomHeight
-
statusBarHeight
)
/
_tool
B
arHeight
).
clamp
(
0.0
,
1.0
);
double
_tool
b
arOpacity
(
double
appBarHeight
,
double
statusBarHeight
)
{
return
((
appBarHeight
-
bottomHeight
-
statusBarHeight
)
/
_tool
b
arHeight
).
clamp
(
0.0
,
1.0
);
}
double
_bottomOpacity
(
double
appBarHeight
,
double
statusBarHeight
)
{
...
...
@@ -345,9 +345,9 @@ class AppBar extends StatelessWidget {
?
mojom
.
SystemUiOverlayStyle
.
light
:
mojom
.
SystemUiOverlayStyle
.
dark
);
final
double
tool
BarOpacity
=
_toolB
arOpacity
(
size
.
height
,
statusBarHeight
);
if
(
tool
B
arOpacity
!=
1.0
)
{
final
double
opacity
=
const
Interval
(
0.25
,
1.0
,
curve:
Curves
.
fastOutSlowIn
).
transform
(
tool
B
arOpacity
);
final
double
tool
barOpacity
=
_toolb
arOpacity
(
size
.
height
,
statusBarHeight
);
if
(
tool
b
arOpacity
!=
1.0
)
{
final
double
opacity
=
const
Interval
(
0.25
,
1.0
,
curve:
Curves
.
fastOutSlowIn
).
transform
(
tool
b
arOpacity
);
if
(
centerStyle
?.
color
!=
null
)
centerStyle
=
centerStyle
.
copyWith
(
color:
centerStyle
.
color
.
withOpacity
(
opacity
));
if
(
sideStyle
?.
color
!=
null
)
...
...
@@ -357,19 +357,19 @@ class AppBar extends StatelessWidget {
);
}
final
List
<
Widget
>
tool
B
arChildren
=
<
Widget
>[];
final
List
<
Widget
>
tool
b
arChildren
=
<
Widget
>[];
if
(
leading
!=
null
)
{
tool
B
arChildren
.
add
(
tool
b
arChildren
.
add
(
new
LayoutId
(
id:
_Tool
B
arSlot
.
leading
,
id:
_Tool
b
arSlot
.
leading
,
child:
leading
)
);
}
if
(
title
!=
null
)
{
tool
B
arChildren
.
add
(
tool
b
arChildren
.
add
(
new
LayoutId
(
id:
_Tool
B
arSlot
.
title
,
id:
_Tool
b
arSlot
.
title
,
child:
new
DefaultTextStyle
(
style:
centerStyle
,
softWrap:
false
,
...
...
@@ -380,9 +380,9 @@ class AppBar extends StatelessWidget {
);
}
if
(
actions
!=
null
&&
actions
.
isNotEmpty
)
{
tool
B
arChildren
.
add
(
tool
b
arChildren
.
add
(
new
LayoutId
(
id:
_Tool
B
arSlot
.
actions
,
id:
_Tool
b
arSlot
.
actions
,
child:
new
Row
(
mainAxisSize:
MainAxisSize
.
min
,
children:
actions
...
...
@@ -391,24 +391,24 @@ class AppBar extends StatelessWidget {
);
}
Widget
tool
B
ar
=
new
Padding
(
Widget
tool
b
ar
=
new
Padding
(
padding:
const
EdgeInsets
.
symmetric
(
horizontal:
8.0
),
child:
new
CustomMultiChildLayout
(
delegate:
new
_Tool
B
arLayout
(
delegate:
new
_Tool
b
arLayout
(
centerTitle:
_getEffectiveCenterTitle
(
themeData
)
),
children:
tool
B
arChildren
children:
tool
b
arChildren
)
);
Widget
appBar
=
new
SizedBox
(
height:
kTool
B
arHeight
,
height:
kTool
b
arHeight
,
child:
new
IconTheme
.
merge
(
context:
context
,
data:
appBarIconTheme
,
child:
new
DefaultTextStyle
(
style:
sideStyle
,
child:
tool
B
ar
child:
tool
b
ar
)
)
);
...
...
packages/flutter/lib/src/material/constants.dart
View file @
b1a77203
...
...
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
/// The height of the tool
bar component of the [AppBar].
const
double
kTool
B
arHeight
=
56.0
;
/// The height of the toolbar component of the [AppBar].
const
double
kTool
b
arHeight
=
56.0
;
/// The height of a tab bar containing text.
const
double
kTextTabBarHeight
=
48.0
;
...
...
packages/flutter/lib/src/material/flexible_space_bar.dart
View file @
b1a77203
...
...
@@ -78,7 +78,7 @@ class _FlexibleSpaceBarState extends State<FlexibleSpaceBar> {
final
double
currentHeight
=
size
.
height
;
final
double
maxHeight
=
statusBarHeight
+
AppBar
.
getExpandedHeightFor
(
context
);
final
double
minHeight
=
statusBarHeight
+
kTool
B
arHeight
;
final
double
minHeight
=
statusBarHeight
+
kTool
b
arHeight
;
final
double
deltaHeight
=
maxHeight
-
minHeight
;
// 0.0 -> Expanded
...
...
@@ -89,7 +89,7 @@ class _FlexibleSpaceBarState extends State<FlexibleSpaceBar> {
// background image
if
(
config
.
background
!=
null
)
{
final
double
fadeStart
=
math
.
max
(
0.0
,
1.0
-
kTool
B
arHeight
/
deltaHeight
);
final
double
fadeStart
=
math
.
max
(
0.0
,
1.0
-
kTool
b
arHeight
/
deltaHeight
);
final
double
fadeEnd
=
1.0
;
assert
(
fadeStart
<=
fadeEnd
);
final
double
opacity
=
1.0
-
new
Interval
(
fadeStart
,
fadeEnd
).
transform
(
t
);
...
...
@@ -110,7 +110,7 @@ class _FlexibleSpaceBarState extends State<FlexibleSpaceBar> {
if
(
config
.
title
!=
null
)
{
final
ThemeData
theme
=
Theme
.
of
(
context
);
final
double
opacity
=
(
1.0
-
(
minHeight
-
currentHeight
)
/
(
kTool
B
arHeight
-
statusBarHeight
)).
clamp
(
0.0
,
1.0
);
final
double
opacity
=
(
1.0
-
(
minHeight
-
currentHeight
)
/
(
kTool
b
arHeight
-
statusBarHeight
)).
clamp
(
0.0
,
1.0
);
if
(
opacity
>
0.0
)
{
TextStyle
titleStyle
=
theme
.
primaryTextTheme
.
title
;
titleStyle
=
titleStyle
.
copyWith
(
...
...
packages/flutter/lib/src/widgets/text_selection.dart
View file @
b1a77203
...
...
@@ -41,7 +41,7 @@ enum TextSelectionHandleType {
/// Builds a selection handle of the given type.
typedef
Widget
TextSelectionHandleBuilder
(
BuildContext
context
,
TextSelectionHandleType
type
);
/// Builds a tool
bar near a text selection.
/// Builds a toolbar near a text selection.
///
/// Typically displays buttons for copying and pasting text.
// TODO(mpcomplete): A single position is probably insufficient.
...
...
@@ -110,9 +110,9 @@ class TextSelectionOverlay implements TextSelectionDelegate {
/// selected.
final
TextSelectionHandleBuilder
handleBuilder
;
/// Builds a tool
bar to display near the selection.
/// Builds a toolbar to display near the selection.
///
/// The tool
bar typically contains buttons for copying and pasting text.
/// The toolbar typically contains buttons for copying and pasting text.
final
TextSelectionToolbarBuilder
toolbarBuilder
;
/// Controls the fade-in animations.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment