mirror of
https://github.com/rustdesk/rustdesk.git
synced 2025-08-26 10:16:54 +08:00
desktop tab lable format: id/alias@hostname
Signed-off-by: 21pages <pages21@163.com>
This commit is contained in:
@ -1,4 +1,5 @@
|
||||
import 'dart:async';
|
||||
import 'dart:convert';
|
||||
import 'dart:io';
|
||||
import 'dart:math';
|
||||
import 'dart:ui' as ui;
|
||||
@ -267,13 +268,12 @@ class DesktopTab extends StatelessWidget {
|
||||
tabType == DesktopTabType.install;
|
||||
}
|
||||
|
||||
static RxString labelGetterAlias(String peerId) {
|
||||
final opt = 'alias';
|
||||
PeerStringOption.init(peerId, opt, () {
|
||||
final alias = bind.mainGetPeerOptionSync(id: peerId, key: opt);
|
||||
return alias.isEmpty ? peerId : alias;
|
||||
static RxString tablabelGetter(String peerId) {
|
||||
PeerStringOption.init(peerId, 'tabLabel', () {
|
||||
final alias = bind.mainGetPeerOptionSync(id: peerId, key: 'alias');
|
||||
return getDesktopTabLabel(peerId, alias);
|
||||
});
|
||||
return PeerStringOption.find(peerId, opt);
|
||||
return PeerStringOption.find(peerId, 'tabLabel');
|
||||
}
|
||||
|
||||
@override
|
||||
@ -921,14 +921,17 @@ class _TabState extends State<_Tab> with RestorationMixin {
|
||||
final labelWidget = Obx(() {
|
||||
return ConstrainedBox(
|
||||
constraints: BoxConstraints(maxWidth: widget.maxLabelWidth ?? 200),
|
||||
child: Text(
|
||||
translate(widget.label.value),
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
color: isSelected
|
||||
? MyTheme.tabbar(context).selectedTextColor
|
||||
: MyTheme.tabbar(context).unSelectedTextColor),
|
||||
overflow: TextOverflow.ellipsis,
|
||||
child: Tooltip(
|
||||
message: translate(widget.label.value),
|
||||
child: Text(
|
||||
translate(widget.label.value),
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
color: isSelected
|
||||
? MyTheme.tabbar(context).selectedTextColor
|
||||
: MyTheme.tabbar(context).unSelectedTextColor),
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
));
|
||||
});
|
||||
|
||||
|
Reference in New Issue
Block a user