Juniper Theme #570
|
@ -165,7 +165,7 @@ class Settings extends ChangeNotifier {
|
|||
if (code.length == 1) {
|
||||
this.switchLocale(Locale(languageCode));
|
||||
} else {
|
||||
this.switchLocale(Locale(code[0],code[1]));
|
||||
this.switchLocale(Locale(code[0], code[1]));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,43 @@
|
|||
import 'dart:ui';
|
||||
import 'dart:core';
|
||||
|
||||
import 'package:cwtch/themes/cwtch.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'opaque.dart';
|
||||
|
||||
const juniper_theme = "juniper";
|
||||
|
||||
OpaqueThemeType GetJuniperTheme(String mode) {
|
||||
// there is only one juniper theme
|
||||
return Juniper();
|
||||
}
|
||||
|
||||
class Juniper extends CwtchDark {
|
||||
static final Color background = Color(0xFF1B1B1B);
|
||||
static final Color backgroundAlt = Color(0xFF494949);
|
||||
static final Color header = Color(0xFF1B1B1B);
|
||||
static final Color userBubble = Color(0xFF373737);
|
||||
static final Color peerBubble = Color(0xFF494949);
|
||||
static final Color font = Color(0xFFFFFFFF);
|
||||
static final Color settings = Color(0xFFFFFDFF);
|
||||
static final Color accent = Color(0xFF9E6A56);
|
||||
|
||||
get theme => juniper_theme;
|
||||
get mode => mode_dark;
|
||||
|
||||
get backgroundMainColor => background; // darkGreyPurple;
|
||||
get backgroundPaneColor => header; //darkGreyPurple;
|
||||
get topbarColor => header; //darkGreyPurple;
|
||||
get mainTextColor => font; //whiteishPurple;
|
||||
get defaultButtonColor => accent; //hotPink;
|
||||
get textfieldHintColor => mainTextColor; //TODO pick
|
||||
get toolbarIconColor => settings; //whiteishPurple;
|
||||
get messageFromMeBackgroundColor => userBubble; // mauvePurple;
|
||||
get messageFromMeTextColor => font; //whiteishPurple;
|
||||
get messageFromOtherBackgroundColor => peerBubble; //deepPurple;
|
||||
get messageFromOtherTextColor => font; //whiteishPurple;
|
||||
get textfieldBackgroundColor => peerBubble;
|
||||
get textfieldBorderColor => userBubble;
|
||||
get backgroundHilightElementColor => backgroundAlt;
|
||||
}
|
|
@ -336,7 +336,7 @@ class _ProfileMgrViewState extends State<ProfileMgrView> {
|
|||
Widget _buildProfileManager() {
|
||||
return Consumer<ProfileListState>(
|
||||
builder: (context, pls, child) {
|
||||
final tiles = pls.profiles.map(
|
||||
var tiles = pls.profiles.map(
|
||||
(ProfileInfoState profile) {
|
||||
return ChangeNotifierProvider<ProfileInfoState>.value(
|
||||
value: profile,
|
||||
|
@ -345,17 +345,70 @@ class _ProfileMgrViewState extends State<ProfileMgrView> {
|
|||
},
|
||||
);
|
||||
|
||||
List<ChangeNotifierProvider<ProfileInfoState>> widgetTiles = tiles.toList(growable: true);
|
||||
widgetTiles.add(ChangeNotifierProvider<ProfileInfoState>.value(
|
||||
value: ProfileInfoState(onion: ""),
|
||||
builder: (context, child) {
|
||||
return Container(
|
||||
margin: EdgeInsets.only(top: 20),
|
||||
width: MediaQuery.of(context).size.width,
|
||||
child: Row(mainAxisAlignment: MainAxisAlignment.spaceAround, children: [
|
||||
Tooltip(
|
||||
message: AppLocalizations.of(context)!.tooltipUnlockProfiles,
|
||||
child: TextButton.icon(
|
||||
icon: Icon(CwtchIcons.lock_open_24px, color: Provider.of<Settings>(context).current().mainTextColor),
|
||||
style: TextButton.styleFrom(
|
||||
minimumSize: Size(MediaQuery.of(context).size.width * 0.79, 50),
|
||||
maximumSize: Size(MediaQuery.of(context).size.width * 0.8, 50),
|
||||
shape: RoundedRectangleBorder(borderRadius: BorderRadius.horizontal(left: Radius.circular(180), right: Radius.circular(180))),
|
||||
),
|
||||
label: Text(
|
||||
AppLocalizations.of(context)!.unlock,
|
||||
semanticsLabel: AppLocalizations.of(context)!.unlock,
|
||||
style: TextStyle(fontWeight: FontWeight.bold),
|
||||
),
|
||||
onPressed: () {
|
||||
_modalUnlockProfiles();
|
||||
},
|
||||
)),
|
||||
]));
|
||||
}));
|
||||
|
||||
final divided = ListTile.divideTiles(
|
||||
context: context,
|
||||
tiles: tiles,
|
||||
tiles: widgetTiles,
|
||||
).toList();
|
||||
|
||||
// Display the welcome message / unlock profiles button to new accounts
|
||||
if (tiles.isEmpty) {
|
||||
return Center(
|
||||
child: Text(
|
||||
AppLocalizations.of(context)!.unlockProfileTip,
|
||||
textAlign: TextAlign.center,
|
||||
));
|
||||
child: Column(mainAxisSize: MainAxisSize.min, mainAxisAlignment: MainAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center, children: [
|
||||
Text(AppLocalizations.of(context)!.unlockProfileTip, textAlign: TextAlign.center),
|
||||
Container(
|
||||
width: MediaQuery.of(context).size.width,
|
||||
margin: EdgeInsets.only(top: 20),
|
||||
child: Row(mainAxisAlignment: MainAxisAlignment.spaceAround, children: [
|
||||
Tooltip(
|
||||
message: AppLocalizations.of(context)!.addProfileTitle,
|
||||
child: TextButton.icon(
|
||||
icon: Icon(Icons.add, color: Provider.of<Settings>(context).current().mainTextColor),
|
||||
style: TextButton.styleFrom(
|
||||
minimumSize: Size(MediaQuery.of(context).size.width * 0.79, 50),
|
||||
maximumSize: Size(MediaQuery.of(context).size.width * 0.8, 50),
|
||||
shape: RoundedRectangleBorder(borderRadius: BorderRadius.horizontal(left: Radius.circular(180), right: Radius.circular(180))),
|
||||
),
|
||||
label: Text(
|
||||
AppLocalizations.of(context)!.addProfileTitle,
|
||||
semanticsLabel: AppLocalizations.of(context)!.addProfileTitle,
|
||||
style: TextStyle(fontWeight: FontWeight.bold),
|
||||
),
|
||||
onPressed: () {
|
||||
_modalAddImportProfiles();
|
||||
},
|
||||
)),
|
||||
])),
|
||||
widgetTiles[0]
|
||||
]));
|
||||
}
|
||||
|
||||
return ListView(children: divided);
|
||||
|
|
Loading…
Reference in New Issue