mirror of
https://github.com/rustdesk/rustdesk.git
synced 2025-06-07 18:02:48 +08:00
refactor ThemeData
This commit is contained in:
parent
95a241bdf4
commit
e8587436d6
@ -76,59 +76,22 @@ class IconFont {
|
|||||||
|
|
||||||
class ColorThemeExtension extends ThemeExtension<ColorThemeExtension> {
|
class ColorThemeExtension extends ThemeExtension<ColorThemeExtension> {
|
||||||
const ColorThemeExtension({
|
const ColorThemeExtension({
|
||||||
required this.bg,
|
|
||||||
required this.grayBg,
|
|
||||||
required this.text,
|
|
||||||
required this.lightText,
|
|
||||||
required this.lighterText,
|
|
||||||
required this.placeholder,
|
|
||||||
required this.border,
|
required this.border,
|
||||||
});
|
});
|
||||||
|
|
||||||
final Color? bg;
|
|
||||||
final Color? grayBg;
|
|
||||||
final Color? text;
|
|
||||||
final Color? lightText;
|
|
||||||
final Color? lighterText;
|
|
||||||
final Color? placeholder;
|
|
||||||
final Color? border;
|
final Color? border;
|
||||||
|
|
||||||
static const light = ColorThemeExtension(
|
static const light = ColorThemeExtension(
|
||||||
bg: Color(0xFFFFFFFF),
|
|
||||||
grayBg: Color(0xFFEEEEEE),
|
|
||||||
text: Color(0xFF222222),
|
|
||||||
lightText: Color(0xFF666666),
|
|
||||||
lighterText: Color(0xFF888888),
|
|
||||||
placeholder: Color(0xFFAAAAAA),
|
|
||||||
border: Color(0xFFCCCCCC),
|
border: Color(0xFFCCCCCC),
|
||||||
);
|
);
|
||||||
|
|
||||||
static const dark = ColorThemeExtension(
|
static const dark = ColorThemeExtension(
|
||||||
bg: Color(0xFF252525),
|
|
||||||
grayBg: Color(0xFF141414),
|
|
||||||
text: Color(0xFFFFFFFF),
|
|
||||||
lightText: Color(0xFF999999),
|
|
||||||
lighterText: Color(0xFF777777),
|
|
||||||
placeholder: Color(0xFF555555),
|
|
||||||
border: Color(0xFF555555),
|
border: Color(0xFF555555),
|
||||||
);
|
);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
ThemeExtension<ColorThemeExtension> copyWith(
|
ThemeExtension<ColorThemeExtension> copyWith({Color? border}) {
|
||||||
{Color? bg,
|
|
||||||
Color? grayBg,
|
|
||||||
Color? text,
|
|
||||||
Color? lightText,
|
|
||||||
Color? lighterText,
|
|
||||||
Color? placeholder,
|
|
||||||
Color? border}) {
|
|
||||||
return ColorThemeExtension(
|
return ColorThemeExtension(
|
||||||
bg: bg ?? this.bg,
|
|
||||||
grayBg: grayBg ?? this.grayBg,
|
|
||||||
text: text ?? this.text,
|
|
||||||
lightText: lightText ?? this.lightText,
|
|
||||||
lighterText: lighterText ?? this.lighterText,
|
|
||||||
placeholder: placeholder ?? this.placeholder,
|
|
||||||
border: border ?? this.border,
|
border: border ?? this.border,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -140,12 +103,6 @@ class ColorThemeExtension extends ThemeExtension<ColorThemeExtension> {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
return ColorThemeExtension(
|
return ColorThemeExtension(
|
||||||
bg: Color.lerp(bg, other.bg, t),
|
|
||||||
grayBg: Color.lerp(grayBg, other.grayBg, t),
|
|
||||||
text: Color.lerp(text, other.text, t),
|
|
||||||
lightText: Color.lerp(lightText, other.lightText, t),
|
|
||||||
lighterText: Color.lerp(lighterText, other.lighterText, t),
|
|
||||||
placeholder: Color.lerp(placeholder, other.placeholder, t),
|
|
||||||
border: Color.lerp(border, other.border, t),
|
border: Color.lerp(border, other.border, t),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -170,6 +127,13 @@ class MyTheme {
|
|||||||
|
|
||||||
static ThemeData lightTheme = ThemeData(
|
static ThemeData lightTheme = ThemeData(
|
||||||
brightness: Brightness.light,
|
brightness: Brightness.light,
|
||||||
|
backgroundColor: Color(0xFFFFFFFF),
|
||||||
|
scaffoldBackgroundColor: Color(0xFFEEEEEE),
|
||||||
|
textTheme: const TextTheme(
|
||||||
|
titleLarge: TextStyle(fontSize: 19, color: Colors.black87),
|
||||||
|
bodySmall:
|
||||||
|
TextStyle(fontSize: 12, color: Colors.black54, height: 1.25)),
|
||||||
|
hintColor: Color(0xFFAAAAAA),
|
||||||
primarySwatch: Colors.blue,
|
primarySwatch: Colors.blue,
|
||||||
visualDensity: VisualDensity.adaptivePlatformDensity,
|
visualDensity: VisualDensity.adaptivePlatformDensity,
|
||||||
tabBarTheme: const TabBarTheme(
|
tabBarTheme: const TabBarTheme(
|
||||||
@ -191,6 +155,12 @@ class MyTheme {
|
|||||||
);
|
);
|
||||||
static ThemeData darkTheme = ThemeData(
|
static ThemeData darkTheme = ThemeData(
|
||||||
brightness: Brightness.dark,
|
brightness: Brightness.dark,
|
||||||
|
backgroundColor: Color(0xFF252525),
|
||||||
|
scaffoldBackgroundColor: Color(0xFF141414),
|
||||||
|
textTheme: const TextTheme(
|
||||||
|
titleLarge: TextStyle(fontSize: 19),
|
||||||
|
bodySmall: TextStyle(fontSize: 12, height: 1.25)),
|
||||||
|
hintColor: Color(0xFF555555),
|
||||||
primarySwatch: Colors.blue,
|
primarySwatch: Colors.blue,
|
||||||
visualDensity: VisualDensity.adaptivePlatformDensity,
|
visualDensity: VisualDensity.adaptivePlatformDensity,
|
||||||
tabBarTheme: const TabBarTheme(
|
tabBarTheme: const TabBarTheme(
|
||||||
|
@ -115,7 +115,8 @@ class _AddressBookState extends State<AddressBook> {
|
|||||||
Card(
|
Card(
|
||||||
shape: RoundedRectangleBorder(
|
shape: RoundedRectangleBorder(
|
||||||
borderRadius: BorderRadius.circular(20),
|
borderRadius: BorderRadius.circular(20),
|
||||||
side: const BorderSide(color: MyTheme.grayBg)),
|
side: BorderSide(
|
||||||
|
color: Theme.of(context).scaffoldBackgroundColor)),
|
||||||
child: Container(
|
child: Container(
|
||||||
width: 200,
|
width: 200,
|
||||||
height: double.infinity,
|
height: double.infinity,
|
||||||
@ -215,7 +216,8 @@ class _AddressBookState extends State<AddressBook> {
|
|||||||
child: Text(
|
child: Text(
|
||||||
tagName,
|
tagName,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: rxTags.contains(tagName) ? MyTheme.white : null),
|
color:
|
||||||
|
rxTags.contains(tagName) ? Colors.white : null), // TODO
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -26,7 +26,7 @@ class DraggableChatWindow extends StatelessWidget {
|
|||||||
position: position,
|
position: position,
|
||||||
width: width,
|
width: width,
|
||||||
height: height,
|
height: height,
|
||||||
builder: (_, onPanUpdate) {
|
builder: (context, onPanUpdate) {
|
||||||
return isIOS
|
return isIOS
|
||||||
? ChatPage(chatModel: chatModel)
|
? ChatPage(chatModel: chatModel)
|
||||||
: Scaffold(
|
: Scaffold(
|
||||||
@ -35,16 +35,16 @@ class DraggableChatWindow extends StatelessWidget {
|
|||||||
onPanUpdate: onPanUpdate,
|
onPanUpdate: onPanUpdate,
|
||||||
appBar: isDesktop
|
appBar: isDesktop
|
||||||
? _buildDesktopAppBar()
|
? _buildDesktopAppBar()
|
||||||
: _buildMobileAppBar(),
|
: _buildMobileAppBar(context),
|
||||||
),
|
),
|
||||||
body: ChatPage(chatModel: chatModel),
|
body: ChatPage(chatModel: chatModel),
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget _buildMobileAppBar() {
|
Widget _buildMobileAppBar(BuildContext context) {
|
||||||
return Container(
|
return Container(
|
||||||
color: MyTheme.accent50,
|
color: Theme.of(context).colorScheme.primary,
|
||||||
height: 50,
|
height: 50,
|
||||||
child: Row(
|
child: Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
@ -169,17 +169,17 @@ class DraggableMobileActions extends StatelessWidget {
|
|||||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||||
children: [
|
children: [
|
||||||
IconButton(
|
IconButton(
|
||||||
color: MyTheme.white,
|
color: Colors.white,
|
||||||
onPressed: onBackPressed,
|
onPressed: onBackPressed,
|
||||||
splashRadius: 20,
|
splashRadius: 20,
|
||||||
icon: const Icon(Icons.arrow_back)),
|
icon: const Icon(Icons.arrow_back)),
|
||||||
IconButton(
|
IconButton(
|
||||||
color: MyTheme.white,
|
color: Colors.white,
|
||||||
onPressed: onHomePressed,
|
onPressed: onHomePressed,
|
||||||
splashRadius: 20,
|
splashRadius: 20,
|
||||||
icon: const Icon(Icons.home)),
|
icon: const Icon(Icons.home)),
|
||||||
IconButton(
|
IconButton(
|
||||||
color: MyTheme.white,
|
color: Colors.white,
|
||||||
onPressed: onRecentPressed,
|
onPressed: onRecentPressed,
|
||||||
splashRadius: 20,
|
splashRadius: 20,
|
||||||
icon: const Icon(Icons.more_horiz)),
|
icon: const Icon(Icons.more_horiz)),
|
||||||
@ -190,7 +190,7 @@ class DraggableMobileActions extends StatelessWidget {
|
|||||||
endIndent: 10,
|
endIndent: 10,
|
||||||
),
|
),
|
||||||
IconButton(
|
IconButton(
|
||||||
color: MyTheme.white,
|
color: Colors.white,
|
||||||
onPressed: onHidePressed,
|
onPressed: onHidePressed,
|
||||||
splashRadius: 20,
|
splashRadius: 20,
|
||||||
icon: const Icon(Icons.keyboard_arrow_down)),
|
icon: const Icon(Icons.keyboard_arrow_down)),
|
||||||
|
@ -108,7 +108,9 @@ class _PeerCardState extends State<_PeerCard>
|
|||||||
return MouseRegion(
|
return MouseRegion(
|
||||||
onEnter: (evt) {
|
onEnter: (evt) {
|
||||||
deco.value = BoxDecoration(
|
deco.value = BoxDecoration(
|
||||||
border: Border.all(color: MyTheme.button, width: _borderWidth),
|
border: Border.all(
|
||||||
|
color: Theme.of(context).colorScheme.secondary,
|
||||||
|
width: _borderWidth),
|
||||||
borderRadius: peerCardUiType.value == PeerUiType.grid
|
borderRadius: peerCardUiType.value == PeerUiType.grid
|
||||||
? BorderRadius.circular(_cardRadis)
|
? BorderRadius.circular(_cardRadis)
|
||||||
: null);
|
: null);
|
||||||
@ -130,8 +132,9 @@ class _PeerCardState extends State<_PeerCard>
|
|||||||
|
|
||||||
Widget _buildPeerTile(
|
Widget _buildPeerTile(
|
||||||
BuildContext context, Peer peer, Rx<BoxDecoration?> deco) {
|
BuildContext context, Peer peer, Rx<BoxDecoration?> deco) {
|
||||||
final greyStyle =
|
final greyStyle = TextStyle(
|
||||||
TextStyle(fontSize: 11, color: MyTheme.color(context).lighterText);
|
fontSize: 11,
|
||||||
|
color: Theme.of(context).textTheme.titleLarge?.color?.withOpacity(0.6));
|
||||||
final alias = bind.mainGetPeerOptionSync(id: peer.id, key: 'alias');
|
final alias = bind.mainGetPeerOptionSync(id: peer.id, key: 'alias');
|
||||||
return Obx(
|
return Obx(
|
||||||
() => Container(
|
() => Container(
|
||||||
@ -148,7 +151,8 @@ class _PeerCardState extends State<_PeerCard>
|
|||||||
),
|
),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Container(
|
child: Container(
|
||||||
decoration: BoxDecoration(color: MyTheme.color(context).bg),
|
decoration:
|
||||||
|
BoxDecoration(color: Theme.of(context).backgroundColor),
|
||||||
child: Row(
|
child: Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
children: [
|
children: [
|
||||||
@ -250,7 +254,7 @@ class _PeerCardState extends State<_PeerCard>
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
Container(
|
Container(
|
||||||
color: MyTheme.color(context).bg,
|
color: Theme.of(context).backgroundColor,
|
||||||
child: Row(
|
child: Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
children: [
|
children: [
|
||||||
@ -294,13 +298,21 @@ class _PeerCardState extends State<_PeerCard>
|
|||||||
child: CircleAvatar(
|
child: CircleAvatar(
|
||||||
radius: 14,
|
radius: 14,
|
||||||
backgroundColor: _iconMoreHover.value
|
backgroundColor: _iconMoreHover.value
|
||||||
? MyTheme.color(context).grayBg!
|
? Theme.of(context).scaffoldBackgroundColor
|
||||||
: MyTheme.color(context).bg!,
|
: Theme.of(context).backgroundColor,
|
||||||
|
// ? Theme.of(context).scaffoldBackgroundColor!
|
||||||
|
// : Theme.of(context).backgroundColor!,
|
||||||
child: Icon(Icons.more_vert,
|
child: Icon(Icons.more_vert,
|
||||||
size: 18,
|
size: 18,
|
||||||
color: _iconMoreHover.value
|
color: _iconMoreHover.value
|
||||||
? MyTheme.color(context).text
|
? Theme.of(context).textTheme.titleLarge?.color
|
||||||
: MyTheme.color(context).lightText))));
|
: Theme.of(context)
|
||||||
|
.textTheme
|
||||||
|
.titleLarge
|
||||||
|
?.color
|
||||||
|
?.withOpacity(0.5)))));
|
||||||
|
// ? MyTheme.color(context).text
|
||||||
|
// : MyTheme.color(context).lightText))));
|
||||||
|
|
||||||
/// 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.
|
||||||
@ -865,7 +877,7 @@ class AddressBookPeerCard extends BasePeerCard {
|
|||||||
child: Text(
|
child: Text(
|
||||||
tagName,
|
tagName,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: rxTags.contains(tagName) ? MyTheme.white : null),
|
color: rxTags.contains(tagName) ? Colors.white : null),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -101,6 +101,7 @@ class _PeerTabPageState extends State<PeerTabPage>
|
|||||||
}
|
}
|
||||||
|
|
||||||
Widget _createTabBar(BuildContext context) {
|
Widget _createTabBar(BuildContext context) {
|
||||||
|
final textColor = Theme.of(context).textTheme.titleLarge?.color;
|
||||||
return ListView(
|
return ListView(
|
||||||
scrollDirection: Axis.horizontal,
|
scrollDirection: Axis.horizontal,
|
||||||
shrinkWrap: true,
|
shrinkWrap: true,
|
||||||
@ -111,7 +112,7 @@ class _PeerTabPageState extends State<PeerTabPage>
|
|||||||
padding: const EdgeInsets.symmetric(horizontal: 8),
|
padding: const EdgeInsets.symmetric(horizontal: 8),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: _tabIndex.value == t.key
|
color: _tabIndex.value == t.key
|
||||||
? MyTheme.color(context).bg
|
? Theme.of(context).backgroundColor
|
||||||
: null,
|
: null,
|
||||||
borderRadius: BorderRadius.circular(isDesktop ? 2 : 6),
|
borderRadius: BorderRadius.circular(isDesktop ? 2 : 6),
|
||||||
),
|
),
|
||||||
@ -123,9 +124,9 @@ class _PeerTabPageState extends State<PeerTabPage>
|
|||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
height: 1,
|
height: 1,
|
||||||
fontSize: 14,
|
fontSize: 14,
|
||||||
color: _tabIndex.value == t.key
|
color:
|
||||||
? MyTheme.color(context).text
|
_tabIndex.value == t.key ? textColor : textColor
|
||||||
: MyTheme.color(context).lightText),
|
?..withOpacity(0.5)),
|
||||||
),
|
),
|
||||||
)),
|
)),
|
||||||
onTap: () async => await _handleTabSelection(t.key),
|
onTap: () async => await _handleTabSelection(t.key),
|
||||||
@ -147,7 +148,8 @@ class _PeerTabPageState extends State<PeerTabPage>
|
|||||||
}
|
}
|
||||||
|
|
||||||
Widget _createPeerViewTypeSwitch(BuildContext context) {
|
Widget _createPeerViewTypeSwitch(BuildContext context) {
|
||||||
final activeDeco = BoxDecoration(color: MyTheme.color(context).bg);
|
final textColor = Theme.of(context).textTheme.titleLarge?.color;
|
||||||
|
final activeDeco = BoxDecoration(color: Theme.of(context).backgroundColor);
|
||||||
return Row(
|
return Row(
|
||||||
children: [PeerUiType.grid, PeerUiType.list]
|
children: [PeerUiType.grid, PeerUiType.list]
|
||||||
.map((type) => Obx(
|
.map((type) => Obx(
|
||||||
@ -166,9 +168,9 @@ class _PeerTabPageState extends State<PeerTabPage>
|
|||||||
? Icons.grid_view_rounded
|
? Icons.grid_view_rounded
|
||||||
: Icons.list,
|
: Icons.list,
|
||||||
size: 18,
|
size: 18,
|
||||||
color: peerCardUiType.value == type
|
color:
|
||||||
? MyTheme.color(context).text
|
peerCardUiType.value == type ? textColor : textColor
|
||||||
: MyTheme.color(context).lightText,
|
?..withOpacity(0.5),
|
||||||
)),
|
)),
|
||||||
),
|
),
|
||||||
))
|
))
|
||||||
@ -212,7 +214,7 @@ class _PeerSearchBarState extends State<PeerSearchBar> {
|
|||||||
return Container(
|
return Container(
|
||||||
width: 120,
|
width: 120,
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: MyTheme.color(context).bg,
|
color: Theme.of(context).backgroundColor,
|
||||||
borderRadius: BorderRadius.circular(6),
|
borderRadius: BorderRadius.circular(6),
|
||||||
),
|
),
|
||||||
child: Obx(() => Row(
|
child: Obx(() => Row(
|
||||||
@ -222,7 +224,7 @@ class _PeerSearchBarState extends State<PeerSearchBar> {
|
|||||||
children: [
|
children: [
|
||||||
Icon(
|
Icon(
|
||||||
Icons.search_rounded,
|
Icons.search_rounded,
|
||||||
color: MyTheme.color(context).placeholder,
|
color: Theme.of(context).hintColor,
|
||||||
).marginSymmetric(horizontal: 4),
|
).marginSymmetric(horizontal: 4),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: TextField(
|
child: TextField(
|
||||||
@ -234,7 +236,11 @@ class _PeerSearchBarState extends State<PeerSearchBar> {
|
|||||||
focusNode: focusNode,
|
focusNode: focusNode,
|
||||||
textAlign: TextAlign.start,
|
textAlign: TextAlign.start,
|
||||||
maxLines: 1,
|
maxLines: 1,
|
||||||
cursorColor: MyTheme.color(context).lightText,
|
cursorColor: Theme.of(context)
|
||||||
|
.textTheme
|
||||||
|
.titleLarge
|
||||||
|
?.color
|
||||||
|
?.withOpacity(0.5),
|
||||||
cursorHeight: 18,
|
cursorHeight: 18,
|
||||||
cursorWidth: 1,
|
cursorWidth: 1,
|
||||||
style: const TextStyle(fontSize: 14),
|
style: const TextStyle(fontSize: 14),
|
||||||
@ -244,8 +250,7 @@ class _PeerSearchBarState extends State<PeerSearchBar> {
|
|||||||
hintText:
|
hintText:
|
||||||
focused.value ? null : translate("Search ID"),
|
focused.value ? null : translate("Search ID"),
|
||||||
hintStyle: TextStyle(
|
hintStyle: TextStyle(
|
||||||
fontSize: 14,
|
fontSize: 14, color: Theme.of(context).hintColor),
|
||||||
color: MyTheme.color(context).placeholder),
|
|
||||||
border: InputBorder.none,
|
border: InputBorder.none,
|
||||||
isDense: true,
|
isDense: true,
|
||||||
),
|
),
|
||||||
|
@ -121,7 +121,7 @@ class _ConnectionPageState extends State<ConnectionPage> {
|
|||||||
width: 320 + 20 * 2,
|
width: 320 + 20 * 2,
|
||||||
padding: const EdgeInsets.fromLTRB(20, 24, 20, 22),
|
padding: const EdgeInsets.fromLTRB(20, 24, 20, 22),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: MyTheme.color(context).bg,
|
color: Theme.of(context).backgroundColor,
|
||||||
borderRadius: const BorderRadius.all(Radius.circular(13)),
|
borderRadius: const BorderRadius.all(Radius.circular(13)),
|
||||||
),
|
),
|
||||||
child: Ink(
|
child: Ink(
|
||||||
@ -131,7 +131,10 @@ class _ConnectionPageState extends State<ConnectionPage> {
|
|||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
translate('Control Remote Desktop'),
|
translate('Control Remote Desktop'),
|
||||||
style: const TextStyle(fontSize: 19, height: 1),
|
style: Theme.of(context)
|
||||||
|
.textTheme
|
||||||
|
.titleLarge
|
||||||
|
?.merge(TextStyle(height: 1)),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
).marginOnly(bottom: 15),
|
).marginOnly(bottom: 15),
|
||||||
@ -150,13 +153,12 @@ class _ConnectionPageState extends State<ConnectionPage> {
|
|||||||
height: 1,
|
height: 1,
|
||||||
),
|
),
|
||||||
maxLines: 1,
|
maxLines: 1,
|
||||||
cursorColor: MyTheme.color(context).text!,
|
cursorColor:
|
||||||
|
Theme.of(context).textTheme.titleLarge?.color,
|
||||||
decoration: InputDecoration(
|
decoration: InputDecoration(
|
||||||
hintText: inputFocused.value
|
hintText: inputFocused.value
|
||||||
? null
|
? null
|
||||||
: translate('Enter Remote ID'),
|
: translate('Enter Remote ID'),
|
||||||
hintStyle: TextStyle(
|
|
||||||
color: MyTheme.color(context).placeholder),
|
|
||||||
border: OutlineInputBorder(
|
border: OutlineInputBorder(
|
||||||
borderRadius: BorderRadius.zero,
|
borderRadius: BorderRadius.zero,
|
||||||
borderSide: BorderSide(
|
borderSide: BorderSide(
|
||||||
@ -219,8 +221,11 @@ class _ConnectionPageState extends State<ConnectionPage> {
|
|||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 12,
|
fontSize: 12,
|
||||||
color: ftPressed.value
|
color: ftPressed.value
|
||||||
? MyTheme.color(context).bg
|
? Theme.of(context).backgroundColor
|
||||||
: MyTheme.color(context).text),
|
: Theme.of(context)
|
||||||
|
.textTheme
|
||||||
|
.titleLarge
|
||||||
|
?.color),
|
||||||
).marginSymmetric(horizontal: 12),
|
).marginSymmetric(horizontal: 12),
|
||||||
),
|
),
|
||||||
)),
|
)),
|
||||||
@ -260,7 +265,7 @@ class _ConnectionPageState extends State<ConnectionPage> {
|
|||||||
),
|
),
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 12,
|
fontSize: 12,
|
||||||
color: MyTheme.color(context).bg),
|
color: Theme.of(context).backgroundColor),
|
||||||
),
|
),
|
||||||
).marginSymmetric(horizontal: 12),
|
).marginSymmetric(horizontal: 12),
|
||||||
)),
|
)),
|
||||||
|
@ -68,7 +68,7 @@ class _DesktopHomePageState extends State<DesktopHomePage>
|
|||||||
value: gFFI.serverModel,
|
value: gFFI.serverModel,
|
||||||
child: Container(
|
child: Container(
|
||||||
width: 200,
|
width: 200,
|
||||||
color: MyTheme.color(context).bg,
|
color: Theme.of(context).backgroundColor,
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
buildTip(context),
|
buildTip(context),
|
||||||
@ -82,7 +82,7 @@ class _DesktopHomePageState extends State<DesktopHomePage>
|
|||||||
|
|
||||||
buildRightPane(BuildContext context) {
|
buildRightPane(BuildContext context) {
|
||||||
return Container(
|
return Container(
|
||||||
color: MyTheme.color(context).grayBg,
|
color: Theme.of(context).scaffoldBackgroundColor,
|
||||||
child: ConnectionPage(),
|
child: ConnectionPage(),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -116,7 +116,11 @@ class _DesktopHomePageState extends State<DesktopHomePage>
|
|||||||
translate("ID"),
|
translate("ID"),
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 14,
|
fontSize: 14,
|
||||||
color: MyTheme.color(context).lightText),
|
color: Theme.of(context)
|
||||||
|
.textTheme
|
||||||
|
.titleLarge
|
||||||
|
?.color
|
||||||
|
?.withOpacity(0.5)),
|
||||||
).marginOnly(top: 5),
|
).marginOnly(top: 5),
|
||||||
buildPopupMenu(context)
|
buildPopupMenu(context)
|
||||||
],
|
],
|
||||||
@ -152,6 +156,7 @@ class _DesktopHomePageState extends State<DesktopHomePage>
|
|||||||
}
|
}
|
||||||
|
|
||||||
Widget buildPopupMenu(BuildContext context) {
|
Widget buildPopupMenu(BuildContext context) {
|
||||||
|
final textColor = Theme.of(context).textTheme.titleLarge?.color;
|
||||||
RxBool hover = false.obs;
|
RxBool hover = false.obs;
|
||||||
return InkWell(
|
return InkWell(
|
||||||
onTap: () async {},
|
onTap: () async {},
|
||||||
@ -159,14 +164,12 @@ class _DesktopHomePageState extends State<DesktopHomePage>
|
|||||||
() => CircleAvatar(
|
() => CircleAvatar(
|
||||||
radius: 15,
|
radius: 15,
|
||||||
backgroundColor: hover.value
|
backgroundColor: hover.value
|
||||||
? MyTheme.color(context).grayBg!
|
? Theme.of(context).scaffoldBackgroundColor
|
||||||
: MyTheme.color(context).bg!,
|
: Theme.of(context).backgroundColor,
|
||||||
child: Icon(
|
child: Icon(
|
||||||
Icons.more_vert_outlined,
|
Icons.more_vert_outlined,
|
||||||
size: 20,
|
size: 20,
|
||||||
color: hover.value
|
color: hover.value ? textColor : textColor?.withOpacity(0.5),
|
||||||
? MyTheme.color(context).text
|
|
||||||
: MyTheme.color(context).lightText,
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@ -178,6 +181,7 @@ class _DesktopHomePageState extends State<DesktopHomePage>
|
|||||||
final model = gFFI.serverModel;
|
final model = gFFI.serverModel;
|
||||||
RxBool refreshHover = false.obs;
|
RxBool refreshHover = false.obs;
|
||||||
RxBool editHover = false.obs;
|
RxBool editHover = false.obs;
|
||||||
|
final textColor = Theme.of(context).textTheme.titleLarge?.color;
|
||||||
return Container(
|
return Container(
|
||||||
margin: EdgeInsets.only(left: 20.0, right: 16, top: 13, bottom: 13),
|
margin: EdgeInsets.only(left: 20.0, right: 16, top: 13, bottom: 13),
|
||||||
child: Row(
|
child: Row(
|
||||||
@ -198,7 +202,7 @@ class _DesktopHomePageState extends State<DesktopHomePage>
|
|||||||
Text(
|
Text(
|
||||||
translate("Password"),
|
translate("Password"),
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 14, color: MyTheme.color(context).lightText),
|
fontSize: 14, color: textColor?.withOpacity(0.5)),
|
||||||
),
|
),
|
||||||
Row(
|
Row(
|
||||||
children: [
|
children: [
|
||||||
@ -228,8 +232,8 @@ class _DesktopHomePageState extends State<DesktopHomePage>
|
|||||||
() => Icon(
|
() => Icon(
|
||||||
Icons.refresh,
|
Icons.refresh,
|
||||||
color: refreshHover.value
|
color: refreshHover.value
|
||||||
? MyTheme.color(context).text
|
? textColor
|
||||||
: Color(0xFFDDDDDD),
|
: Color(0xFFDDDDDD), // TODO
|
||||||
size: 22,
|
size: 22,
|
||||||
).marginOnly(right: 8, bottom: 2),
|
).marginOnly(right: 8, bottom: 2),
|
||||||
),
|
),
|
||||||
@ -241,8 +245,8 @@ class _DesktopHomePageState extends State<DesktopHomePage>
|
|||||||
() => Icon(
|
() => Icon(
|
||||||
Icons.edit,
|
Icons.edit,
|
||||||
color: editHover.value
|
color: editHover.value
|
||||||
? MyTheme.color(context).text
|
? textColor
|
||||||
: Color(0xFFDDDDDD),
|
: Color(0xFFDDDDDD), // TODO
|
||||||
size: 22,
|
size: 22,
|
||||||
).marginOnly(right: 8, bottom: 2),
|
).marginOnly(right: 8, bottom: 2),
|
||||||
),
|
),
|
||||||
@ -270,7 +274,11 @@ class _DesktopHomePageState extends State<DesktopHomePage>
|
|||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
translate("Your Desktop"),
|
translate("Your Desktop"),
|
||||||
style: TextStyle(fontWeight: FontWeight.normal, fontSize: 19),
|
style: Theme.of(context).textTheme.titleLarge,
|
||||||
|
// style: TextStyle(
|
||||||
|
// // color: MyTheme.color(context).text,
|
||||||
|
// fontWeight: FontWeight.normal,
|
||||||
|
// fontSize: 19),
|
||||||
),
|
),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
height: 10.0,
|
height: 10.0,
|
||||||
@ -278,10 +286,7 @@ class _DesktopHomePageState extends State<DesktopHomePage>
|
|||||||
Text(
|
Text(
|
||||||
translate("desk_tip"),
|
translate("desk_tip"),
|
||||||
overflow: TextOverflow.clip,
|
overflow: TextOverflow.clip,
|
||||||
style: TextStyle(
|
style: Theme.of(context).textTheme.bodySmall,
|
||||||
fontSize: 12,
|
|
||||||
color: MyTheme.color(context).lighterText,
|
|
||||||
height: 1.25),
|
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
@ -68,7 +68,7 @@ class _DesktopSettingPageState extends State<DesktopSettingPage>
|
|||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
super.build(context);
|
super.build(context);
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
backgroundColor: MyTheme.color(context).bg,
|
backgroundColor: Theme.of(context).backgroundColor,
|
||||||
body: Row(
|
body: Row(
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
SizedBox(
|
SizedBox(
|
||||||
@ -83,7 +83,7 @@ class _DesktopSettingPageState extends State<DesktopSettingPage>
|
|||||||
const VerticalDivider(thickness: 1, width: 1),
|
const VerticalDivider(thickness: 1, width: 1),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Container(
|
child: Container(
|
||||||
color: MyTheme.color(context).grayBg,
|
color: Theme.of(context).scaffoldBackgroundColor,
|
||||||
child: DesktopScrollWrapper(
|
child: DesktopScrollWrapper(
|
||||||
scrollController: controller,
|
scrollController: controller,
|
||||||
child: PageView(
|
child: PageView(
|
||||||
@ -802,7 +802,9 @@ Widget _Card({required String title, required List<Widget> children}) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Color? _disabledTextColor(BuildContext context, bool enabled) {
|
Color? _disabledTextColor(BuildContext context, bool enabled) {
|
||||||
return enabled ? null : MyTheme.color(context).lighterText;
|
return enabled
|
||||||
|
? null
|
||||||
|
: Theme.of(context).textTheme.titleLarge?.color?.withOpacity(0.6);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ignore: non_constant_identifier_names
|
// ignore: non_constant_identifier_names
|
||||||
|
@ -42,7 +42,7 @@ class _DesktopTabPageState extends State<DesktopTabPage> {
|
|||||||
OverlayEntry(builder: (context) {
|
OverlayEntry(builder: (context) {
|
||||||
gFFI.dialogManager.setOverlayState(Overlay.of(context));
|
gFFI.dialogManager.setOverlayState(Overlay.of(context));
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
backgroundColor: MyTheme.color(context).bg,
|
backgroundColor: Theme.of(context).backgroundColor,
|
||||||
body: DesktopTab(
|
body: DesktopTab(
|
||||||
controller: tabController,
|
controller: tabController,
|
||||||
tail: ActionIcon(
|
tail: ActionIcon(
|
||||||
|
@ -104,7 +104,7 @@ class _FileManagerPageState extends State<FileManagerPage>
|
|||||||
return false;
|
return false;
|
||||||
},
|
},
|
||||||
child: Scaffold(
|
child: Scaffold(
|
||||||
backgroundColor: MyTheme.color(context).bg,
|
backgroundColor: Theme.of(context).backgroundColor,
|
||||||
body: Row(
|
body: Row(
|
||||||
children: [
|
children: [
|
||||||
Flexible(flex: 3, child: body(isLocal: true)),
|
Flexible(flex: 3, child: body(isLocal: true)),
|
||||||
|
@ -72,7 +72,7 @@ class _FileManagerTabPageState extends State<FileManagerTabPage> {
|
|||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
border: Border.all(color: MyTheme.color(context).border!)),
|
border: Border.all(color: MyTheme.color(context).border!)),
|
||||||
child: Scaffold(
|
child: Scaffold(
|
||||||
backgroundColor: MyTheme.color(context).bg,
|
backgroundColor: Theme.of(context).backgroundColor,
|
||||||
body: DesktopTab(
|
body: DesktopTab(
|
||||||
controller: tabController,
|
controller: tabController,
|
||||||
onWindowCloseButton: handleWindowCloseButton,
|
onWindowCloseButton: handleWindowCloseButton,
|
||||||
|
@ -70,7 +70,7 @@ class _PortForwardPageState extends State<PortForwardPage>
|
|||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
super.build(context);
|
super.build(context);
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
backgroundColor: MyTheme.color(context).grayBg,
|
backgroundColor: Theme.of(context).scaffoldBackgroundColor,
|
||||||
body: FutureBuilder(future: () async {
|
body: FutureBuilder(future: () async {
|
||||||
if (!widget.isRDP) {
|
if (!widget.isRDP) {
|
||||||
refreshTunnelConfig();
|
refreshTunnelConfig();
|
||||||
@ -80,7 +80,8 @@ class _PortForwardPageState extends State<PortForwardPage>
|
|||||||
return Container(
|
return Container(
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
border: Border.all(
|
border: Border.all(
|
||||||
width: 20, color: MyTheme.color(context).grayBg!)),
|
width: 20,
|
||||||
|
color: Theme.of(context).scaffoldBackgroundColor)),
|
||||||
child: Column(
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||||
children: [
|
children: [
|
||||||
@ -88,7 +89,7 @@ class _PortForwardPageState extends State<PortForwardPage>
|
|||||||
Flexible(
|
Flexible(
|
||||||
child: Container(
|
child: Container(
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: MyTheme.color(context).bg,
|
color: Theme.of(context).backgroundColor,
|
||||||
border: Border.all(width: 1, color: MyTheme.border)),
|
border: Border.all(width: 1, color: MyTheme.border)),
|
||||||
child:
|
child:
|
||||||
widget.isRDP ? buildRdp(context) : buildTunnel(context),
|
widget.isRDP ? buildRdp(context) : buildTunnel(context),
|
||||||
@ -131,7 +132,7 @@ class _PortForwardPageState extends State<PortForwardPage>
|
|||||||
|
|
||||||
return Theme(
|
return Theme(
|
||||||
data: Theme.of(context)
|
data: Theme.of(context)
|
||||||
.copyWith(backgroundColor: MyTheme.color(context).bg),
|
.copyWith(backgroundColor: Theme.of(context).backgroundColor),
|
||||||
child: Obx(() => ListView.builder(
|
child: Obx(() => ListView.builder(
|
||||||
controller: ScrollController(),
|
controller: ScrollController(),
|
||||||
itemCount: pfs.length + 2,
|
itemCount: pfs.length + 2,
|
||||||
@ -139,7 +140,7 @@ class _PortForwardPageState extends State<PortForwardPage>
|
|||||||
if (index == 0) {
|
if (index == 0) {
|
||||||
return Container(
|
return Container(
|
||||||
height: 25,
|
height: 25,
|
||||||
color: MyTheme.color(context).grayBg,
|
color: Theme.of(context).scaffoldBackgroundColor,
|
||||||
child: Row(children: [
|
child: Row(children: [
|
||||||
text('Local Port'),
|
text('Local Port'),
|
||||||
const SizedBox(width: _kColumn1Width),
|
const SizedBox(width: _kColumn1Width),
|
||||||
@ -166,7 +167,7 @@ class _PortForwardPageState extends State<PortForwardPage>
|
|||||||
|
|
||||||
return Container(
|
return Container(
|
||||||
height: _kRowHeight,
|
height: _kRowHeight,
|
||||||
decoration: BoxDecoration(color: MyTheme.color(context).bg),
|
decoration: BoxDecoration(color: Theme.of(context).backgroundColor),
|
||||||
child: Row(children: [
|
child: Row(children: [
|
||||||
buildTunnelInputCell(context,
|
buildTunnelInputCell(context,
|
||||||
controller: localPortController,
|
controller: localPortController,
|
||||||
@ -216,11 +217,12 @@ class _PortForwardPageState extends State<PortForwardPage>
|
|||||||
{required TextEditingController controller,
|
{required TextEditingController controller,
|
||||||
List<TextInputFormatter>? inputFormatters,
|
List<TextInputFormatter>? inputFormatters,
|
||||||
String? hint}) {
|
String? hint}) {
|
||||||
|
final textColor = Theme.of(context).textTheme.titleLarge?.color;
|
||||||
return Expanded(
|
return Expanded(
|
||||||
child: TextField(
|
child: TextField(
|
||||||
controller: controller,
|
controller: controller,
|
||||||
inputFormatters: inputFormatters,
|
inputFormatters: inputFormatters,
|
||||||
cursorColor: MyTheme.color(context).text,
|
cursorColor: textColor,
|
||||||
cursorHeight: 20,
|
cursorHeight: 20,
|
||||||
cursorWidth: 1,
|
cursorWidth: 1,
|
||||||
decoration: InputDecoration(
|
decoration: InputDecoration(
|
||||||
@ -228,12 +230,12 @@ class _PortForwardPageState extends State<PortForwardPage>
|
|||||||
borderSide: BorderSide(color: MyTheme.color(context).border!)),
|
borderSide: BorderSide(color: MyTheme.color(context).border!)),
|
||||||
focusedBorder: OutlineInputBorder(
|
focusedBorder: OutlineInputBorder(
|
||||||
borderSide: BorderSide(color: MyTheme.color(context).border!)),
|
borderSide: BorderSide(color: MyTheme.color(context).border!)),
|
||||||
fillColor: MyTheme.color(context).bg,
|
fillColor: Theme.of(context).backgroundColor,
|
||||||
contentPadding: const EdgeInsets.all(10),
|
contentPadding: const EdgeInsets.all(10),
|
||||||
hintText: hint,
|
hintText: hint,
|
||||||
hintStyle: TextStyle(
|
hintStyle:
|
||||||
color: MyTheme.color(context).placeholder, fontSize: 16)),
|
TextStyle(color: Theme.of(context).hintColor, fontSize: 16)),
|
||||||
style: TextStyle(color: MyTheme.color(context).text, fontSize: 16),
|
style: TextStyle(color: textColor, fontSize: 16),
|
||||||
).marginAll(10),
|
).marginAll(10),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -250,7 +252,7 @@ class _PortForwardPageState extends State<PortForwardPage>
|
|||||||
? MyTheme.currentThemeMode() == ThemeMode.dark
|
? MyTheme.currentThemeMode() == ThemeMode.dark
|
||||||
? const Color(0xFF202020)
|
? const Color(0xFF202020)
|
||||||
: const Color(0xFFF4F5F6)
|
: const Color(0xFFF4F5F6)
|
||||||
: MyTheme.color(context).bg),
|
: Theme.of(context).backgroundColor),
|
||||||
child: Row(children: [
|
child: Row(children: [
|
||||||
text(pf.localPort.toString()),
|
text(pf.localPort.toString()),
|
||||||
const SizedBox(width: _kColumn1Width),
|
const SizedBox(width: _kColumn1Width),
|
||||||
@ -292,7 +294,7 @@ class _PortForwardPageState extends State<PortForwardPage>
|
|||||||
).marginOnly(left: _kTextLeftMargin));
|
).marginOnly(left: _kTextLeftMargin));
|
||||||
return Theme(
|
return Theme(
|
||||||
data: Theme.of(context)
|
data: Theme.of(context)
|
||||||
.copyWith(backgroundColor: MyTheme.color(context).bg),
|
.copyWith(backgroundColor: Theme.of(context).backgroundColor),
|
||||||
child: ListView.builder(
|
child: ListView.builder(
|
||||||
controller: ScrollController(),
|
controller: ScrollController(),
|
||||||
itemCount: 2,
|
itemCount: 2,
|
||||||
@ -300,7 +302,7 @@ class _PortForwardPageState extends State<PortForwardPage>
|
|||||||
if (index == 0) {
|
if (index == 0) {
|
||||||
return Container(
|
return Container(
|
||||||
height: 25,
|
height: 25,
|
||||||
color: MyTheme.color(context).grayBg,
|
color: Theme.of(context).scaffoldBackgroundColor,
|
||||||
child: Row(children: [
|
child: Row(children: [
|
||||||
text1('Local Port'),
|
text1('Local Port'),
|
||||||
const SizedBox(width: _kColumn1Width),
|
const SizedBox(width: _kColumn1Width),
|
||||||
@ -311,7 +313,8 @@ class _PortForwardPageState extends State<PortForwardPage>
|
|||||||
} else {
|
} else {
|
||||||
return Container(
|
return Container(
|
||||||
height: _kRowHeight,
|
height: _kRowHeight,
|
||||||
decoration: BoxDecoration(color: MyTheme.color(context).bg),
|
decoration:
|
||||||
|
BoxDecoration(color: Theme.of(context).backgroundColor),
|
||||||
child: Row(children: [
|
child: Row(children: [
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Align(
|
child: Align(
|
||||||
|
@ -80,7 +80,7 @@ class _PortForwardTabPageState extends State<PortForwardTabPage> {
|
|||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
border: Border.all(color: MyTheme.color(context).border!)),
|
border: Border.all(color: MyTheme.color(context).border!)),
|
||||||
child: Scaffold(
|
child: Scaffold(
|
||||||
backgroundColor: MyTheme.color(context).bg,
|
backgroundColor: Theme.of(context).backgroundColor,
|
||||||
body: DesktopTab(
|
body: DesktopTab(
|
||||||
controller: tabController,
|
controller: tabController,
|
||||||
onWindowCloseButton: () async {
|
onWindowCloseButton: () async {
|
||||||
|
@ -11,7 +11,6 @@ import 'package:provider/provider.dart';
|
|||||||
import 'package:wakelock/wakelock.dart';
|
import 'package:wakelock/wakelock.dart';
|
||||||
import 'package:flutter_custom_cursor/flutter_custom_cursor.dart';
|
import 'package:flutter_custom_cursor/flutter_custom_cursor.dart';
|
||||||
|
|
||||||
import '../../consts.dart';
|
|
||||||
import '../widgets/remote_menubar.dart';
|
import '../widgets/remote_menubar.dart';
|
||||||
import '../../common.dart';
|
import '../../common.dart';
|
||||||
import '../../mobile/widgets/dialog.dart';
|
import '../../mobile/widgets/dialog.dart';
|
||||||
@ -45,7 +44,6 @@ class _RemotePageState extends State<RemotePage>
|
|||||||
late RxBool _keyboardEnabled;
|
late RxBool _keyboardEnabled;
|
||||||
|
|
||||||
final FocusNode _rawKeyFocusNode = FocusNode();
|
final FocusNode _rawKeyFocusNode = FocusNode();
|
||||||
var _isPhysicalMouse = false;
|
|
||||||
var _imageFocused = false;
|
var _imageFocused = false;
|
||||||
|
|
||||||
Function(bool)? _onEnterOrLeaveImage4Menubar;
|
Function(bool)? _onEnterOrLeaveImage4Menubar;
|
||||||
@ -138,7 +136,7 @@ class _RemotePageState extends State<RemotePage>
|
|||||||
|
|
||||||
Widget buildBody(BuildContext context) {
|
Widget buildBody(BuildContext context) {
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
backgroundColor: MyTheme.color(context).bg,
|
backgroundColor: Theme.of(context).backgroundColor,
|
||||||
body: Overlay(
|
body: Overlay(
|
||||||
initialEntries: [
|
initialEntries: [
|
||||||
OverlayEntry(builder: (context) {
|
OverlayEntry(builder: (context) {
|
||||||
@ -443,6 +441,7 @@ class ImagePainter extends CustomPainter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class QualityMonitor extends StatelessWidget {
|
class QualityMonitor extends StatelessWidget {
|
||||||
|
static const textStyle = TextStyle(color: MyTheme.grayBg);
|
||||||
final QualityMonitorModel qualityMonitorModel;
|
final QualityMonitorModel qualityMonitorModel;
|
||||||
QualityMonitor(this.qualityMonitorModel);
|
QualityMonitor(this.qualityMonitorModel);
|
||||||
|
|
||||||
@ -462,23 +461,23 @@ class QualityMonitor extends StatelessWidget {
|
|||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
"Speed: ${qualityMonitorModel.data.speed ?? ''}",
|
"Speed: ${qualityMonitorModel.data.speed ?? ''}",
|
||||||
style: const TextStyle(color: MyTheme.grayBg),
|
style: textStyle,
|
||||||
),
|
),
|
||||||
Text(
|
Text(
|
||||||
"FPS: ${qualityMonitorModel.data.fps ?? ''}",
|
"FPS: ${qualityMonitorModel.data.fps ?? ''}",
|
||||||
style: const TextStyle(color: MyTheme.grayBg),
|
style: textStyle,
|
||||||
),
|
),
|
||||||
Text(
|
Text(
|
||||||
"Delay: ${qualityMonitorModel.data.delay ?? ''} ms",
|
"Delay: ${qualityMonitorModel.data.delay ?? ''} ms",
|
||||||
style: const TextStyle(color: MyTheme.grayBg),
|
style: textStyle,
|
||||||
),
|
),
|
||||||
Text(
|
Text(
|
||||||
"Target Bitrate: ${qualityMonitorModel.data.targetBitrate ?? ''}kb",
|
"Target Bitrate: ${qualityMonitorModel.data.targetBitrate ?? ''}kb",
|
||||||
style: const TextStyle(color: MyTheme.grayBg),
|
style: textStyle,
|
||||||
),
|
),
|
||||||
Text(
|
Text(
|
||||||
"Codec: ${qualityMonitorModel.data.codecFormat ?? ''}",
|
"Codec: ${qualityMonitorModel.data.codecFormat ?? ''}",
|
||||||
style: const TextStyle(color: MyTheme.grayBg),
|
style: textStyle,
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
@ -91,7 +91,7 @@ class _ConnectionTabPageState extends State<ConnectionTabPage> {
|
|||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
border: Border.all(color: MyTheme.color(context).border!)),
|
border: Border.all(color: MyTheme.color(context).border!)),
|
||||||
child: Scaffold(
|
child: Scaffold(
|
||||||
backgroundColor: MyTheme.color(context).bg,
|
backgroundColor: Theme.of(context).backgroundColor,
|
||||||
body: DesktopTab(
|
body: DesktopTab(
|
||||||
controller: tabController,
|
controller: tabController,
|
||||||
showTabBar: fullscreen.isFalse,
|
showTabBar: fullscreen.isFalse,
|
||||||
|
@ -69,7 +69,7 @@ class _DesktopServerPageState extends State<DesktopServerPage>
|
|||||||
OverlayEntry(builder: (context) {
|
OverlayEntry(builder: (context) {
|
||||||
gFFI.dialogManager.setOverlayState(Overlay.of(context));
|
gFFI.dialogManager.setOverlayState(Overlay.of(context));
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
backgroundColor: MyTheme.color(context).bg,
|
backgroundColor: Theme.of(context).backgroundColor,
|
||||||
body: Center(
|
body: Center(
|
||||||
child: Column(
|
child: Column(
|
||||||
mainAxisAlignment: MainAxisAlignment.start,
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
@ -145,7 +145,7 @@ class ConnectionManagerState extends State<ConnectionManager> {
|
|||||||
windowManager.startDragging();
|
windowManager.startDragging();
|
||||||
},
|
},
|
||||||
child: Container(
|
child: Container(
|
||||||
color: MyTheme.color(context).bg,
|
color: Theme.of(context).backgroundColor,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
import 'dart:core';
|
import 'dart:core';
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_hbb/common.dart';
|
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
|
|
||||||
import './material_mod_popup_menu.dart' as mod_menu;
|
import './material_mod_popup_menu.dart' as mod_menu;
|
||||||
@ -201,7 +200,7 @@ class MenuEntryRadios<T> extends MenuEntryBase<T> {
|
|||||||
Text(
|
Text(
|
||||||
opt.text,
|
opt.text,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: MyTheme.color(context).text,
|
color: Theme.of(context).textTheme.titleLarge?.color,
|
||||||
fontSize: MenuConfig.fontSize,
|
fontSize: MenuConfig.fontSize,
|
||||||
fontWeight: FontWeight.normal),
|
fontWeight: FontWeight.normal),
|
||||||
),
|
),
|
||||||
@ -296,7 +295,7 @@ class MenuEntrySubRadios<T> extends MenuEntryBase<T> {
|
|||||||
Text(
|
Text(
|
||||||
opt.text,
|
opt.text,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: MyTheme.color(context).text,
|
color: Theme.of(context).textTheme.titleLarge?.color,
|
||||||
fontSize: MenuConfig.fontSize,
|
fontSize: MenuConfig.fontSize,
|
||||||
fontWeight: FontWeight.normal),
|
fontWeight: FontWeight.normal),
|
||||||
),
|
),
|
||||||
@ -345,7 +344,7 @@ class MenuEntrySubRadios<T> extends MenuEntryBase<T> {
|
|||||||
Text(
|
Text(
|
||||||
text,
|
text,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: MyTheme.color(context).text,
|
color: Theme.of(context).textTheme.titleLarge?.color,
|
||||||
fontSize: MenuConfig.fontSize,
|
fontSize: MenuConfig.fontSize,
|
||||||
fontWeight: FontWeight.normal),
|
fontWeight: FontWeight.normal),
|
||||||
),
|
),
|
||||||
@ -392,8 +391,8 @@ abstract class MenuEntrySwitchBase<T> extends MenuEntryBase<T> {
|
|||||||
@override
|
@override
|
||||||
List<mod_menu.PopupMenuEntry<T>> build(
|
List<mod_menu.PopupMenuEntry<T>> build(
|
||||||
BuildContext context, MenuConfig conf) {
|
BuildContext context, MenuConfig conf) {
|
||||||
textStyle ??= const TextStyle(
|
textStyle ??= TextStyle(
|
||||||
color: Colors.black,
|
color: Theme.of(context).textTheme.titleLarge?.color,
|
||||||
fontSize: MenuConfig.fontSize,
|
fontSize: MenuConfig.fontSize,
|
||||||
fontWeight: FontWeight.normal)
|
fontWeight: FontWeight.normal)
|
||||||
.obs;
|
.obs;
|
||||||
@ -560,7 +559,9 @@ class MenuEntrySubMenu<T> extends MenuEntryBase<T> {
|
|||||||
Obx(() => Text(
|
Obx(() => Text(
|
||||||
text,
|
text,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: super.enabled!.value ? Colors.black : Colors.grey,
|
color: super.enabled!.value
|
||||||
|
? Theme.of(context).textTheme.titleLarge?.color
|
||||||
|
: Colors.grey,
|
||||||
fontSize: MenuConfig.fontSize,
|
fontSize: MenuConfig.fontSize,
|
||||||
fontWeight: FontWeight.normal),
|
fontWeight: FontWeight.normal),
|
||||||
)),
|
)),
|
||||||
@ -595,8 +596,8 @@ class MenuEntryButton<T> extends MenuEntryBase<T> {
|
|||||||
);
|
);
|
||||||
|
|
||||||
Widget _buildChild(BuildContext context, MenuConfig conf) {
|
Widget _buildChild(BuildContext context, MenuConfig conf) {
|
||||||
const enabledStyle = TextStyle(
|
final enabledStyle = TextStyle(
|
||||||
color: Colors.black,
|
color: Theme.of(context).textTheme.titleLarge?.color,
|
||||||
fontSize: MenuConfig.fontSize,
|
fontSize: MenuConfig.fontSize,
|
||||||
fontWeight: FontWeight.normal);
|
fontWeight: FontWeight.normal);
|
||||||
const disabledStyle = TextStyle(
|
const disabledStyle = TextStyle(
|
||||||
|
@ -45,7 +45,7 @@ class ChatPage extends StatelessWidget implements PageShape {
|
|||||||
return ChangeNotifierProvider.value(
|
return ChangeNotifierProvider.value(
|
||||||
value: chatModel,
|
value: chatModel,
|
||||||
child: Container(
|
child: Container(
|
||||||
color: MyTheme.color(context).grayBg,
|
color: Theme.of(context).scaffoldBackgroundColor,
|
||||||
child: Consumer<ChatModel>(builder: (context, chatModel, child) {
|
child: Consumer<ChatModel>(builder: (context, chatModel, child) {
|
||||||
final currentUser = chatModel.currentUser;
|
final currentUser = chatModel.currentUser;
|
||||||
return Stack(
|
return Stack(
|
||||||
@ -62,11 +62,17 @@ class ChatPage extends StatelessWidget implements PageShape {
|
|||||||
inputOptions: InputOptions(
|
inputOptions: InputOptions(
|
||||||
sendOnEnter: true,
|
sendOnEnter: true,
|
||||||
inputDecoration: defaultInputDecoration(
|
inputDecoration: defaultInputDecoration(
|
||||||
fillColor: MyTheme.color(context).bg),
|
fillColor: Theme.of(context).backgroundColor),
|
||||||
sendButtonBuilder: defaultSendButton(
|
sendButtonBuilder: defaultSendButton(
|
||||||
color: MyTheme.color(context).text!),
|
color: Theme.of(context)
|
||||||
inputTextStyle:
|
.textTheme
|
||||||
TextStyle(color: MyTheme.color(context).text)),
|
.titleLarge!
|
||||||
|
.color!),
|
||||||
|
inputTextStyle: TextStyle(
|
||||||
|
color: Theme.of(context)
|
||||||
|
.textTheme
|
||||||
|
.titleLarge
|
||||||
|
?.color)),
|
||||||
messageOptions: MessageOptions(
|
messageOptions: MessageOptions(
|
||||||
showOtherUsersAvatar: false,
|
showOtherUsersAvatar: false,
|
||||||
showTime: true,
|
showTime: true,
|
||||||
|
@ -58,7 +58,7 @@ class _FileManagerPageState extends State<FileManagerPage> {
|
|||||||
return false;
|
return false;
|
||||||
},
|
},
|
||||||
child: Scaffold(
|
child: Scaffold(
|
||||||
backgroundColor: MyTheme.grayBg,
|
// backgroundColor: MyTheme.grayBg,
|
||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
leading: Row(children: [
|
leading: Row(children: [
|
||||||
IconButton(
|
IconButton(
|
||||||
@ -69,7 +69,7 @@ class _FileManagerPageState extends State<FileManagerPage> {
|
|||||||
title: ToggleSwitch(
|
title: ToggleSwitch(
|
||||||
initialLabelIndex: model.isLocal ? 0 : 1,
|
initialLabelIndex: model.isLocal ? 0 : 1,
|
||||||
activeBgColor: [MyTheme.idColor],
|
activeBgColor: [MyTheme.idColor],
|
||||||
inactiveBgColor: MyTheme.grayBg,
|
// inactiveBgColor: MyTheme.grayBg,
|
||||||
inactiveFgColor: Colors.black54,
|
inactiveFgColor: Colors.black54,
|
||||||
totalSwitches: 2,
|
totalSwitches: 2,
|
||||||
minWidth: 100,
|
minWidth: 100,
|
||||||
@ -465,6 +465,9 @@ class _FileManagerPageState extends State<FileManagerPage> {
|
|||||||
);
|
);
|
||||||
case JobState.none:
|
case JobState.none:
|
||||||
break;
|
break;
|
||||||
|
case JobState.paused:
|
||||||
|
// TODO: Handle this case.
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@ -530,8 +533,7 @@ class BottomSheetBody extends StatelessWidget {
|
|||||||
children: [
|
children: [
|
||||||
Text(title, style: TextStyle(fontSize: 18)),
|
Text(title, style: TextStyle(fontSize: 18)),
|
||||||
Text(text,
|
Text(text,
|
||||||
style: TextStyle(
|
style: TextStyle(fontSize: 14)) // TODO color
|
||||||
fontSize: 14, color: MyTheme.grayBg))
|
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
@ -548,7 +550,7 @@ class BottomSheetBody extends StatelessWidget {
|
|||||||
));
|
));
|
||||||
},
|
},
|
||||||
onClosing: () {},
|
onClosing: () {},
|
||||||
backgroundColor: MyTheme.grayBg,
|
// backgroundColor: MyTheme.grayBg,
|
||||||
enableDrag: false,
|
enableDrag: false,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -59,7 +59,7 @@ class _HomePageState extends State<HomePage> {
|
|||||||
return false;
|
return false;
|
||||||
},
|
},
|
||||||
child: Scaffold(
|
child: Scaffold(
|
||||||
backgroundColor: MyTheme.grayBg,
|
// backgroundColor: MyTheme.grayBg,
|
||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
centerTitle: true,
|
centerTitle: true,
|
||||||
title: Text("RustDesk"),
|
title: Text("RustDesk"),
|
||||||
@ -73,7 +73,7 @@ class _HomePageState extends State<HomePage> {
|
|||||||
.toList(),
|
.toList(),
|
||||||
currentIndex: _selectedIndex,
|
currentIndex: _selectedIndex,
|
||||||
type: BottomNavigationBarType.fixed,
|
type: BottomNavigationBarType.fixed,
|
||||||
selectedItemColor: MyTheme.accent,
|
selectedItemColor: MyTheme.accent, //
|
||||||
unselectedItemColor: MyTheme.darkGray,
|
unselectedItemColor: MyTheme.darkGray,
|
||||||
onTap: (index) => setState(() {
|
onTap: (index) => setState(() {
|
||||||
// close chat overlay when go chat page
|
// close chat overlay when go chat page
|
||||||
@ -95,7 +95,7 @@ class WebHomePage extends StatelessWidget {
|
|||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
backgroundColor: MyTheme.grayBg,
|
// backgroundColor: MyTheme.grayBg,
|
||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
centerTitle: true,
|
centerTitle: true,
|
||||||
title: Text("RustDesk" + (isWeb ? " (Beta) " : "")),
|
title: Text("RustDesk" + (isWeb ? " (Beta) " : "")),
|
||||||
|
@ -752,7 +752,7 @@ class _RemotePageState extends State<RemotePage> {
|
|||||||
void changeTouchMode() {
|
void changeTouchMode() {
|
||||||
setState(() => _showEdit = false);
|
setState(() => _showEdit = false);
|
||||||
showModalBottomSheet(
|
showModalBottomSheet(
|
||||||
backgroundColor: MyTheme.grayBg,
|
// backgroundColor: MyTheme.grayBg,
|
||||||
isScrollControlled: true,
|
isScrollControlled: true,
|
||||||
context: context,
|
context: context,
|
||||||
shape: const RoundedRectangleBorder(
|
shape: const RoundedRectangleBorder(
|
||||||
@ -968,7 +968,9 @@ class ImagePainter extends CustomPainter {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO global widget
|
||||||
class QualityMonitor extends StatelessWidget {
|
class QualityMonitor extends StatelessWidget {
|
||||||
|
static final textColor = Colors.grey.shade200;
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) => ChangeNotifierProvider.value(
|
Widget build(BuildContext context) => ChangeNotifierProvider.value(
|
||||||
value: gFFI.qualityMonitorModel,
|
value: gFFI.qualityMonitorModel,
|
||||||
@ -985,23 +987,23 @@ class QualityMonitor extends StatelessWidget {
|
|||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
"Speed: ${qualityMonitorModel.data.speed ?? ''}",
|
"Speed: ${qualityMonitorModel.data.speed ?? ''}",
|
||||||
style: TextStyle(color: MyTheme.grayBg),
|
style: TextStyle(color: textColor),
|
||||||
),
|
),
|
||||||
Text(
|
Text(
|
||||||
"FPS: ${qualityMonitorModel.data.fps ?? ''}",
|
"FPS: ${qualityMonitorModel.data.fps ?? ''}",
|
||||||
style: TextStyle(color: MyTheme.grayBg),
|
style: TextStyle(color: textColor),
|
||||||
),
|
),
|
||||||
Text(
|
Text(
|
||||||
"Delay: ${qualityMonitorModel.data.delay ?? ''} ms",
|
"Delay: ${qualityMonitorModel.data.delay ?? ''} ms",
|
||||||
style: TextStyle(color: MyTheme.grayBg),
|
style: TextStyle(color: textColor),
|
||||||
),
|
),
|
||||||
Text(
|
Text(
|
||||||
"Target Bitrate: ${qualityMonitorModel.data.targetBitrate ?? ''}kb",
|
"Target Bitrate: ${qualityMonitorModel.data.targetBitrate ?? ''}kb",
|
||||||
style: TextStyle(color: MyTheme.grayBg),
|
style: TextStyle(color: textColor),
|
||||||
),
|
),
|
||||||
Text(
|
Text(
|
||||||
"Codec: ${qualityMonitorModel.data.codecFormat ?? ''}",
|
"Codec: ${qualityMonitorModel.data.codecFormat ?? ''}",
|
||||||
style: TextStyle(color: MyTheme.grayBg),
|
style: TextStyle(color: textColor),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
Loading…
Reference in New Issue
Block a user