Add WelcomeWindow and temp menu in tray to test

This commit is contained in:
DB p 2021-11-30 15:57:44 +09:00
parent d8773b85eb
commit 3785a90c67
3 changed files with 54 additions and 0 deletions

View file

@ -171,6 +171,7 @@ namespace Flow.Launcher
((MenuItem)menu.Items[2]).Header = InternationalizationManager.Instance.GetTranslation("GameMode");
((MenuItem)menu.Items[3]).Header = InternationalizationManager.Instance.GetTranslation("iconTraySettings");
((MenuItem)menu.Items[4]).Header = InternationalizationManager.Instance.GetTranslation("iconTrayExit");
((MenuItem)menu.Items[5]).Header = "Welcome Window"; /*Temp*/
}
private void InitializeNotifyIcon()
@ -204,17 +205,23 @@ namespace Flow.Launcher
{
Header = InternationalizationManager.Instance.GetTranslation("iconTrayExit")
};
var WelcomeWindow = new MenuItem /*Temp*/
{
Header = "Welcome Window"
};
open.Click += (o, e) => _viewModel.ToggleFlowLauncher();
gamemode.Click += (o, e) => ToggleGameMode();
settings.Click += (o, e) => App.API.OpenSettingDialog();
exit.Click += (o, e) => Close();
WelcomeWindow.Click += (o, e) => OpenWelcomeWindow(); /*Temp*/
contextMenu.Items.Add(header);
contextMenu.Items.Add(open);
gamemode.ToolTip = InternationalizationManager.Instance.GetTranslation("GameModeToolTip");
contextMenu.Items.Add(gamemode);
contextMenu.Items.Add(settings);
contextMenu.Items.Add(exit);
contextMenu.Items.Add(WelcomeWindow); /*Temp*/
_notifyIcon.ContextMenuStrip = new ContextMenuStrip(); // it need for close the context menu. if not, context menu can't close.
_notifyIcon.MouseClick += (o, e) =>
@ -232,6 +239,11 @@ namespace Flow.Launcher
};
}
private void OpenWelcomeWindow()
{
Flow.Launcher.WelcomeWindow WelcomeWindow = new Flow.Launcher.WelcomeWindow();
WelcomeWindow.Show();
}
private void ToggleGameMode()
{
if (_viewModel.GameModeStatus)

View file

@ -0,0 +1,15 @@
<Window
x:Class="Flow.Launcher.WelcomeWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:Flow.Launcher"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
Name="FlowWelcomeWindow"
Title="Welcome to Flow Launcher"
Width="550"
Height="650"
WindowStartupLocation="CenterScreen"
mc:Ignorable="d">
<Grid />
</Window>

View file

@ -0,0 +1,27 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
namespace Flow.Launcher
{
/// <summary>
/// WelcomeWindow.xaml에 대한 상호 작용 논리
/// </summary>
public partial class WelcomeWindow : Window
{
public WelcomeWindow()
{
InitializeComponent();
}
}
}