Merge pull request #3626 from 21pages/fix

add elevation for remote menubar
This commit is contained in:
RustDesk 2023-03-13 10:25:42 +08:00 committed by GitHub
commit 7d73243b16
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 18 additions and 15 deletions

View File

@ -331,7 +331,7 @@ class QualityMonitor extends StatelessWidget {
Expanded( Expanded(
flex: 8, flex: 8,
child: AutoSizeText(info, child: AutoSizeText(info,
style: TextStyle(color: MyTheme.darkGray), style: TextStyle(color: Color.fromARGB(255, 210, 210, 210)),
textAlign: TextAlign.right, textAlign: TextAlign.right,
maxLines: 1)), maxLines: 1)),
Spacer(flex: 1), Spacer(flex: 1),
@ -353,7 +353,7 @@ class QualityMonitor extends StatelessWidget {
? Container( ? Container(
constraints: BoxConstraints(maxWidth: 200), constraints: BoxConstraints(maxWidth: 200),
padding: const EdgeInsets.all(8), padding: const EdgeInsets.all(8),
color: MyTheme.canvasColor.withAlpha(120), color: MyTheme.canvasColor.withAlpha(150),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [

View File

@ -108,6 +108,7 @@ class _MenubarTheme {
static const double buttonHMargin = 3; static const double buttonHMargin = 3;
static const double buttonVMargin = 6; static const double buttonVMargin = 6;
static const double iconRadius = 8; static const double iconRadius = 8;
static const double elevation = 3;
} }
typedef DismissFunc = void Function(); typedef DismissFunc = void Function();
@ -369,10 +370,13 @@ class _RemoteMenubarState extends State<RemoteMenubar> {
alignment: FractionalOffset(_fractionX.value, 0), alignment: FractionalOffset(_fractionX.value, 0),
child: Offstage( child: Offstage(
offstage: _dragging.isTrue, offstage: _dragging.isTrue,
child: _DraggableShowHide( child: Material(
dragging: _dragging, elevation: _MenubarTheme.elevation,
fractionX: _fractionX, child: _DraggableShowHide(
show: show, dragging: _dragging,
fractionX: _fractionX,
show: show,
),
), ),
), ),
); );
@ -406,15 +410,14 @@ class _RemoteMenubarState extends State<RemoteMenubar> {
return Column( return Column(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: [ children: [
Container( Material(
decoration: BoxDecoration( elevation: _MenubarTheme.elevation,
borderRadius: BorderRadius.all(Radius.circular(4.0)), borderRadius: BorderRadius.all(Radius.circular(4.0)),
color: Theme.of(context) color: Theme.of(context)
.menuBarTheme .menuBarTheme
.style .style
?.backgroundColor ?.backgroundColor
?.resolve(MaterialState.values.toSet()), ?.resolve(MaterialState.values.toSet()),
),
child: SingleChildScrollView( child: SingleChildScrollView(
scrollDirection: Axis.horizontal, scrollDirection: Axis.horizontal,
child: Theme( child: Theme(