Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor UI fixes #1386

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions lib/config/themes.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';

Expand Down Expand Up @@ -72,6 +73,10 @@ abstract class FluffyThemes {
useMaterial3: true,
brightness: brightness,
colorScheme: colorScheme,
cupertinoOverrideTheme: const CupertinoThemeData(
// This is required by adaptive_dialog
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you explain here, why it is required?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The issue:
image

The fix:
I thought this should be a common issue, so I've searched if there are any instructions.
and...
The change is guided by the readme of adaptive_dialog https://pub.dev/packages/adaptive_dialog#the-input-text-color-same-with-backgound-when-using-cupertinotextinputdialog

textTheme: CupertinoTextThemeData(),
),
textTheme: PlatformInfos.isDesktop
? brightness == Brightness.light
? Typography.material2018().black.merge(fallbackTextTheme)
Expand Down
4 changes: 4 additions & 0 deletions lib/pages/chat/input_bar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -461,6 +461,10 @@ class InputBar extends StatelessWidget {
final data = content.data;
if (data == null) return;

if (content.mimeType.startsWith("image/")) {
onSubmitImage!(data);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I use this feature mostly with the GBoard when sending a sticker or GIF. Having a dialog every time would be just overhead IMO

Copy link
Author

@k3-cat k3-cat Oct 7, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah... that will be very inconvenient....

But I think media is a bit expensive for the matrix. Currently both Android and web can upload images by pasting. So without visual confirmation, users might accidentally upload contents either they don't want or in its original quality (average screenshot takes about 7M, and in most case it's unnecessary to keep the original quality). Thus, putting more burden on home-level servers.

What if we only show the dialog for images larger than a certain size (e.g. 1M)?

return;
}
final file = MatrixFile(
mimeType: content.mimeType,
bytes: data,
Expand Down