fix ab style

This commit is contained in:
rustdesk 2023-06-21 19:39:55 +08:00
parent 398bc0c130
commit e8563a05c7
2 changed files with 38 additions and 45 deletions

View File

@ -71,14 +71,14 @@ class _AddressBookState extends State<AddressBook> {
Widget _buildAddressBookDesktop() { Widget _buildAddressBookDesktop() {
return Row( return Row(
children: [ children: [
Card( Container(
margin: EdgeInsets.symmetric(horizontal: 4.0), margin: EdgeInsets.symmetric(horizontal: 4.0),
shape: RoundedRectangleBorder( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(12), borderRadius: BorderRadius.circular(12),
side: border:
BorderSide(color: Theme.of(context).scaffoldBackgroundColor)), Border.all(color: Theme.of(context).colorScheme.background)),
child: Container( child: Container(
width: 200, width: 180,
height: double.infinity, height: double.infinity,
padding: padding:
const EdgeInsets.symmetric(horizontal: 12.0, vertical: 8.0), const EdgeInsets.symmetric(horizontal: 12.0, vertical: 8.0),
@ -89,9 +89,6 @@ class _AddressBookState extends State<AddressBook> {
child: Container( child: Container(
width: double.infinity, width: double.infinity,
height: double.infinity, height: double.infinity,
decoration: BoxDecoration(
border: Border.all(color: MyTheme.border),
borderRadius: BorderRadius.circular(2)),
child: _buildTags(), child: _buildTags(),
).marginSymmetric(vertical: 8.0), ).marginSymmetric(vertical: 8.0),
) )
@ -107,12 +104,12 @@ class _AddressBookState extends State<AddressBook> {
Widget _buildAddressBookMobile() { Widget _buildAddressBookMobile() {
return Column( return Column(
children: [ children: [
Card( Container(
margin: EdgeInsets.symmetric(horizontal: 1.0), margin: EdgeInsets.symmetric(horizontal: 1.0),
shape: RoundedRectangleBorder( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(6), borderRadius: BorderRadius.circular(6),
side: border:
BorderSide(color: Theme.of(context).scaffoldBackgroundColor)), Border.all(color: Theme.of(context).colorScheme.background)),
child: Container( child: Container(
padding: padding:
const EdgeInsets.symmetric(horizontal: 12.0, vertical: 8.0), const EdgeInsets.symmetric(horizontal: 12.0, vertical: 8.0),
@ -122,9 +119,6 @@ class _AddressBookState extends State<AddressBook> {
_buildTagHeader(), _buildTagHeader(),
Container( Container(
width: double.infinity, width: double.infinity,
decoration: BoxDecoration(
border: Border.all(color: MyTheme.darkGray),
borderRadius: BorderRadius.circular(4)),
child: _buildTags(), child: _buildTags(),
).marginSymmetric(vertical: 8.0), ).marginSymmetric(vertical: 8.0),
], ],
@ -149,7 +143,7 @@ class _AddressBookState extends State<AddressBook> {
menuPos = RelativeRect.fromLTRB(x, y, x, y); menuPos = RelativeRect.fromLTRB(x, y, x, y);
}, },
onPointerUp: (_) => _showMenu(menuPos), onPointerUp: (_) => _showMenu(menuPos),
child: ActionMore()), child: build_more(context, invert: true)),
], ],
); );
} }
@ -421,10 +415,9 @@ class AddressBookTag extends StatelessWidget {
child: Obx( child: Obx(
() => Container( () => Container(
decoration: BoxDecoration( decoration: BoxDecoration(
color: tags.contains(name) ? Colors.blue : null, color: tags.contains(name)
border: tags.contains(name) ? Colors.blue
? null : Theme.of(context).colorScheme.background,
: Border.all(color: MyTheme.border),
borderRadius: BorderRadius.circular(6)), borderRadius: BorderRadius.circular(6)),
margin: const EdgeInsets.symmetric(horizontal: 4.0, vertical: 8.0), margin: const EdgeInsets.symmetric(horizontal: 4.0, vertical: 8.0),
padding: const EdgeInsets.symmetric(vertical: 2.0, horizontal: 8.0), padding: const EdgeInsets.symmetric(vertical: 2.0, horizontal: 8.0),

View File

@ -313,7 +313,7 @@ class _PeerCardState extends State<_PeerCard>
_menuPos = RelativeRect.fromLTRB(x, y, x, y); _menuPos = RelativeRect.fromLTRB(x, y, x, y);
}, },
onPointerUp: (_) => _showPeerMenu(peer.id), onPointerUp: (_) => _showPeerMenu(peer.id),
child: ActionMore()); child: build_more(context));
/// Show the peer menu and handle user's choice. /// Show the peer menu and handle user's choice.
/// User might remove the peer or send a file to the peer. /// User might remove the peer or send a file to the peer.
@ -1226,28 +1226,28 @@ Widget getOnline(double rightPadding, bool online) {
radius: 3, backgroundColor: online ? Colors.green : kColorWarn))); radius: 3, backgroundColor: online ? Colors.green : kColorWarn)));
} }
class ActionMore extends StatelessWidget { Widget build_more(BuildContext context, {bool invert = false}) {
final RxBool _hover = false.obs; final RxBool hover = false.obs;
return InkWell(
@override borderRadius: BorderRadius.circular(14),
Widget build(BuildContext context) { onTap: () {},
return InkWell( onHover: (value) => hover.value = value,
borderRadius: BorderRadius.circular(14), child: Obx(() => CircleAvatar(
onTap: () {}, radius: 14,
onHover: (value) => _hover.value = value, backgroundColor: hover.value
child: Obx(() => CircleAvatar( ? (invert
radius: 14, ? Theme.of(context).colorScheme.background
backgroundColor: _hover.value : Theme.of(context).scaffoldBackgroundColor)
? Theme.of(context).scaffoldBackgroundColor : (invert
: Theme.of(context).colorScheme.background, ? Theme.of(context).scaffoldBackgroundColor
child: Icon(Icons.more_vert, : Theme.of(context).colorScheme.background),
size: 18, child: Icon(Icons.more_vert,
color: _hover.value size: 18,
? Theme.of(context).textTheme.titleLarge?.color color: hover.value
: Theme.of(context) ? Theme.of(context).textTheme.titleLarge?.color
.textTheme : Theme.of(context)
.titleLarge .textTheme
?.color .titleLarge
?.withOpacity(0.5))))); ?.color
} ?.withOpacity(0.5)))));
} }