mirror of
https://github.com/jwetzell/qController.git
synced 2026-08-21 06:59:17 +00:00
* qfont.ttf:
* qfont.ttf: Icons * App.xaml.cs: Set Font String System Wide * RootPage.xaml.cs: * QGrid.cs: * QCueListView.cs: * qConnectionPage.xaml.cs: * IPHelper.cs: * QInstanceCell.cs: Switch to using Icon Font * QSelectedCueCell.cs: Switch to Type Icon instead of just name * QClient.cs: Create and dispose of sender for every sent message * QCue.cs: Add Icon Code method * ControlPage.xaml: Add hamburger menu * ControlPage.xaml.cs: Menu for Workspace listing/ cue selection * MenuPage.xaml.cs: Function to change menu items back for home page
This commit is contained in:
@@ -1,20 +1,21 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
using System.Collections.ObjectModel;
|
||||
using Xamarin.Forms;
|
||||
|
||||
namespace qController
|
||||
{
|
||||
public partial class MenuPage : ContentPage
|
||||
{
|
||||
public ListView ListView { get { return listView; } }
|
||||
ListView listView;
|
||||
|
||||
public ListView listView;
|
||||
public ObservableCollection<MasterPageItem> items;
|
||||
public MenuPage()
|
||||
{
|
||||
Title = "Menu";
|
||||
InitializeComponent();
|
||||
var items = new List<MasterPageItem>();
|
||||
items = new ObservableCollection<MasterPageItem>();
|
||||
|
||||
items.Add(new MasterPageItem
|
||||
{
|
||||
Title = "Scan Network",
|
||||
@@ -42,33 +43,25 @@ namespace qController
|
||||
grid.ColumnDefinitions.Add(new ColumnDefinition { Width = new GridLength(30) });
|
||||
grid.ColumnDefinitions.Add(new ColumnDefinition { Width = GridLength.Star });
|
||||
|
||||
string qfont = "";
|
||||
|
||||
switch (Device.RuntimePlatform)
|
||||
{
|
||||
case Device.iOS:
|
||||
qfont = "qfont";
|
||||
break;
|
||||
case Device.Android:
|
||||
qfont = "qfont.ttf#qfont";
|
||||
break;
|
||||
|
||||
}
|
||||
var icon = new Label();
|
||||
|
||||
icon.FontFamily = qfont as string;
|
||||
icon.FontFamily = App.QFont;
|
||||
icon.SetBinding(Label.TextProperty, "Icon");
|
||||
icon.HorizontalTextAlignment = TextAlignment.Center;
|
||||
icon.VerticalTextAlignment = TextAlignment.Center;
|
||||
icon.FontSize = 20;
|
||||
var label = new Label { VerticalOptions = LayoutOptions.FillAndExpand };
|
||||
label.SetBinding(Label.TextProperty, "Title");
|
||||
|
||||
Console.WriteLine(label.Text);
|
||||
if (label.Text == "Disconnect")
|
||||
{
|
||||
label.TextColor = Color.DarkRed;
|
||||
}
|
||||
grid.Children.Add(icon);
|
||||
grid.Children.Add(label, 1, 0);
|
||||
return new ViewCell { View = grid };
|
||||
}),
|
||||
SeparatorVisibility = SeparatorVisibility.None
|
||||
})
|
||||
};
|
||||
Content = new StackLayout
|
||||
{
|
||||
@@ -76,5 +69,64 @@ namespace qController
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
public void ChangeToWorkspace(QWorkSpace workspace)
|
||||
{
|
||||
items.Clear();
|
||||
items.Add(new MasterPageItem
|
||||
{
|
||||
Title = "Disconnect",
|
||||
Icon = "\uE803",
|
||||
Command = "disconnect"
|
||||
});
|
||||
foreach (var cueList in workspace.data)
|
||||
{
|
||||
items.Add(new MasterPageItem
|
||||
{
|
||||
Title = cueList.listName,
|
||||
Icon = "",
|
||||
Command = ""
|
||||
});
|
||||
foreach (var cue in cueList.cues)
|
||||
{
|
||||
var cueIcon = cue.getIconString();
|
||||
var cueTitle = "";
|
||||
|
||||
if(cue.number != "")
|
||||
{
|
||||
cueTitle = "\t" + cue.number + " - " + cue.listName;
|
||||
}
|
||||
else
|
||||
{
|
||||
cueTitle = "\t" + cue.listName;
|
||||
}
|
||||
|
||||
items.Add(new MasterPageItem
|
||||
{
|
||||
Title = cueTitle,
|
||||
Icon = cueIcon,
|
||||
Command = "/select_id/" + cue.uniqueID
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void ChangeToHome()
|
||||
{
|
||||
items.Clear();
|
||||
items.Add(new MasterPageItem
|
||||
{
|
||||
Title = "Scan Network",
|
||||
Icon = "\uE800",
|
||||
Command = "scan"
|
||||
});
|
||||
items.Add(new MasterPageItem
|
||||
{
|
||||
Title = "Add Manually",
|
||||
Icon = "\uE801",
|
||||
Command = "add"
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user