コード例 #1
0
        /// <summary>
        /// Occurs when the reset font button is clicked.
        /// </summary>
        /// <param name="sender">The object where the event handler is attached.</param>
        /// <param name="e">The event data.</param>
        private void ResetFontClicked(object sender, RoutedEventArgs e)
        {
            var defaultTheme = ColorThemeData.CreateDefault();

            this.customTheme.FontFamily = defaultTheme.FontFamily;
            this.customTheme.FontSize   = defaultTheme.FontSize;

            var colorThemesDataSource = App.Current.Resources["colorThemesDataSource"] as ColorThemesDataSource;

            colorThemesDataSource.AddOrUpdate(this.customTheme);

            this.FontFamilyListBox.SelectedItem = this.customTheme.FontFamily;
            this.FontSizeSlider.Value           = this.customTheme.FontSize;

            TerminalPageForceRender(fontChanged: true);
        }
コード例 #2
0
        /// <summary>
        /// Occurs when the reset colors button is clicked.
        /// </summary>
        /// <param name="sender">The object where the event handler is attached.</param>
        /// <param name="e">The event data.</param>
        private void ResetColorsClicked(object sender, RoutedEventArgs e)
        {
            var defaultTheme = ColorThemeData.CreateDefault();

            for (int i = -4; i < 16; i++)
            {
                this.customTheme.ColorTable[(ScreenColor)i] = defaultTheme.ColorTable[(ScreenColor)i];
            }

            var colorThemesDataSource = App.Current.Resources["colorThemesDataSource"] as ColorThemesDataSource;

            colorThemesDataSource.AddOrUpdate(this.customTheme);

            this.ScreenColorListBox_SelectionChanged(sender, null);

            TerminalPageForceRender(fontChanged: false);
        }
コード例 #3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ColorSettingsFlyout"/> class.
        /// </summary>
        public ColorSettingsFlyout()
        {
            this.InitializeComponent();

            this.customTheme = ColorThemesDataSource.GetCustomTheme();
            for (int i = 0; i < this.ScreenColorListBox.Items.Count; i++)
            {
                ListBoxItem item = (ListBoxItem)this.ScreenColorListBox.Items[i];

                int   screenColor = i - 4;
                Color color       = this.customTheme.ColorTable[(ScreenColor)screenColor];
                item.BorderBrush     = new SolidColorBrush(color);
                item.BorderThickness = new Thickness(50.0d, 0.0d, 0.0d, 0.0d);
            }
            this.ScreenColorListBox.SelectedIndex = 0;

            this.FontFamilyListBox.Items.Clear();
            this.FontFamilyListBox.ItemsSource  = ScreenDisplay.BaseLogicalFontMetrics.Keys;
            this.FontFamilyListBox.SelectedItem = this.customTheme.FontFamily;
            this.FontSizeSlider.Value           = this.customTheme.FontSize;
        }
コード例 #4
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ScreenDisplay"/> class.
        /// </summary>
        public ScreenDisplay()
        {
            this.rectangle = new Rectangle();
            this.border    = new Border()
            {
                Child = this.rectangle
            };

            this.border.BorderBrush     = new SolidColorBrush(Colors.Black);
            this.border.BorderThickness = new Thickness(2d);
            this.border.Background      = new SolidColorBrush(Colors.Black);

            this.Content = border;

            this.IsTabStop        = true;
            this.IsTapEnabled     = true;
            this.ManipulationMode = ManipulationModes.TranslateY | ManipulationModes.TranslateInertia;

            this.ColorTheme = ColorThemeData.CreateDefault();
            this.RecalculateFontMetrics();

            this.deviceManager = new DeviceManager();
        }