예제 #1
0
        private void BtnThemeAdd_Click(object sender, EventArgs e)
        {
            ShareXTheme theme = new ShareXTheme();

            theme.ApplyDarkColors();
            AddTheme(theme);
        }
예제 #2
0
        private void BtnThemeReset_Click(object sender, EventArgs e)
        {
            Program.Settings.Themes        = ShareXTheme.GetPresets();
            Program.Settings.SelectedTheme = 0;

            cbThemes.Items.Clear();
            cbThemes.Items.AddRange(Program.Settings.Themes.ToArray());
            cbThemes.SelectedIndex = Program.Settings.SelectedTheme;
            pgTheme.SelectedObject = Program.Settings.Themes[Program.Settings.SelectedTheme];
        }
예제 #3
0
        private void btnThemeAdd_Click(object sender, EventArgs e)
        {
            RemoveTemporaryThemePreview();

            ApplySelectedTheme();
            ShareXTheme newTheme = (ShareXTheme)pgTheme.SelectedObject;

            AddThemeFunction(newTheme);

            this.Close();
        }
예제 #4
0
 private void AddTheme(ShareXTheme theme)
 {
     if (theme != null)
     {
         Program.Settings.Themes.Add(theme);
         cbThemes.Items.Add(theme);
         int index = Program.Settings.Themes.Count - 1;
         Program.Settings.SelectedTheme = index;
         cbThemes.SelectedIndex         = index;
         UpdateThemeControls();
     }
 }
예제 #5
0
        private void BtnThemeReset_Click(object sender, EventArgs e)
        {
            if (MessageBox.Show(Resources.WouldYouLikeToResetThemes, "ShareX - " + Resources.Confirmation, MessageBoxButtons.YesNo, MessageBoxIcon.Information) == DialogResult.Yes)
            {
                Program.Settings.Themes        = ShareXTheme.GetDefaultThemes();
                Program.Settings.SelectedTheme = 0;

                cbThemes.Items.Clear();
                cbThemes.Items.AddRange(Program.Settings.Themes.ToArray());
                cbThemes.SelectedIndex = Program.Settings.SelectedTheme;
                pgTheme.SelectedObject = Program.Settings.Themes[Program.Settings.SelectedTheme];
            }
        }
예제 #6
0
        private void BtnThemeReset_Click(object sender, EventArgs e)
        {
            // TODO: Translate
            if (MessageBox.Show("Would you like to reset themes?", "ShareX", MessageBoxButtons.YesNo, MessageBoxIcon.Information) == DialogResult.Yes)
            {
                Program.Settings.Themes        = ShareXTheme.GetPresets();
                Program.Settings.SelectedTheme = 0;

                cbThemes.Items.Clear();
                cbThemes.Items.AddRange(Program.Settings.Themes.ToArray());
                cbThemes.SelectedIndex = Program.Settings.SelectedTheme;
                pgTheme.SelectedObject = Program.Settings.Themes[Program.Settings.SelectedTheme];
            }
        }
예제 #7
0
        internal ThemedForm()
        {
            this.SuspendLayout();

            // ThemedForm
            this.ClientSize      = new Size(300, 300);
            this.FormBorderStyle = FormBorderStyle.None;
            this.Name            = "ThemedForm";
            this.ResumeLayout(false);

            // These seems to be the correct locations for the caption buttons in Windows 10.
            this.MinimizeHitbox = new Rectangle(this.Size.Width - 136, 1, 45, 29);
            this.MaximizeHitbox = new Rectangle(this.Size.Width - 90, 1, 45, 29);
            this.CloseHitbox    = new Rectangle(this.Size.Width - 44, 1, 45, 29);
            this.HelpHitbox     = new Rectangle(this.Size.Width - 90, 1, 45, 29);

            // these are fixed points never changeing.
            this.IconHitbox = new Rectangle(9, 7, 16, 16);

            // the caption in the title bar. We need this to set the bit to make form moveable again.
            this.CaptionHitbox = new Rectangle(0, 0, this.Size.Width, 31);
            this.Paint        += this.ThemedForm_Paint;
            this.Load         += this.ThemedForm_Load;
            this.MouseUp      += this.ThemedForm_MouseUp;
            this.MouseDown    += this.ThemedForm_MouseDown;
            this.MouseMove    += this.ThemedForm_MouseMove;
            this.MouseLeave   += this.ThemedForm_MouseLeave;
            this.Activated    += this.ThemedForm_Activated;
            this.Deactivate   += this.ThemedForm_Deactivate;
            if (ShareXResources.Theme != ShareXTheme.GetPresets()[0])
            {
                ShareXResources.Theme = ShareXTheme.GetPresets()[0];
            }

            // create state bitmaps.
            this.CreateBitmap(ref this.minimizeBitmap, this.MinimizeHitbox, true, false);
            this.CreateBitmap(ref this.minimizeHoverBitmap, this.MinimizeHitbox, true, true);
            this.CreateBitmap(ref this.minimizeDisabledBitmap, this.MinimizeHitbox, false, false);
            this.CreateBitmap(ref this.maximizeBitmap, this.MaximizeHitbox, true, false);
            this.CreateBitmap(ref this.maximizeHoverBitmap, this.MaximizeHitbox, true, true);
            this.CreateBitmap(ref this.maximizeDisabledBitmap, this.MaximizeHitbox, false, false);
            this.CreateBitmap(ref this.closeBitmap, this.CloseHitbox, true, false);
            this.CreateBitmap(ref this.closeHoverBitmap, this.CloseHitbox, true, true);
            this.CreateBitmap(ref this.closeClickedBitmap, this.CloseHitbox, true, false, false, true);
            this.CreateBitmap(ref this.helpBitmap, this.HelpHitbox, true, false, false);
            this.CreateBitmap(ref this.helpHoverBitmap, this.HelpHitbox, true, true, false);
            this.CreateBitmap(ref this.iconBitmap, this.IconHitbox, true, false);
        }
예제 #8
0
        private void BtnThemeAdd_Click(object sender, EventArgs e)
        {
            ShareXTheme theme = ShareXTheme.GetDarkTheme();

            AddTheme(theme);
        }