private void SaveClick(object sender, RoutedEventArgs e)
        {
            if (!double.IsNaN(overlayCanvas.ActualHeight) && overlayCanvas.ActualHeight > 0)
            {
                ConfigUtil.SetApplicationSetting("OverlayHeight", overlayCanvas.ActualHeight.ToString(CultureInfo.CurrentCulture));
            }

            if (!double.IsNaN(overlayCanvas.ActualWidth) && overlayCanvas.ActualWidth > 0)
            {
                ConfigUtil.SetApplicationSetting("OverlayWidth", overlayCanvas.ActualWidth.ToString(CultureInfo.CurrentCulture));
            }

            var margin = SystemParameters.WindowNonClientFrameThickness;

            if (Top + margin.Top >= SystemParameters.VirtualScreenTop && (Left + margin.Left) >= SystemParameters.VirtualScreenLeft)
            {
                ConfigUtil.SetApplicationSetting("OverlayTop", (Top + margin.Top).ToString(CultureInfo.CurrentCulture));
                ConfigUtil.SetApplicationSetting("OverlayLeft", (Left + margin.Left).ToString(CultureInfo.CurrentCulture));
            }

            if (TitleBlock != null && int.TryParse((fontSizeSelection.SelectedValue as ComboBoxItem).Content as string, out int size))
            {
                ConfigUtil.SetApplicationSetting("OverlayFontSize", size.ToString(CultureInfo.CurrentCulture));
            }

            (Application.Current.MainWindow as MainWindow)?.OpenOverlay(false, true);
        }
Beispiel #2
0
 private void FontSize_Changed(object sender, SelectionChangedEventArgs e)
 {
     if (fontSize.SelectedItem != null)
     {
         chatBox.FontSize = (double)fontSize.SelectedItem;
         ConfigUtil.SetApplicationSetting("ChatFontSize", fontSize.SelectedItem.ToString());
     }
 }
Beispiel #3
0
 private void FontFamily_Changed(object sender, SelectionChangedEventArgs e)
 {
     if (fontFamily.SelectedItem != null)
     {
         var family = fontFamily.SelectedItem as FontFamily;
         chatBox.FontFamily = family;
         ConfigUtil.SetApplicationSetting("ChatFontFamily", family.ToString());
     }
 }
Beispiel #4
0
        private void FontFgColor_Changed(object sender, SelectionChangedEventArgs e)
        {
            if (fontFgColor.SelectedItem != null)
            {
                var item = fontFgColor.SelectedItem as ColorItem;

                chatBox.Foreground = item.Brush;
                ConfigUtil.SetApplicationSetting("ChatFontFgColor", item.Name);
            }
        }
Beispiel #5
0
        private void Player_Changed(object sender, SelectionChangedEventArgs e)
        {
            if (players.SelectedItem is string name && name.Length > 0 && !name.StartsWith("No ", StringComparison.Ordinal))
            {
                LoadChannels(players.SelectedItem as string);
                PlayerAutoCompleteList = ChatManager.GetPlayers(name);
                ConfigUtil.SetApplicationSetting("ChatSelectedPlayer", name);

                if (Ready)
                {
                    ChangeSearch();
                }
            }
        }