Browse Source

[flutter]: config initial scrren size

appflowy 3 years ago
parent
commit
1a10f58e6f

+ 3 - 1
app_flowy/lib/startup/tasks/application_task.dart

@@ -29,7 +29,9 @@ class ApplicationWidget extends StatelessWidget {
 
   @override
   Widget build(BuildContext context) {
-    setWindowMinSize(const Size(500, 500));
+    const ratio = 1.73;
+    setWindowMinSize(const Size(500, 500 / ratio));
+    setWindowFrame(const Rect.fromLTRB(0, 0, 1310, 1310 / ratio));
 
     final theme = AppTheme.fromType(ThemeType.light);
     return Provider.value(

+ 1 - 2
app_flowy/lib/workspace/presentation/home/home_layout.dart

@@ -17,8 +17,7 @@ class HomeLayout {
   late double homePageROffset;
   late Duration animDuration;
 
-  HomeLayout(BuildContext context, BoxConstraints homeScreenConstraint,
-      bool forceCollapse) {
+  HomeLayout(BuildContext context, BoxConstraints homeScreenConstraint, bool forceCollapse) {
     final homeBlocState = context.read<HomeBloc>().state;
 
     showEditPannel = homeBlocState.editContext.isSome();

+ 20 - 0
app_flowy/lib/workspace/presentation/home/navigation.dart

@@ -86,6 +86,26 @@ class FlowyNavigation extends StatelessWidget {
   }
 }
 
+class IconNaviItemWidget extends StatelessWidget {
+  final NavigationItem item;
+  const IconNaviItemWidget(this.item, {Key? key}) : super(key: key);
+
+  @override
+  Widget build(BuildContext context) {
+    return SizedBox(
+      height: 24,
+      child: FlowyTextButton(
+        item.title,
+        padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 2),
+        fontSize: 12,
+        onPressed: () {
+          debugPrint('show app document');
+        },
+      ),
+    );
+  }
+}
+
 class NaviItemWidget extends StatelessWidget {
   final NavigationItem item;
   const NaviItemWidget(this.item, {Key? key}) : super(key: key);

+ 1 - 3
app_flowy/packages/flowy_infra/lib/size.dart

@@ -52,9 +52,7 @@ class Sizes {
 
   static double get iconMed => 20;
 
-  static double get sideBarSm => 200 * hitScale;
-
-  static double get sideBarMed => 240 * hitScale;
+  static double get sideBarMed => 225 * hitScale;
 
   static double get sideBarLg => 290 * hitScale;
 }