Skip to content

Commit

Permalink
Adjust window radius
Browse files Browse the repository at this point in the history
  • Loading branch information
bai-3 authored and bai-3 committed Oct 31, 2024
1 parent b65faec commit 58dc767
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 20 deletions.
2 changes: 2 additions & 0 deletions lib/domain/utils/screen/size_extension.dart
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ extension SizeExtension on num {
///[ScreenUtil.setSp]
double get sp => ScreenUtil().setSp(this);

double get windowRadius => w*5;

///smart size : it check your value - if it is bigger than your value it will set your value
///for example, you have set 16.sm() , if for your screen 16.sp() is bigger than 16 , then it will set 16 not 16.sp()
///I think that it is good for save size balance on big sizes of screen
Expand Down
10 changes: 3 additions & 7 deletions lib/infra/components/window.dart
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,7 @@ class _AeroFrameState extends State<AeroFrame> with WindowListener {
final constTheme = Theme.of(context).extension<ExtColors>()!;
return Container(
decoration: BoxDecoration(
color: constTheme.sidebarBg.withOpacity(0.68),
// border: Border.all(
// color: Theme.of(context).dividerColor.withOpacity(0.3),
// width: (_isMaximized || _isFullScreen) ? 0 : 1,
// ),
color: constTheme.sidebarBg.withOpacity(0.78),
borderRadius: BorderRadius.circular((_isMaximized || _isFullScreen) ? 0 : 14),
boxShadow: <BoxShadow>[
if (!_isMaximized && !_isFullScreen)
Expand All @@ -65,7 +61,7 @@ class _AeroFrameState extends State<AeroFrame> with WindowListener {
child: ClipRRect(
// clipBehavior: Clip.hardEdge,
borderRadius: BorderRadius.circular(
(_isMaximized || _isFullScreen) ? 0 : 16,
(_isMaximized || _isFullScreen) ? 0 : 6.w,
),
child: BackdropFilter(
filter: ImageFilter.blur(sigmaX: 5, sigmaY: 5),
Expand All @@ -74,7 +70,7 @@ class _AeroFrameState extends State<AeroFrame> with WindowListener {
child: ClipRRect(
clipBehavior: Clip.hardEdge,
borderRadius: BorderRadius.circular(
(_isMaximized || _isFullScreen) ? 0 : 12,
(_isMaximized || _isFullScreen) ? 0 : 1.windowRadius,
),
child: widget.child,
),
Expand Down
5 changes: 2 additions & 3 deletions lib/infra/pages/chat/channel/bar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ class ChannelBar extends StatefulWidget implements PreferredSizeWidget {
final link.Room room;
final Widget? tools;
final Function? onBack;
ChannelBar({super.key, this.onBack, this.tools, required this.room, double? height})
: _height = height ?? 60.w;
ChannelBar({super.key, this.onBack, this.tools, required this.room, double? height}) : _height = height ?? 60.w;

@override
State<ChannelBar> createState() => _ChannelBarState();
Expand Down Expand Up @@ -59,7 +58,7 @@ class _ChannelBarState extends State<ChannelBar> {
height: widget._height,
decoration: BoxDecoration(
color: constTheme.centerChannelBg,
borderRadius: BorderRadius.only(topLeft: Radius.circular(10.w)),
borderRadius: BorderRadius.only(topLeft: Radius.circular(1.windowRadius), topRight: Radius.circular(1.windowRadius)),
border: Border(
bottom: BorderSide(color: constTheme.centerChannelDivider),
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,7 @@ class _ChannelDetailPageState extends State<ChannelDetailPage> with WindowListen
backgroundColor: Colors.transparent,
body: Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.only(bottomLeft: Radius.circular(10.w)),
borderRadius: BorderRadius.only(bottomLeft: Radius.circular(1.windowRadius)),
color: constTheme.centerChannelBg,
),
child: Column(
Expand Down
2 changes: 1 addition & 1 deletion lib/infra/pages/chat/channel_list.dart
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class _ChannelListState extends State<ChannelList> {
color: currentId == chat.id ? constTheme.sidebarTextActiveBorder.withOpacity(0.09) : Colors.transparent,
hoverColor: currentId == chat.id ? constTheme.sidebarTextActiveBorder.withOpacity(0.09):constTheme.centerChannelColor.withOpacity(0.08),
radius: 5.w,
margin: EdgeInsets.only(left: 5.w, right: 5.w, bottom: 2.w),
margin: EdgeInsets.only(left: 8.w, right: 8.w, bottom: 2.w),
onPressed: () async {
org.setChannelId(chat.id);
},
Expand Down
4 changes: 2 additions & 2 deletions lib/infra/pages/chat/chat.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import 'package:dtim/application/store/app/org.dart';
import 'package:dtim/domain/utils/screen/screen.dart';
import 'package:dtim/infra/components/components.dart';
import 'package:dtim/application/store/theme.dart';
import 'channel/chat.dart';
import 'channel/channel.dart';
import 'chat_view.dart';

@RoutePage(name: "orgRoute")
Expand Down Expand Up @@ -41,7 +41,7 @@ class _OrgPageState extends State<OrgPage> {
width: leftWidth,
decoration: BoxDecoration(
color: constTheme.centerChannelBg,
borderRadius: BorderRadius.circular(10.w)
borderRadius: BorderRadius.circular(1.windowRadius)
),
margin: EdgeInsets.only(left: 3.w),
child: OrgViewPage(key: const Key("OrgViewPage"), width: leftWidth),
Expand Down
20 changes: 14 additions & 6 deletions lib/infra/pages/chat/chat_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ class _OrgViewPageState extends State<OrgViewPage> {
final constTheme = Theme.of(context).extension<ExtColors>()!;

return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
// moveWindow(
// Row(
Expand Down Expand Up @@ -140,6 +141,18 @@ class _OrgViewPageState extends State<OrgViewPage> {
// height: 1,
// color: constTheme.centerChannelColor.withOpacity(0.08),
// ),
Padding(
padding: EdgeInsets.all(8.w),
child: Text(
"Message",
textAlign: TextAlign.start,
style: TextStyle(
fontWeight: FontWeight.w800,
fontSize: 14.w,
color: constTheme.centerChannelColor,
),
),
),
SingleChildScrollView(
child: showType
? Column(
Expand Down Expand Up @@ -474,12 +487,7 @@ class _OrgViewPageState extends State<OrgViewPage> {
})
],
)
: Column(
children: [
SizedBox(height: 20.w),
const ChannelList(key: Key("ChannelList")),
],
),
: const ChannelList(key: Key("ChannelList")),
),
],
);
Expand Down

0 comments on commit 58dc767

Please sign in to comment.