protected override void OnVisibleChanged(EventArgs e)
 {
     if (!Visible)
     {
         _context.AddTagsToHistory(tagEditor.Tags);
     }
     base.OnVisibleChanged(e);
     LayoutHelper.FitControlsBelow(0, sidebarHeader);
 }
 private void RefreshLayout()
 {
     sidebarHeaderControl1.RefreshLayout();
     LayoutHelper.FitControlsBelow(0, sidebarHeaderControl1);
     DisplayHelper.AutoFitSystemLabel(linkLabelCustomizeMap, linkLabelCustomizeMap.Width,
                                      linkLabelCustomizeMap.Width);
     LayoutHelper.NaturalizeHeightAndDistribute(8, linkLabelCustomizeMap, new ControlGroup(labelCaption, textBoxCaption));
     LayoutHelper.FitControlsBelow(20, textBoxCaption);
     LayoutHelper.NaturalizeHeightAndDistribute(3, labelMargins, comboBoxMargins, panelCustomMargins);
 }
Пример #3
0
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            using (new AutoGrow(this, AnchorStyles.Bottom, true))
            {
                LayoutHelper.NaturalizeHeightAndDistribute(8, labelTitle, labelExplanation);
                LayoutHelper.FitControlsBelow(12, labelExplanation);
            }
        }
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            using (new AutoGrow(groupBoxProxy, AnchorStyles.Bottom, false))
            {
                LayoutHelper.NaturalizeHeight(proxyEnabled);
                LayoutHelper.FitControlsBelow(8, proxyEnabled);
                LayoutHelper.NaturalizeHeight(proxyServerLabel, proxyPortLabel);
                AlignHelper.AlignBottom(proxyServerLabel, proxyPortLabel);
                LayoutHelper.FitControlsBelow(3, proxyServerLabel);
            }
        }
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            LayoutHelper.NaturalizeHeight(lblDescription);
            LayoutHelper.FitControlsBelow(8, lblDescription);
            int origButtonWidth = button1.Width;

            LayoutHelper.EqualizeButtonWidthsVert(AnchorStyles.Right, origButtonWidth, int.MaxValue, button1, button2);
            int deltaX = button1.Width - origButtonWidth;

            listViewPlugins.Width -= deltaX;

            listViewPlugins.ItemChecked += listViewPlugins_ItemChecked;
        }
Пример #6
0
        public void NaturalizeLayout()
        {
            using (new AutoGrow(this, AnchorStyles.Bottom | AnchorStyles.Right, false))
            {
                LayoutHelper.NaturalizeHeight(labelTechTags);
                LayoutHelper.FitControlsBelow(2, labelTechTags);

                LayoutHelper.NaturalizeHeight(labelTag);
                LayoutHelper.FitControlsBelow(2, labelTag);

                labelTechTags.Width = Width;
                labelTag.Width      = Width;
                labelTag.Left       = labelTechTags.Left = 0;
            }
        }
Пример #7
0
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            DisplayHelper.AutoFitSystemButton(buttonTargetOptions);
            // HACK: for some reason this button scales particularly inaccurately
            int extraPadding = (int)DisplayHelper.ScaleX(6);

            buttonTargetOptions.Width += extraPadding;
            buttonTargetOptions.Left  -= extraPadding;

            using (new AutoGrow(this, AnchorStyles.Bottom, false))
            {
                LayoutHelper.FitControlsBelow(3, comboBoxLinkTargets);
            }
        }
Пример #8
0
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            if (!DesignMode)
            {
                using (new AutoGrow(groupBoxUpload, AnchorStyles.Bottom, true))
                {
                    int scaledPadding = (int)DisplayHelper.ScaleY(12);
                    LayoutHelper.NaturalizeHeight(labelDesc);
                    LayoutHelper.FitControlsBelow(scaledPadding, labelDesc);
                    DisplayHelper.AutoFitSystemButton(buttonConfigureFtp, buttonConfigureFtp.Width, int.MaxValue);

                    LayoutHelper.NaturalizeHeightAndDistribute(8, radioButtonWeblog, radioButtonFtp, buttonConfigureFtp);
                }
            }
        }
