mirror of
https://github.com/rustdesk/rustdesk.git
synced 2025-08-26 10:16:54 +08:00
opt android ab ui (#8374)
* multiline error banner * mobile remove ab permission icons due to hard to press * center ab dropdown button text Signed-off-by: 21pages <sunboeasy@gmail.com>
This commit is contained in:
@ -130,7 +130,6 @@ class _AddressBookState extends State<AddressBook> {
|
||||
width: double.infinity,
|
||||
child: _buildTags(),
|
||||
),
|
||||
_buildAbPermission(),
|
||||
],
|
||||
),
|
||||
),
|
||||
@ -198,24 +197,28 @@ class _AddressBookState extends State<AddressBook> {
|
||||
if (contains) {
|
||||
names.insert(0, personalAddressBookName);
|
||||
}
|
||||
|
||||
Row buildItem(String e, {bool button = false}) {
|
||||
return Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: Tooltip(
|
||||
waitDuration: Duration(milliseconds: 500),
|
||||
message: gFFI.abModel.translatedName(e),
|
||||
child: Text(
|
||||
gFFI.abModel.translatedName(e),
|
||||
style: button ? null : TextStyle(fontSize: 14.0),
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
textAlign: button ? TextAlign.center : null,
|
||||
)),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
final items = names
|
||||
.map((e) => DropdownMenuItem(
|
||||
value: e,
|
||||
child: Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: Tooltip(
|
||||
waitDuration: Duration(milliseconds: 500),
|
||||
message: gFFI.abModel.translatedName(e),
|
||||
child: Text(
|
||||
gFFI.abModel.translatedName(e),
|
||||
style: TextStyle(fontSize: 14.0),
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
)),
|
||||
),
|
||||
],
|
||||
)))
|
||||
.map((e) => DropdownMenuItem(value: e, child: buildItem(e)))
|
||||
.toList();
|
||||
var menuItemStyleData = MenuItemStyleData(height: 36);
|
||||
if (contains && items.length > 1) {
|
||||
@ -237,14 +240,22 @@ class _AddressBookState extends State<AddressBook> {
|
||||
bind.setLocalFlutterOption(k: kOptionCurrentAbName, v: value);
|
||||
}
|
||||
},
|
||||
customButton: Container(
|
||||
height: isDesktop ? 48 : 40,
|
||||
child: Row(children: [
|
||||
Expanded(
|
||||
child: buildItem(gFFI.abModel.currentName.value, button: true)),
|
||||
Icon(Icons.arrow_drop_down),
|
||||
]),
|
||||
),
|
||||
underline: Container(
|
||||
height: 0.7,
|
||||
color: Theme.of(context).dividerColor.withOpacity(0.1),
|
||||
),
|
||||
buttonStyleData: ButtonStyleData(height: 48),
|
||||
menuItemStyleData: menuItemStyleData,
|
||||
items: items,
|
||||
isExpanded: true,
|
||||
isDense: true,
|
||||
dropdownSearchData: DropdownSearchData(
|
||||
searchController: textEditingController,
|
||||
searchInnerWidgetHeight: 50,
|
||||
|
Reference in New Issue
Block a user