Compare commits

...

5 Commits

Author SHA1 Message Date
Dan Ballard 58f7713eae fix button theme inconsistancies across themes, normalize to android standards
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is pending Details
2024-06-07 18:55:05 -07:00
Dan Ballard 899da5fea1 linux cmake fix for arm64 compiling
continuous-integration/drone/pr Build is pending Details
continuous-integration/drone/push Build is pending Details
2024-04-21 19:34:12 -07:00
Sarah Jamie Lewis 7741b255da
Format
continuous-integration/drone/pr Build is pending Details
continuous-integration/drone/push Build is pending Details
2024-04-16 10:58:30 -07:00
Sarah Jamie Lewis 3aa0042b71
Fix scaling on Contact Row Accept/Reject / Fix Color Blending 2024-04-16 10:58:22 -07:00
Sarah Jamie Lewis 4cb59d6cbc Merge pull request 'theme loading must take place after cwtch.Start so `dev/` has time to be appended to path' (#880) from themeFixes2 into trunk
continuous-integration/drone/push Build is pending Details
Reviewed-on: #880
Reviewed-by: Sarah Jamie Lewis <sarah@openprivacy.ca>
2024-04-16 17:57:29 +00:00
13 changed files with 67 additions and 52 deletions

View File

@ -58,9 +58,6 @@ class CwtchNotifier {
// EnvironmentConfig.debugLog("NewEvent $type $data");
switch (type) {
case "CwtchStarted":
if (data["Reload"] == "true" && profileCN.num > 0) {
// don't reload...
// unless we have loaded no profiles...then there isnt a risk and this

View File

@ -106,7 +106,7 @@ class FlwtchState extends State<Flwtch> with WindowListener {
// Cwtch.start can take time, we don't want it blocking first splash screen draw, so postpone a smidge to let splash render
Future.delayed(const Duration(milliseconds: 100), () {
print("initState delayed: invoking cwtch.Start()");
cwtch.Start().then( (v) {
cwtch.Start().then((v) {
cwtch.getCwtchDir().then((dir) {
globalSettings.themeloader.LoadThemes(dir);
});

View File

@ -236,9 +236,35 @@ ThemeData mkThemeData(Settings opaque) {
enableFeedback: true,
textStyle: MaterialStateProperty.all(opaque.scaleFonts(defaultTextButtonStyle)),
padding: MaterialStateProperty.all(EdgeInsets.all(20)),
shape: MaterialStateProperty.all(RoundedRectangleBorder(
borderRadius: BorderRadius.circular(6.0),
)),
),
),
filledButtonTheme: FilledButtonThemeData(
style: ButtonStyle(
backgroundColor: MaterialStateProperty.resolveWith((states) => states.contains(MaterialState.disabled) ? opaque.current().defaultButtonDisabledColor : opaque.current().defaultButtonColor),
foregroundColor: MaterialStateProperty.all(opaque.current().defaultButtonTextColor),
overlayColor: MaterialStateProperty.resolveWith((states) => (states.contains(MaterialState.pressed) && states.contains(MaterialState.hovered))
? opaque.current().defaultButtonActiveColor
: states.contains(MaterialState.disabled)
? opaque.current().defaultButtonDisabledColor
: null),
enableFeedback: true,
textStyle: MaterialStateProperty.all(opaque.scaleFonts(defaultTextButtonStyle)),
padding: MaterialStateProperty.all(EdgeInsets.all(20)),
),
),
outlinedButtonTheme: OutlinedButtonThemeData(
style: ButtonStyle(
backgroundColor: MaterialStateProperty.resolveWith((states) => states.contains(MaterialState.disabled) ? opaque.current().defaultButtonDisabledColor : opaque.current().backgroundMainColor),
foregroundColor: MaterialStateProperty.all(opaque.current().mainTextColor),
side: MaterialStateProperty.all(BorderSide(color: opaque.current().defaultButtonColor)),
overlayColor: MaterialStateProperty.resolveWith((states) => (states.contains(MaterialState.pressed) && states.contains(MaterialState.hovered))
? opaque.current().defaultButtonActiveColor
: states.contains(MaterialState.disabled)
? opaque.current().defaultButtonDisabledColor
: null),
enableFeedback: true,
textStyle: MaterialStateProperty.all(opaque.scaleFonts(defaultTextButtonStyle)),
padding: MaterialStateProperty.all(EdgeInsets.all(20)),
),
),
scrollbarTheme: ScrollbarThemeData(thumbVisibility: MaterialStateProperty.all(false), thumbColor: MaterialStateProperty.all(opaque.current().scrollbarDefaultColor)),

View File

@ -414,11 +414,10 @@ class _AddEditProfileViewState extends State<AddEditProfileView> {
visible: Provider.of<ProfileInfoState>(context, listen: false).onion.isNotEmpty,
child: Tooltip(
message: AppLocalizations.of(context)!.exportProfileTooltip,
child: ElevatedButton.icon(
style: ElevatedButton.styleFrom(
child: OutlinedButton.icon(
style: OutlinedButton.styleFrom(
minimumSize: Size(400, 75),
maximumSize: Size(800, 75),
shape: RoundedRectangleBorder(borderRadius: BorderRadius.horizontal(left: Radius.circular(180), right: Radius.circular(180))),
),
onPressed: () {
if (Platform.isAndroid) {
@ -445,10 +444,9 @@ class _AddEditProfileViewState extends State<AddEditProfileView> {
visible: Provider.of<ProfileInfoState>(context, listen: false).onion.isNotEmpty,
child: Tooltip(
message: AppLocalizations.of(context)!.enterCurrentPasswordForDelete,
child: ElevatedButton.icon(
style: ElevatedButton.styleFrom(
child: FilledButton.icon(
style: FilledButton.styleFrom(
minimumSize: Size(400, 75),
backgroundColor: Provider.of<Settings>(context).theme.backgroundMainColor,
maximumSize: Size(800, 75),
shape: RoundedRectangleBorder(
side: BorderSide(color: Provider.of<Settings>(context).theme.defaultButtonActiveColor, width: 2.0),
@ -458,7 +456,7 @@ class _AddEditProfileViewState extends State<AddEditProfileView> {
showAlertDialog(context);
},
icon: Icon(Icons.delete_forever),
label: Text(AppLocalizations.of(context)!.deleteBtn, style: TextStyle(color: Provider.of<Settings>(context).theme.defaultButtonActiveColor)),
label: Text(AppLocalizations.of(context)!.deleteBtn),
)))
]))))));
});

View File

@ -281,20 +281,16 @@ class _AddEditServerViewState extends State<AddEditServerView> {
height: 20,
),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Expanded(
child: ElevatedButton(
Column(mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.end, children: [
ElevatedButton(
onPressed: serverInfoState.onion.isEmpty ? _createPressed : _savePressed,
child: Text(
serverInfoState.onion.isEmpty ? AppLocalizations.of(context)!.addServerTitle : AppLocalizations.of(context)!.saveServerButton,
textAlign: TextAlign.center,
),
),
),
],
),
]),
Visibility(
visible: serverInfoState.onion.isNotEmpty,
child: Column(mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.end, children: [

View File

@ -118,7 +118,7 @@ class _GlobalSettingsAppearanceViewState extends State<GlobalSettingsAppearanceV
//.fileSharingSettingsDownloadFolderDescription,
trailing: Container(
width: MediaQuery.of(context).size.width / 4,
child: ElevatedButton.icon(
child: OutlinedButton.icon(
label: Text(AppLocalizations.of(context)!.settingsImportThemeButton),
onPressed: Provider.of<AppState>(context).disableFilePicker
? null

View File

@ -152,7 +152,7 @@ class _GroupSettingsViewState extends State<GroupSettingsView> {
),
Tooltip(
message: AppLocalizations.of(context)!.archiveConversation,
child: ElevatedButton.icon(
child: OutlinedButton.icon(
onPressed: () {
var profileOnion = Provider.of<ContactInfoState>(context, listen: false).profileOnion;
var handle = Provider.of<ContactInfoState>(context, listen: false).identifier;
@ -173,17 +173,13 @@ class _GroupSettingsViewState extends State<GroupSettingsView> {
Row(crossAxisAlignment: CrossAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.end, children: [
Tooltip(
message: AppLocalizations.of(context)!.leaveConversation,
child: TextButton.icon(
child: OutlinedButton.icon(
onPressed: () {
showAlertDialog(context);
},
style: ButtonStyle(
backgroundColor: MaterialStateProperty.all(Provider.of<Settings>(context).theme.backgroundPaneColor),
foregroundColor: MaterialStateProperty.all(Provider.of<Settings>(context).theme.mainTextColor)),
icon: Icon(CwtchIcons.leave_group),
label: Text(
AppLocalizations.of(context)!.leaveConversation,
style: settings.scaleFonts(defaultTextButtonStyle.copyWith(decoration: TextDecoration.underline)),
),
))
])

View File

@ -624,7 +624,7 @@ class _MessageViewState extends State<MessageView> {
var vline = Padding(
padding: EdgeInsets.symmetric(vertical: 1, horizontal: 2),
child: Container(height: 16, width: 1, decoration: BoxDecoration(color: Provider.of<Settings>(context).theme.messageFromMeTextColor)));
child: Container(height: 16, width: 1, decoration: BoxDecoration(color: Provider.of<Settings>(context).theme.toolbarIconColor)));
var formattingToolbar = Container(
decoration: BoxDecoration(color: Provider.of<Settings>(context).theme.defaultButtonActiveColor),
@ -920,7 +920,7 @@ class _MessageViewState extends State<MessageView> {
height: 10,
)),
Row(mainAxisAlignment: MainAxisAlignment.center, children: [
ElevatedButton(
OutlinedButton(
child: Text(AppLocalizations.of(context)!.cancel, semanticsLabel: AppLocalizations.of(context)!.cancel),
onPressed: () {
Navigator.pop(bcontext);
@ -929,7 +929,7 @@ class _MessageViewState extends State<MessageView> {
SizedBox(
width: 20,
),
ElevatedButton(
FilledButton(
child: Text(AppLocalizations.of(context)!.btnSendFile, semanticsLabel: AppLocalizations.of(context)!.btnSendFile),
onPressed: () {
_sendFile(path);

View File

@ -294,7 +294,7 @@ class _PeerSettingsViewState extends State<PeerSettingsView> {
Row(crossAxisAlignment: CrossAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.end, children: [
Tooltip(
message: AppLocalizations.of(context)!.archiveConversation,
child: ElevatedButton.icon(
child: OutlinedButton.icon(
onPressed: () {
var profileOnion = Provider.of<ContactInfoState>(context, listen: false).profileOnion;
var handle = Provider.of<ContactInfoState>(context, listen: false).identifier;
@ -316,17 +316,13 @@ class _PeerSettingsViewState extends State<PeerSettingsView> {
Row(crossAxisAlignment: CrossAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.end, children: [
Tooltip(
message: AppLocalizations.of(context)!.leaveConversation,
child: TextButton.icon(
child: OutlinedButton.icon(
onPressed: () {
showAlertDialog(context);
},
style: ButtonStyle(
backgroundColor: MaterialStateProperty.all(Provider.of<Settings>(context).theme.backgroundPaneColor),
foregroundColor: MaterialStateProperty.all(Provider.of<Settings>(context).theme.mainTextColor)),
icon: Icon(CwtchIcons.leave_group),
label: Text(
AppLocalizations.of(context)!.leaveConversation,
style: settings.scaleFonts(defaultTextButtonStyle.copyWith(decoration: TextDecoration.underline)),
),
))
]),

View File

@ -89,6 +89,7 @@ class _ProfileMgrViewState extends State<ProfileMgrView> {
icon: TorIcon(),
onPressed: _pushTorStatus,
splashRadius: Material.defaultSplashRadius / 2,
color: Provider.of<ProfileListState>(context).profiles.isEmpty ? Provider.of<Settings>(context).theme.defaultButtonColor : Provider.of<Settings>(context).theme.mainTextColor,
tooltip: Provider.of<TorStatus>(context).progress == 100
? AppLocalizations.of(context)!.networkStatusOnline
: (Provider.of<TorStatus>(context).progress == 0 ? AppLocalizations.of(context)!.networkStatusDisconnected : AppLocalizations.of(context)!.networkStatusAttemptingTor),
@ -242,10 +243,9 @@ class _ProfileMgrViewState extends State<ProfileMgrView> {
Expanded(
child: Tooltip(
message: AppLocalizations.of(context)!.importProfileTooltip,
child: ElevatedButton(
child: OutlinedButton(
style: ElevatedButton.styleFrom(
minimumSize: Size(399, 20),
backgroundColor: Provider.of<Settings>(context).theme.backgroundMainColor,
maximumSize: Size(400, 20),
shape: RoundedRectangleBorder(
side: BorderSide(color: Provider.of<Settings>(context).theme.defaultButtonActiveColor, width: 2.0),
@ -253,7 +253,7 @@ class _ProfileMgrViewState extends State<ProfileMgrView> {
),
child: Text(AppLocalizations.of(context)!.importProfile,
semanticsLabel: AppLocalizations.of(context)!.importProfile,
style: TextStyle(color: Provider.of<Settings>(context).theme.mainTextColor, fontWeight: FontWeight.bold)),
),
onPressed: () {
// 10GB profiles should be enough for anyone?
showFilePicker(context, MaxGeneralFileSharingSize, (file) {
@ -359,8 +359,8 @@ class _ProfileMgrViewState extends State<ProfileMgrView> {
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().defaultButtonTextColor),
child: FilledButton.icon(
icon: Icon(CwtchIcons.lock_open_24px),
style: TextButton.styleFrom(
minimumSize: Size(MediaQuery.of(context).size.width * 0.79, 80),
maximumSize: Size(MediaQuery.of(context).size.width * 0.8, 80),
@ -369,7 +369,7 @@ class _ProfileMgrViewState extends State<ProfileMgrView> {
label: Text(
AppLocalizations.of(context)!.unlock,
semanticsLabel: AppLocalizations.of(context)!.unlock,
style: TextStyle(fontWeight: FontWeight.bold, color: Provider.of<Settings>(context).current().defaultButtonTextColor),
style: TextStyle(fontWeight: FontWeight.bold),
),
onPressed: () {
_modalUnlockProfiles();
@ -395,8 +395,8 @@ class _ProfileMgrViewState extends State<ProfileMgrView> {
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),
child: FilledButton.icon(
icon: Icon(Icons.add),
style: TextButton.styleFrom(
minimumSize: Size(MediaQuery.of(context).size.width * 0.79, 80),
maximumSize: Size(MediaQuery.of(context).size.width * 0.8, 80),

View File

@ -56,8 +56,7 @@ class _SplashViewState extends State<SplashView> {
: appState.modalState == ModalState.storageMigration
? AppLocalizations.of(context)!.storageMigrationModalMessage
: AppLocalizations.of(context)!.shuttingDownApp, // Todo l10n AppLocalizations.of(context)!.storageMigrationModalMessage
style: defaultTextButtonStyle.copyWith(
fontSize: 16.0, fontFamily: "Inter", color: appState.appError == "" ? whiteishPurple : hotPink))),
style: defaultTextButtonStyle.copyWith(fontSize: 16.0, fontFamily: "Inter", color: appState.appError == "" ? whiteishPurple : hotPink))),
Visibility(
visible: appState.modalState == ModalState.storageMigration || appState.modalState == ModalState.shutdown,
child: LinearProgressIndicator(

View File

@ -63,7 +63,7 @@ class _ContactRowState extends State<ContactRow> {
enableFeedback: true,
splashFactory: InkSplash.splashFactory,
child: Ink(
color: selected ? Provider.of<Settings>(context).theme.backgroundHilightElementColor : Colors.transparent,
color: selected ? (Provider.of<Settings>(context).theme.backgroundHilightElementColor as Color).withOpacity(0.8) : Colors.transparent,
child: Container(
child: Row(mainAxisAlignment: MainAxisAlignment.spaceBetween, crossAxisAlignment: CrossAxisAlignment.center, children: [
Padding(
@ -123,8 +123,8 @@ class _ContactRowState extends State<ContactRow> {
height: contact.isInvitation ? Provider.of<Settings>(context).fontScaling * 14.0 + 35.0 : Provider.of<Settings>(context).fontScaling * 14.0 + 5.0,
child: contact.isInvitation == true
? FittedBox(
fit: BoxFit.cover,
child: Row(mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.center, children: <Widget>[
fit: BoxFit.scaleDown,
child: Wrap(children: <Widget>[
Padding(
padding: EdgeInsets.all(2),
child: TextButton.icon(

View File

@ -40,12 +40,19 @@ endif()
# default. In most cases, you should add new options to specific targets instead
# of modifying this function.
function(APPLY_STANDARD_SETTINGS TARGET)
# Not ideal, there doesn't appear to be a way to get target arch so getting host arch. won't work for cross compiling
execute_process(COMMAND uname -m OUTPUT_STRIP_TRAILING_WHITESPACE OUTPUT_VARIABLE ARCH)
target_compile_features(${TARGET} PUBLIC cxx_std_14)
target_compile_options(${TARGET} PRIVATE "$<$<NOT:$<CONFIG:Debug>>:-O3>")
target_compile_definitions(${TARGET} PRIVATE "$<$<NOT:$<CONFIG:Debug>>:NDEBUG>")
# -Os -fno-ident (optimize for size, and strip idents, don't generate a build-id, fix hash style)
target_compile_options(${TARGET} PRIVATE -Wall -Werror -Os -fno-ident)
target_link_libraries(${TARGET} PRIVATE -Qn -Os -Wl,-s,--hash-style=gnu,--build-id=none,--script=${PROJECT_BUILD_DIR}/../elf_x86_64.x)
# on x86_64 use an included elf_x86_64.x for reproducibility. for other arches don't (and then don't be reproducible)
if(${ARCH} STREQUAL "x86_64")
target_link_libraries(${TARGET} PRIVATE -Qn -Os -Wl,-s,--hash-style=gnu,--build-id=none,--script=${PROJECT_BUILD_DIR}/../elf_x86_64.x)
else()
target_link_libraries(${TARGET} PRIVATE -Qn -Os -Wl,-s,--hash-style=gnu,--build-id=none)
endif()
endfunction()
# Flutter library and tool build rules.