|
10 | 10 | using Windows.Globalization; |
11 | 11 | using WinUIEx; |
12 | 12 | using WindowApi = WinWrapper.Windowing.Window; |
| 13 | +using static ContextSwitch.Controls; |
13 | 14 | namespace ContextSwitch; |
14 | 15 |
|
15 | 16 | class MainWindow : Window |
@@ -44,24 +45,24 @@ void InitMain() |
44 | 45 | Children = |
45 | 46 | { |
46 | 47 | (titlebar = new()), |
47 | | - (main = new StackPanel |
| 48 | + (main = VStack( |
| 49 | + center: true, |
| 50 | + ContextSwitchLogo(new(0, 0, 0, 50)), |
| 51 | + Text("How long should we do work before switching tasks?"), |
| 52 | + tp = new TimePicker { |
| 53 | + MinuteIncrement = 5, |
| 54 | + ClockIdentifier = ClockIdentifiers.TwentyFourHour, |
| 55 | + SelectedTime = TimeSpan.FromMinutes(25), |
| 56 | + }, |
| 57 | + btn = new Button() { Content = "Start Timer" }, |
| 58 | + HStack(center: true, Text("Tip: Hold"), Key("R-CTRL"), Text("to show timer")) |
| 59 | + ) |
| 60 | + .WithCustomCode(x => |
48 | 61 | { |
49 | | - VerticalAlignment = VerticalAlignment.Center, |
50 | | - HorizontalAlignment = HorizontalAlignment.Center, |
51 | | - Spacing = 16, |
52 | | - Children = { |
53 | | - ContextSwitchLogo(new(0, 0, 0, 50)), |
54 | | - new TextBlock { Text = "How long should we do work before switching tasks?", HorizontalAlignment = HorizontalAlignment.Center }, |
55 | | - (tp = new TimePicker { |
56 | | - MinuteIncrement = 5, |
57 | | - ClockIdentifier = ClockIdentifiers.TwentyFourHour, |
58 | | - SelectedTime = TimeSpan.FromMinutes(25), |
59 | | - HorizontalAlignment = HorizontalAlignment.Center, |
60 | | - }), |
61 | | - (btn = new Button() { Content = "Start Timer" , HorizontalAlignment = HorizontalAlignment.Center }), |
62 | | - new TextBlock { Text = "Tip: Hold R-CTRL to show timer", HorizontalAlignment = HorizontalAlignment.Center } |
63 | | - } |
64 | | - }) |
| 62 | + x.VerticalAlignment = VerticalAlignment.Center; |
| 63 | + x.HorizontalAlignment = HorizontalAlignment.Center; |
| 64 | + x.Spacing = 16; |
| 65 | + })) |
65 | 66 | } |
66 | 67 | }; |
67 | 68 | Grid.SetRow(main, 1); |
|
0 commit comments