Skip to content

Commit db5fea9

Browse files
committed
Simplified the source section expand/collapse tracking: it will now always be expanded unless the user has collapsed a section.
1 parent aa99d77 commit db5fea9

1 file changed

Lines changed: 0 additions & 56 deletions

File tree

VidCoder/ViewModel/MainViewModel.cs

Lines changed: 0 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -1134,29 +1134,6 @@ private SourceSection GetSectionExpansion()
11341134
{
11351135
if (!userCollapsedSections.HasFlag(newSection))
11361136
{
1137-
SourceSection sectionsWithNewExpansion = sections | newSection;
1138-
if (this.GetTotalHeight(sectionsWithNewExpansion) > availableHeight)
1139-
{
1140-
// Failed to open section. Bail with current list.
1141-
return sections;
1142-
}
1143-
1144-
sections = sections | newSection;
1145-
}
1146-
}
1147-
1148-
// Second pass see if we can open more sections.
1149-
foreach (SourceSection newSection in SourceSectionPriority)
1150-
{
1151-
if (userCollapsedSections.HasFlag(newSection))
1152-
{
1153-
SourceSection sectionsWithNewExpansion = sections | newSection;
1154-
if (this.GetTotalHeight(sectionsWithNewExpansion) > availableHeight)
1155-
{
1156-
// Failed to open section. Bail with current list.
1157-
return sections;
1158-
}
1159-
11601137
sections = sections | newSection;
11611138
}
11621139
}
@@ -1185,39 +1162,6 @@ private static SourceSection GetUserCollapsedSections()
11851162
return sections;
11861163
}
11871164

1188-
private double GetTotalHeight(SourceSection expandedSections)
1189-
{
1190-
double height = 98;
1191-
1192-
if (expandedSections.HasFlag(SourceSection.Video))
1193-
{
1194-
height += 110;
1195-
}
1196-
1197-
int audioCount = this.SelectedTitle.AudioList.Count;
1198-
if (audioCount > 0 && expandedSections.HasFlag(SourceSection.Audio))
1199-
{
1200-
height += 24;
1201-
height += audioCount * 27;
1202-
}
1203-
1204-
int subtitleCount = this.SelectedTitle.SubtitleList.Count;
1205-
if (subtitleCount > 0 && expandedSections.HasFlag(SourceSection.Subtitles))
1206-
{
1207-
height += 24;
1208-
height += subtitleCount * 27;
1209-
}
1210-
1211-
if (this.PresetsService.SelectedPreset.Preset.EncodingProfile.IncludeChapterMarkers
1212-
&& this.SelectedTitle.ChapterList != null
1213-
&& this.SelectedTitle.ChapterList.Count > 0)
1214-
{
1215-
height += 31;
1216-
}
1217-
1218-
return height;
1219-
}
1220-
12211165
private bool videoExpanded;
12221166
public bool VideoExpanded
12231167
{

0 commit comments

Comments
 (0)