Archived
1
0
This commit is contained in:
Michael Gordeev
2018-12-14 22:44:02 +03:00
parent 8401497f67
commit 0dd6513257
3 changed files with 15 additions and 22 deletions
+2 -1
View File
@@ -16,6 +16,7 @@ using Windows.Storage.Pickers;
using Windows.UI.Notifications; using Windows.UI.Notifications;
using Microsoft.Toolkit.Uwp.Notifications; using Microsoft.Toolkit.Uwp.Notifications;
using System.Diagnostics; using System.Diagnostics;
using System.Threading.Tasks;
namespace FoxTube.Controls namespace FoxTube.Controls
{ {
@@ -70,7 +71,7 @@ namespace FoxTube.Controls
donePanel.Visibility = Visibility.Visible; donePanel.Visibility = Visibility.Visible;
} }
async void Download(MediaStreamInfo info, Video meta, string q) async Task Download(MediaStreamInfo info, Video meta, string q)
{ {
InProgress = true; InProgress = true;
Container = new DownloadItemContainer(); Container = new DownloadItemContainer();
+5 -3
View File
@@ -416,14 +416,16 @@ namespace FoxTube
} }
else else
{ {
nav.CompactModeThresholdWidth = 641; nav.CompactModeThresholdWidth = 641;
nav.ExpandedModeThresholdWidth = 1008; nav.ExpandedModeThresholdWidth = 1008;
nav.Margin = new Thickness(0); nav.Margin = new Thickness(0);
nav.OpenPaneLength = 300;
nav.CompactPaneLength = 40;
if (videoPlaceholder.Content != null && nav.IsPaneOpen) if (videoPlaceholder.Content != null && nav.IsPaneOpen)
nav.IsPaneOpen = false; nav.IsPaneOpen = false;
else
{
nav.OpenPaneLength = 300;
nav.CompactPaneLength = 40;
}
SetTitleBar(); SetTitleBar();
} }
} }
+8 -18
View File
@@ -27,7 +27,6 @@ namespace FoxTube.Pages.SettingsPages
/// </summary> /// </summary>
public sealed partial class Inbox : Page public sealed partial class Inbox : Page
{ {
List<InboxItem> backup = new List<InboxItem>();
List<InboxItem> items = new List<InboxItem>(); List<InboxItem> items = new List<InboxItem>();
public Inbox() public Inbox()
{ {
@@ -57,43 +56,34 @@ namespace FoxTube.Pages.SettingsPages
)); ));
items.OrderBy(item => item.TimeStamp); items.OrderBy(item => item.TimeStamp);
foreach (InboxItem i in items)
backup.Add(i);
} }
catch { } catch { }
list.ItemsSource = items; items.ForEach(i => list.Items.Add(i));
} }
private void filter_SelectionChanged(object sender, SelectionChangedEventArgs e) private void filter_SelectionChanged(object sender, SelectionChangedEventArgs e)
{ {
try try
{ {
items.Clear(); list.Items.Clear();
list.ItemsSource = null;
switch (filter.SelectedIndex) switch (filter.SelectedIndex)
{ {
case 0: case 0:
foreach (InboxItem i in backup) items.ForEach(i => list.Items.Add(i));
items.Add(i);
break; break;
case 1: case 1:
foreach (InboxItem i in backup) List<InboxItem> messages = items.FindAll(i => i.Type == InboxItemType.Default);
if(i.Type == InboxItemType.Default) messages.ForEach(i => list.Items.Add(i));
items.Add(i);
break; break;
case 2: case 2:
foreach (InboxItem i in backup) List<InboxItem> notes = items.FindAll(i => i.Type == InboxItemType.PatchNote);
if (i.Type == InboxItemType.PatchNote) notes.ForEach(i => list.Items.Add(i));
items.Add(i);
break; break;
} }
list.ItemsSource = items;
} }
catch(NullReferenceException) { } catch(NullReferenceException) { }
} }
@@ -144,7 +134,7 @@ namespace FoxTube.Pages.SettingsPages
string id = arg.Split('&')[1]; string id = arg.Split('&')[1];
InboxItem item = items.Find(x => x.Id == id); InboxItem item = items.Find(x => x.Id == id);
if(item != null) if(item != null)
list.SelectedIndex = items.IndexOf(item); list.SelectedItem = item;
} }
} }
} }