Merge pull request #278 from ente-io/minor-redesign-fixes

Minor redesign fixes
This commit is contained in:
Neeraj Gupta 2022-06-08 10:03:29 +05:30 committed by GitHub
commit 0be2f4af90
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 74 additions and 20 deletions

View file

@ -71,9 +71,29 @@ extension CustomColorScheme on ColorScheme {
? Color.fromRGBO(196, 196, 196, 0.6)
: Color.fromRGBO(255, 255, 255, 0.7);
Color get gNavBackgoundColor => brightness == Brightness.light
Color get gNavBackgroundColor => brightness == Brightness.light
? Color.fromRGBO(196, 196, 196, 0.6)
: Color.fromRGBO(255, 255, 255, 0.7);
: Color.fromRGBO(40, 40, 40, 0.6);
Color get gNavBarActiveColor => brightness == Brightness.light
? Color.fromRGBO(255, 255, 255, 0.6)
: Color.fromRGBO(255, 255, 255, 0.9);
Color get gNavIconColor => brightness == Brightness.light
? Color.fromRGBO(0, 0, 0, 0.9)
: Color.fromRGBO(255, 255, 255, 1);
Color get gNavActiveIconColor => brightness == Brightness.light
? Color.fromRGBO(0, 0, 0, 0.9)
: Color.fromRGBO(0, 0, 0, 1);
Color get galleryThumbBackgroundColor => brightness == Brightness.light
? Color.fromRGBO(240, 240, 240, 1)
: Color.fromRGBO(20, 20, 20, 1);
Color get galleryThumbDrawColor => brightness == Brightness.light
? Colors.black.withOpacity(0.8)
: Colors.white.withOpacity(0.5);
}
OutlinedButtonThemeData buildOutlinedButtonThemeData(

View file

@ -218,8 +218,9 @@ class _GalleryState extends State<Gallery> {
return getMonthAndYear(DateTime.fromMicrosecondsSinceEpoch(
_collatedFiles[index][0].creationTime));
},
thumbBackgroundColor: Color(0xFF151515),
thumbDrawColor: Colors.white.withOpacity(0.5),
thumbBackgroundColor:
Theme.of(context).colorScheme.galleryThumbBackgroundColor,
thumbDrawColor: Theme.of(context).colorScheme.galleryThumbDrawColor,
firstShown: (int firstIndex) {
Bus.instance
.fire(GalleryIndexUpdatedEvent(widget.tagPrefix, firstIndex));

View file

@ -594,23 +594,31 @@ class _HomeBottomNavigationBarState extends State<HomeBottomNavigationBar> {
curve: Curves.easeOutExpo,
backgroundColor: Theme.of(context)
.colorScheme
.gNavBackgoundColor,
.gNavBackgroundColor,
mainAxisAlignment: MainAxisAlignment.center,
rippleColor: Colors.white.withOpacity(0.2),
hoverColor: Colors.white.withOpacity(0.2),
activeColor: Colors.black,
rippleColor: Colors.white.withOpacity(0.1),
activeColor: Theme.of(context)
.colorScheme
.gNavBarActiveColor,
iconSize: 24,
padding: EdgeInsets.fromLTRB(16, 8, 16, 8),
duration: Duration(milliseconds: 200),
gap: 0,
tabBorderRadius: 24,
tabBackgroundColor: Colors.white,
tabBackgroundColor: Theme.of(context)
.colorScheme
.gNavBarActiveColor,
haptic: false,
tabs: [
GButton(
margin: EdgeInsets.fromLTRB(6, 6, 0, 6),
icon: Icons.home,
iconColor: Colors.black,
iconColor: Theme.of(context)
.colorScheme
.gNavIconColor,
iconActiveColor: Theme.of(context)
.colorScheme
.gNavActiveIconColor,
text: '',
onPressed: () {
_onTabChange(
@ -620,7 +628,12 @@ class _HomeBottomNavigationBarState extends State<HomeBottomNavigationBar> {
GButton(
margin: EdgeInsets.fromLTRB(0, 6, 0, 6),
icon: Icons.photo_library,
iconColor: Colors.black,
iconColor: Theme.of(context)
.colorScheme
.gNavIconColor,
iconActiveColor: Theme.of(context)
.colorScheme
.gNavActiveIconColor,
text: '',
onPressed: () {
_onTabChange(
@ -630,7 +643,12 @@ class _HomeBottomNavigationBarState extends State<HomeBottomNavigationBar> {
GButton(
margin: EdgeInsets.fromLTRB(0, 6, 0, 6),
icon: Icons.folder_shared,
iconColor: Colors.black,
iconColor: Theme.of(context)
.colorScheme
.gNavIconColor,
iconActiveColor: Theme.of(context)
.colorScheme
.gNavActiveIconColor,
text: '',
onPressed: () {
_onTabChange(
@ -640,7 +658,12 @@ class _HomeBottomNavigationBarState extends State<HomeBottomNavigationBar> {
GButton(
margin: EdgeInsets.fromLTRB(0, 6, 6, 6),
icon: Icons.person,
iconColor: Colors.black,
iconColor: Theme.of(context)
.colorScheme
.gNavIconColor,
iconActiveColor: Theme.of(context)
.colorScheme
.gNavActiveIconColor,
text: '',
onPressed: () {
_onTabChange(

View file

@ -40,7 +40,7 @@ class ScrollBarThumb extends StatelessWidget {
child: Text(
title,
style: TextStyle(
color: Colors.white,
color: drawColor,
fontWeight: FontWeight.bold,
backgroundColor: Colors.transparent,
fontSize: 14,

View file

@ -99,7 +99,7 @@ class _MemoryWidgetState extends State<MemoryWidget> {
setState(() {});
},
child: SizedBox(
width: 100,
width: 92,
height: 100,
child: Padding(
padding: const EdgeInsets.all(8.0),

View file

@ -1,5 +1,4 @@
import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
import 'package:logging/logging.dart';
import 'package:photos/core/cache/thumbnail_cache.dart';
import 'package:photos/core/constants.dart';
@ -126,9 +125,14 @@ class _ThumbnailWidgetState extends State<ThumbnailWidget> {
),
);
static final Widget loadingWidget = Container(
static final Widget lightLoadWidget = Container(
alignment: Alignment.center,
color: Colors.grey[900],
color: Color.fromRGBO(240, 240, 240, 1),
);
static final Widget darkLoadWidget = Container(
alignment: Alignment.center,
color: Color.fromRGBO(20, 20, 20, 1),
);
bool _hasLoadedThumbnail = false;
@ -201,7 +205,7 @@ class _ThumbnailWidgetState extends State<ThumbnailWidget> {
}
}
List<Widget> viewChildrens = [
loadingWidget,
_getLoadingWidget(),
AnimatedOpacity(
opacity: content == null ? 0 : 1.0,
duration: Duration(milliseconds: 200),
@ -347,4 +351,10 @@ class _ThumbnailWidgetState extends State<ThumbnailWidget> {
_errorLoadingRemoteThumbnail = false;
_imageProvider = null;
}
Widget _getLoadingWidget() {
return Theme.of(context).brightness == Brightness.light
? lightLoadWidget
: darkLoadWidget;
}
}

View file

@ -166,7 +166,7 @@ bool isLeapYear(DateTime dateTime) {
Widget getDayWidget(
BuildContext context, int timestamp, bool smallerTodayFont) {
return Container(
padding: const EdgeInsets.fromLTRB(12, 14, 0, 12),
padding: const EdgeInsets.fromLTRB(4, 14, 0, 8),
alignment: Alignment.centerLeft,
child: Text(
getDayTitle(timestamp),