mirror of
https://github.com/jwetzell/qController.git
synced 2026-08-16 12:53:39 +00:00
Begin UI Redesign, switch to icon font
This commit is contained in:
@@ -0,0 +1,50 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Xamarin.Forms;
|
||||
|
||||
namespace qController
|
||||
{
|
||||
public class QCueListView : Frame
|
||||
{
|
||||
ListView listView;
|
||||
public QCueListView()
|
||||
{
|
||||
Padding = new Thickness(5);
|
||||
CornerRadius = 20;
|
||||
BackgroundColor = Color.FromHex("D8D8D8");
|
||||
Grid mainG = new Grid
|
||||
{
|
||||
Padding = new Thickness(0),
|
||||
RowDefinitions =
|
||||
{
|
||||
new RowDefinition{Height = GridLength.Star}
|
||||
},
|
||||
ColumnDefinitions =
|
||||
{
|
||||
new ColumnDefinition{Width = new GridLength(1,GridUnitType.Star)}
|
||||
}
|
||||
};
|
||||
listView = new ListView();
|
||||
mainG.Children.Add(listView, 0, 0);
|
||||
Margin = new Thickness(10);
|
||||
Content = mainG;
|
||||
}
|
||||
|
||||
public void UpdateWithWorkspace(QWorkSpace qWorkspace)
|
||||
{
|
||||
List<string> cueLists = new List<string>();
|
||||
foreach( var cueList in qWorkspace.data )
|
||||
{
|
||||
cueLists.Add(cueList.listName);
|
||||
foreach(var cue in cueList.cues)
|
||||
{
|
||||
if(cue.number == "")
|
||||
cueLists.Add("\t" + cue.listName);
|
||||
else
|
||||
cueLists.Add("\t" + cue.number + " - " + cue.listName);
|
||||
}
|
||||
}
|
||||
listView.ItemsSource = cueLists.ToArray();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -14,16 +14,20 @@ namespace qController
|
||||
Image connectButton = new Image();
|
||||
Image deleteButton = new Image();
|
||||
|
||||
Label connectLabel = new Label();
|
||||
Label deleteLabel = new Label();
|
||||
|
||||
var connectTapGesture = new TapGestureRecognizer();
|
||||
var deleteTapGesture = new TapGestureRecognizer();
|
||||
|
||||
connectTapGesture.Tapped += Connect;
|
||||
connectButton.GestureRecognizers.Add(connectTapGesture);
|
||||
|
||||
connectLabel.GestureRecognizers.Add(connectTapGesture);
|
||||
|
||||
|
||||
deleteTapGesture.Tapped += Delete;
|
||||
deleteButton.GestureRecognizers.Add(deleteTapGesture);
|
||||
deleteLabel.GestureRecognizers.Add(deleteTapGesture);
|
||||
|
||||
InitItems();
|
||||
|
||||
@@ -50,10 +54,10 @@ namespace qController
|
||||
mainG.Children.Add(nameLabel, 1, 0);
|
||||
mainG.Children.Add(addressLabel,1,1);
|
||||
|
||||
mainG.Children.Add(connectButton,2,0);
|
||||
Grid.SetRowSpan(connectButton,2);
|
||||
mainG.Children.Add(deleteButton, 0, 0);
|
||||
Grid.SetRowSpan(deleteButton,2);
|
||||
mainG.Children.Add(connectLabel,2,0);
|
||||
Grid.SetRowSpan(connectLabel,2);
|
||||
mainG.Children.Add(deleteLabel, 0, 0);
|
||||
Grid.SetRowSpan(deleteLabel,2);
|
||||
|
||||
Frame f = new Frame
|
||||
{
|
||||
@@ -87,7 +91,32 @@ namespace qController
|
||||
addressLabel.HorizontalTextAlignment = TextAlignment.Center;
|
||||
addressLabel.VerticalTextAlignment = TextAlignment.Start;
|
||||
|
||||
connectLabel.HorizontalOptions = LayoutOptions.CenterAndExpand;
|
||||
connectLabel.VerticalOptions = LayoutOptions.CenterAndExpand;
|
||||
connectLabel.Text = "\uF1EB";
|
||||
connectLabel.FontSize = 40;
|
||||
connectLabel.TextColor = Color.LimeGreen;
|
||||
|
||||
deleteLabel.HorizontalOptions = LayoutOptions.CenterAndExpand;
|
||||
deleteLabel.VerticalOptions = LayoutOptions.CenterAndExpand;
|
||||
deleteLabel.Text = "\uE802";
|
||||
deleteLabel.FontSize = 40;
|
||||
deleteLabel.TextColor = Color.Red;
|
||||
|
||||
string qfont = "";
|
||||
|
||||
switch (Device.RuntimePlatform)
|
||||
{
|
||||
case Device.iOS:
|
||||
qfont = "qfont";
|
||||
break;
|
||||
case Device.Android:
|
||||
qfont = "qfont.ttf#qfont";
|
||||
break;
|
||||
|
||||
}
|
||||
connectLabel.FontFamily = qfont;
|
||||
deleteLabel.FontFamily = qfont;
|
||||
}
|
||||
|
||||
|
||||
@@ -101,7 +130,7 @@ namespace qController
|
||||
|
||||
void Connect(object sender, EventArgs e)
|
||||
{
|
||||
App.iNav.PushModalAsync(new NavigationPage(new ControlPage(nameLabel.Text,addressLabel.Text)));
|
||||
App.NavigationPage.Navigation.PushModalAsync(new NavigationPage(new ControlPage(nameLabel.Text,addressLabel.Text)));
|
||||
|
||||
Console.WriteLine("Connect To " + nameLabel.Text + " Pressed");
|
||||
|
||||
|
||||
@@ -20,8 +20,8 @@ namespace qController
|
||||
Padding = new Thickness(0),
|
||||
RowDefinitions =
|
||||
{
|
||||
new RowDefinition{Height = GridLength.Auto},
|
||||
new RowDefinition{Height = GridLength.Auto}
|
||||
new RowDefinition{Height = GridLength.Star},
|
||||
new RowDefinition{Height = GridLength.Star}
|
||||
},
|
||||
ColumnDefinitions =
|
||||
{
|
||||
|
||||
@@ -40,9 +40,9 @@ namespace qController
|
||||
{
|
||||
Padding = new Thickness(0),
|
||||
RowDefinitions = {
|
||||
new RowDefinition{Height = GridLength.Auto},
|
||||
new RowDefinition{Height = GridLength.Auto},
|
||||
new RowDefinition{Height = GridLength.Auto}
|
||||
new RowDefinition{Height = GridLength.Star},
|
||||
new RowDefinition{Height = GridLength.Star},
|
||||
new RowDefinition{Height = GridLength.Star}
|
||||
},
|
||||
ColumnDefinitions = {
|
||||
new ColumnDefinition{Width = new GridLength(1,GridUnitType.Star)},
|
||||
|
||||
@@ -25,6 +25,7 @@ namespace qController
|
||||
qClient.qParser.PlaybackPositionUpdated += this.OnPlaybackPositionUpdated;
|
||||
qClient.qParser.CueInfoUpdated += this.OnCueUpdateReceived;
|
||||
qClient.sendArgsUDP("/updates", 1);
|
||||
qClient.sendArgsUDP("/updates", 1);
|
||||
qClient.sendAndReceiveString("/cueLists");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user