feat: add course bar length setting and clear blue glass Dock
This commit is contained in:
@@ -62,6 +62,7 @@ class AppSnapshot {
|
||||
'singleColorArgb': settings.singleColorArgb,
|
||||
'calendarEnabled': settings.calendarEnabled,
|
||||
'calendarId': settings.calendarId,
|
||||
'courseHeightScale': settings.courseHeightScale,
|
||||
},
|
||||
'importMetadata': importMetadata == null
|
||||
? null
|
||||
@@ -90,6 +91,15 @@ class AppSnapshot {
|
||||
}
|
||||
final color = s['singleColorArgb'] as int;
|
||||
if (color < 0 || color > 0xFFFFFFFF) throw const FormatException('颜色无效');
|
||||
final rawHeight = s.containsKey('courseHeightScale')
|
||||
? s['courseHeightScale']
|
||||
: AppSettings.defaultCourseHeightScale;
|
||||
if (rawHeight is! num ||
|
||||
!rawHeight.isFinite ||
|
||||
rawHeight < AppSettings.minCourseHeightScale ||
|
||||
rawHeight > AppSettings.maxCourseHeightScale) {
|
||||
throw const FormatException('课程条长度无效');
|
||||
}
|
||||
final sem = s['semester'];
|
||||
final term = sem == null
|
||||
? null
|
||||
@@ -110,6 +120,7 @@ class AppSnapshot {
|
||||
singleColorArgb: color,
|
||||
calendarEnabled: s['calendarEnabled'] as bool,
|
||||
calendarId: s['calendarId'] as String?,
|
||||
courseHeightScale: rawHeight.toDouble(),
|
||||
),
|
||||
importMetadata: metadata == null
|
||||
? null
|
||||
|
||||
Reference in New Issue
Block a user