Juniper Theme #570
|
@ -165,7 +165,7 @@ class Settings extends ChangeNotifier {
|
||||||
if (code.length == 1) {
|
if (code.length == 1) {
|
||||||
this.switchLocale(Locale(languageCode));
|
this.switchLocale(Locale(languageCode));
|
||||||
} else {
|
} else {
|
||||||
this.switchLocale(Locale(code[0],code[1]));
|
this.switchLocale(Locale(code[0], code[1]));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,64 @@
|
||||||
|
/// A theme dedicated to Juniper
|
||||||
|
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);
|
||||||
|
static final Color accentAlt = Color(0xFF845A48);
|
||||||
|
|
||||||
|
|
||||||
|
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 => accent;
|
||||||
|
|
||||||
|
get sendHintTextColor => accentAlt;
|
||||||
|
get hilightElementColor => accentAlt;
|
||||||
|
get defaultButtonTextColor => mainTextColor;
|
||||||
|
get defaultButtonDisabledColor => peerBubble;
|
||||||
|
get defaultButtonDisabledTextColor => peerBubble;
|
||||||
|
get textfieldErrorColor => accent;
|
||||||
|
get scrollbarDefaultColor => accent;
|
||||||
|
get portraitBackgroundColor => header;
|
||||||
|
get portraitOnlineBorderColor => font;
|
||||||
|
get portraitOfflineBorderColor => peerBubble;
|
||||||
|
get portraitBlockedBorderColor => peerBubble;
|
||||||
|
get portraitBlockedTextColor => peerBubble;
|
||||||
|
get portraitContactBadgeColor => accent;
|
||||||
|
get portraitContactBadgeTextColor => mainTextColor;
|
||||||
|
get portraitProfileBadgeColor => accent;
|
||||||
|
get portraitProfileBadgeTextColor => mainTextColor;
|
||||||
|
get dropShadowColor => accentAlt;
|
||||||
|
}
|
|
@ -2,6 +2,7 @@ import 'dart:ui';
|
||||||
import 'dart:core';
|
import 'dart:core';
|
||||||
|
|
||||||
import 'package:cwtch/themes/cwtch.dart';
|
import 'package:cwtch/themes/cwtch.dart';
|
||||||
|
import 'package:cwtch/themes/juniper.dart';
|
||||||
import 'package:cwtch/themes/mermaid.dart';
|
import 'package:cwtch/themes/mermaid.dart';
|
||||||
import 'package:cwtch/themes/neon1.dart';
|
import 'package:cwtch/themes/neon1.dart';
|
||||||
import 'package:cwtch/themes/pumpkin.dart';
|
import 'package:cwtch/themes/pumpkin.dart';
|
||||||
|
@ -21,6 +22,7 @@ const mode_dark = "dark";
|
||||||
final themes = {
|
final themes = {
|
||||||
cwtch_theme: {mode_light: CwtchLight(), mode_dark: CwtchDark()},
|
cwtch_theme: {mode_light: CwtchLight(), mode_dark: CwtchDark()},
|
||||||
ghost_theme: {mode_light: GhostLight(), mode_dark: GhostDark()},
|
ghost_theme: {mode_light: GhostLight(), mode_dark: GhostDark()},
|
||||||
|
juniper_theme: {mode_light: Juniper(), mode_dark: Juniper()},
|
||||||
mermaid_theme: {mode_light: MermaidLight(), mode_dark: MermaidDark()},
|
mermaid_theme: {mode_light: MermaidLight(), mode_dark: MermaidDark()},
|
||||||
midnight_theme: {mode_light: MidnightLight(), mode_dark: MidnightDark()},
|
midnight_theme: {mode_light: MidnightLight(), mode_dark: MidnightDark()},
|
||||||
neon1_theme: {mode_light: Neon1Light(), mode_dark: Neon1Dark()},
|
neon1_theme: {mode_light: Neon1Light(), mode_dark: Neon1Dark()},
|
||||||
|
|
|
@ -3,6 +3,7 @@ import 'dart:io';
|
||||||
import 'dart:math';
|
import 'dart:math';
|
||||||
import 'package:cwtch/cwtch_icons_icons.dart';
|
import 'package:cwtch/cwtch_icons_icons.dart';
|
||||||
import 'package:cwtch/models/servers.dart';
|
import 'package:cwtch/models/servers.dart';
|
||||||
|
import 'package:cwtch/themes/juniper.dart';
|
||||||
import 'package:cwtch/widgets/folderpicker.dart';
|
import 'package:cwtch/widgets/folderpicker.dart';
|
||||||
import 'package:cwtch/themes/cwtch.dart';
|
import 'package:cwtch/themes/cwtch.dart';
|
||||||
import 'package:cwtch/themes/ghost.dart';
|
import 'package:cwtch/themes/ghost.dart';
|
||||||
|
@ -676,6 +677,8 @@ String getThemeName(context, String theme) {
|
||||||
return AppLocalizations.of(context)!.themeNameVampire;
|
return AppLocalizations.of(context)!.themeNameVampire;
|
||||||
case witch_theme:
|
case witch_theme:
|
||||||
return AppLocalizations.of(context)!.themeNameWitch;
|
return AppLocalizations.of(context)!.themeNameWitch;
|
||||||
|
case juniper_theme:
|
||||||
|
return "Juniper"; // Juniper is a noun, and doesn't get subject to translation...
|
||||||
}
|
}
|
||||||
return theme;
|
return theme;
|
||||||
}
|
}
|
||||||
|
|
|
@ -129,21 +129,23 @@ class _PeerSettingsViewState extends State<PeerSettingsView> {
|
||||||
]),
|
]),
|
||||||
|
|
||||||
// Address Copy Button
|
// Address Copy Button
|
||||||
Column(mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start, children: [
|
Visibility(
|
||||||
SizedBox(
|
visible: settings.streamerMode == false,
|
||||||
height: 20,
|
child: Column(mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start, children: [
|
||||||
),
|
SizedBox(
|
||||||
CwtchLabel(label: AppLocalizations.of(context)!.addressLabel),
|
height: 20,
|
||||||
SizedBox(
|
),
|
||||||
height: 20,
|
CwtchLabel(label: AppLocalizations.of(context)!.addressLabel),
|
||||||
),
|
SizedBox(
|
||||||
CwtchButtonTextField(
|
height: 20,
|
||||||
controller: TextEditingController(text: Provider.of<ContactInfoState>(context, listen: false).onion),
|
),
|
||||||
onPressed: _copyOnion,
|
CwtchButtonTextField(
|
||||||
icon: Icon(CwtchIcons.address_copy),
|
controller: TextEditingController(text: Provider.of<ContactInfoState>(context, listen: false).onion),
|
||||||
tooltip: AppLocalizations.of(context)!.copyBtn,
|
onPressed: _copyOnion,
|
||||||
)
|
icon: Icon(CwtchIcons.address_copy),
|
||||||
]),
|
tooltip: AppLocalizations.of(context)!.copyBtn,
|
||||||
|
)
|
||||||
|
])),
|
||||||
Column(mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start, children: [
|
Column(mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start, children: [
|
||||||
SizedBox(
|
SizedBox(
|
||||||
height: 20,
|
height: 20,
|
||||||
|
|
|
@ -336,7 +336,7 @@ class _ProfileMgrViewState extends State<ProfileMgrView> {
|
||||||
Widget _buildProfileManager() {
|
Widget _buildProfileManager() {
|
||||||
return Consumer<ProfileListState>(
|
return Consumer<ProfileListState>(
|
||||||
builder: (context, pls, child) {
|
builder: (context, pls, child) {
|
||||||
final tiles = pls.profiles.map(
|
var tiles = pls.profiles.map(
|
||||||
(ProfileInfoState profile) {
|
(ProfileInfoState profile) {
|
||||||
return ChangeNotifierProvider<ProfileInfoState>.value(
|
return ChangeNotifierProvider<ProfileInfoState>.value(
|
||||||
value: profile,
|
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(
|
final divided = ListTile.divideTiles(
|
||||||
context: context,
|
context: context,
|
||||||
tiles: tiles,
|
tiles: widgetTiles,
|
||||||
).toList();
|
).toList();
|
||||||
|
|
||||||
|
// Display the welcome message / unlock profiles button to new accounts
|
||||||
if (tiles.isEmpty) {
|
if (tiles.isEmpty) {
|
||||||
return Center(
|
return Center(
|
||||||
child: Text(
|
child: Column(mainAxisSize: MainAxisSize.min, mainAxisAlignment: MainAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center, children: [
|
||||||
AppLocalizations.of(context)!.unlockProfileTip,
|
Text(AppLocalizations.of(context)!.unlockProfileTip, textAlign: TextAlign.center),
|
||||||
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);
|
return ListView(children: divided);
|
||||||
|
|
Loading…
Reference in New Issue