Пример #9
0
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            using (new AutoGrow(this, AnchorStyles.Bottom | AnchorStyles.Right, true))
            {
                pictureBoxLogo.Left = labelCopyright.Left;
                labelProduct.Left   = pictureBoxLogo.Right + 10;
                labelVersion.Left   = pictureBoxLogo.Right + 10;
                LayoutHelper.NaturalizeHeight(labelProduct);
                labelProduct.Top = pictureBoxLogo.Top + (pictureBoxLogo.Height / 2) - labelProduct.Height;
                LayoutHelper.DistributeVertically(15, false, labelProduct, labelVersion);
                LayoutHelper.NaturalizeHeightAndDistribute(8, labelVersion, labelCopyright);

                LayoutHelper.FitControlsBelow(10, labelCopyright);

                DisplayHelper.AutoFitSystemButton(buttonOK, buttonOK.Width, int.MaxValue);
            }
        }
 private void RefreshLayout()
 {
     sidebarHeader.RefreshLayout();
     LayoutHelper.FitControlsBelow(0, sidebarHeader);
 }
Пример #11
0
        private void RefreshLayout()
        {
            if (_auth == null)
            {
                return;
            }

            SuspendLayout();
            ckBoxSavePassword.Width = Width - ckBoxSavePassword.Left - 10;
            linkLabelCreateMicrosoftAccountID.Width = Width - linkLabelCreateMicrosoftAccountID.Left - 10;
            LayoutHelper.NaturalizeHeight(pictureBoxLogo, lblUsername, txtUsername, lblEmailExample, lblPassword, txtPassword, ckBoxSavePassword, linkLabelCreateMicrosoftAccountID, linkLabelPrivacy, btnLogin);

            if (ShowCreateMicrosoftAccountID)
            {
                LayoutHelper.DistributeVertically(4, false, pictureBoxLogo, lblUsername, txtUsername, lblEmailExample, lblPassword, txtPassword, ckBoxSavePassword, linkLabelCreateMicrosoftAccountID, linkLabelPrivacy, btnLogin);
            }
            else
            {
                LayoutHelper.DistributeVertically(4, false, pictureBoxLogo, lblUsername, txtUsername, lblEmailExample, lblPassword, txtPassword, ckBoxSavePassword, btnLogin);
            }

            ckBoxSavePassword.Visible = _auth.AllowSavePassword;

            lblUsername.Width     =
                lblPassword.Width = lblEmailExample.Width = txtUsername.Width;
            lblUsername.Left      =
                lblPassword.Left  = lblEmailExample.Left = txtUsername.Left;

            if (BidiHelper.IsRightToLeft)
            {
                pictureBoxLogo.Left = txtUsername.Right - pictureBoxLogo.Width;
            }
            else
            {
                pictureBoxLogo.Left = txtUsername.Left;
            }

            Controls.Remove(lblStatus);

            DisplayHelper.AutoFitSystemButton(btnLogin, btnLogin.Width, int.MaxValue);
            LayoutHelper.FitControlsBelow(10, pictureBoxLogo);

            LayoutHelper.NaturalizeHeightAndDistribute(3, lblUsername, txtUsername, lblEmailExample);
            LayoutHelper.FitControlsBelow(10, lblEmailExample);
            if (ShowCreateMicrosoftAccountID)
            {
                LayoutHelper.NaturalizeHeightAndDistribute(3, lblPassword, txtPassword, ckBoxSavePassword);
                LayoutHelper.NaturalizeHeightAndDistribute(15, ckBoxSavePassword, new ControlGroup(linkLabelCreateMicrosoftAccountID, linkLabelPrivacy), btnLogin);
            }
            else
            {
                LayoutHelper.NaturalizeHeightAndDistribute(3, lblPassword, txtPassword, ckBoxSavePassword);
                LayoutHelper.NaturalizeHeightAndDistribute(15, ckBoxSavePassword, btnLogin);
            }

            if (BidiHelper.IsRightToLeft)
            {
                btnLogin.Left          = txtPassword.Left;
                ckBoxSavePassword.Left = txtPassword.Right - ckBoxSavePassword.Width;
                linkLabelCreateMicrosoftAccountID.Left = txtPassword.Right - linkLabelCreateMicrosoftAccountID.Width;
                linkLabelPrivacy.Left = txtPassword.Right - linkLabelPrivacy.Width;
            }
            else
            {
                btnLogin.Left          = txtPassword.Right - btnLogin.Width;
                ckBoxSavePassword.Left = linkLabelCreateMicrosoftAccountID.Left = linkLabelPrivacy.Left = txtPassword.Left;
                linkLabelCreateMicrosoftAccountID.Left -= 2;
                linkLabelPrivacy.Left -= 2;
            }

            Controls.Add(lblStatus);
            ResumeLayout();
        }