fix: linux duplicated title bar (#462)

Fixes #459
This commit is contained in:
lollipopkit🏳️‍⚧️
2024-07-15 17:38:30 +08:00
committed by GitHub
parent f7d6c461dc
commit c988dd88d7
12 changed files with 122 additions and 43 deletions

View File

@@ -305,7 +305,7 @@ class _SettingPageState extends State<SettingPage> {
_setting.primaryColor.put(color.value);
context.pop();
context.pop();
RNodes.app.build();
RNodes.app.notify();
}
// Widget _buildLaunchPage() {
@@ -393,7 +393,7 @@ class _SettingPageState extends State<SettingPage> {
);
if (selected != null) {
_setting.themeMode.put(selected);
RNodes.app.build();
RNodes.app.notify();
}
},
trailing: ValBuilder(
@@ -442,7 +442,7 @@ class _SettingPageState extends State<SettingPage> {
onPressed: () {
_setting.fontPath.delete();
context.pop();
RNodes.app.build();
RNodes.app.notify();
},
child: Text(l10n.clear),
)
@@ -466,7 +466,7 @@ class _SettingPageState extends State<SettingPage> {
}
context.pop();
RNodes.app.build();
RNodes.app.notify();
}
Widget _buildTermFontSize() {
@@ -536,7 +536,7 @@ class _SettingPageState extends State<SettingPage> {
if (selected != null) {
_setting.locale.put(selected.code);
context.pop();
RNodes.app.build();
RNodes.app.notify();
}
},
trailing: ListenBuilder(
@@ -609,7 +609,7 @@ class _SettingPageState extends State<SettingPage> {
subtitle: Text(l10n.fullScreenTip, style: UIs.textGrey),
trailing: StoreSwitch(
prop: _setting.fullScreen,
callback: (_) => RNodes.app.build(),
callback: (_) => RNodes.app.notify(),
),
);
}
@@ -802,7 +802,7 @@ class _SettingPageState extends State<SettingPage> {
return;
}
_setting.textFactor.put(val);
RNodes.app.build();
RNodes.app.notify();
context.pop();
}
@@ -1049,7 +1049,7 @@ class _SettingPageState extends State<SettingPage> {
title: Text(l10n.more),
children: [
_buildBeta(),
_buildWakeLock(),
if (isMobile) _buildWakeLock(),
_buildCollapseUI(),
_buildCupertinoRoute(),
if (isDesktop) _buildHideTitleBar(),

View File

@@ -1,4 +1,5 @@
import 'package:fl_lib/fl_lib.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:icons_plus/icons_plus.dart';
import 'package:provider/provider.dart';
@@ -89,7 +90,7 @@ class _SSHTabPageState extends State<SSHTabPage>
if (confirm != true) return;
_tabMap.remove(name);
_tabRN.build();
_tabRN.notify();
_pageCtrl.previousPage(
duration: Durations.medium1, curve: Curves.fastEaseInToSlowEaseOut);
}
@@ -191,7 +192,7 @@ class _SSHTabPageState extends State<SSHTabPage>
),
key: key,
);
_tabRN.build();
_tabRN.notify();
// Wait for the page to be built
await Future.delayed(Durations.short3);
final idx = _tabMap.keys.toList().indexOf(name);
@@ -213,7 +214,7 @@ final class _TabBar extends StatelessWidget implements PreferredSizeWidget {
required this.onClose,
});
final ValueNotifier<int> idxVN;
final ValueListenable<int> idxVN;
final _TabMap map;
final void Function(int idx) onTap;
final void Function(String name) onClose;