Ejemplo n.º 1
0
        void AddButton(Command command)
        {
            Button button = ButtonHelper.CreateButton();

            button.BindManually(command);
            hbox.PackStart(button);
        }
Ejemplo n.º 2
0
        public UpgradeLimitationPanel()
        {
            this.Build();

            eventbox.ModifyBg(StateType.Normal, Helpers.Misc.ToGdkColor(App.Current.Style.ScreenBase));
            header.ModifyFont(FontDescription.FromString($"{App.Current.Style.Font} normal {HEADER_LABEL_SIZE}px"));
            featuresHeader.ModifyFont(FontDescription.FromString($"{App.Current.Style.Font} light {FEATURE_HEADER_LABEL_SIZE}px"));
            featuresCaption.ModifyFont(FontDescription.FromString($"{App.Current.Style.Font} light {FEATURE_LABEL_SIZE}px"));

            upgradeButton2               = ButtonHelper.CreateButton();
            upgradeButton2.Name          = StyleConf.ButtonCallToActionRounded;
            upgradeButton2.WidthRequest  = 240;
            upgradeButton2.HeightRequest = 40;
            upgradeButton2.BorderWidth   = 0;

            undecidedlbl = new Label();
            undecidedlbl.WidthRequest  = 240;
            undecidedlbl.HeightRequest = 11;
            undecidedlbl.Justify       = Justification.Center;
            undecidedlbl.ModifyFont(FontDescription.FromString($"{App.Current.Style.Font} light {UNDECIDED_LABEL_SIZE}px"));
            undecidedlbl.ModifyText(StateType.Normal, Helpers.Misc.ToGdkColor(CommonColor.Parse(UNDECIDED_COLOR)));

            seeOtherPlanslbl = new Label();
            seeOtherPlanslbl.WidthRequest  = 240;
            seeOtherPlanslbl.HeightRequest = 14;
            seeOtherPlanslbl.Justify       = Justification.Center;
            seeOtherPlanslbl.ModifyFont(FontDescription.FromString($"{App.Current.Style.Font} normal {FEATURE_LABEL_SIZE}px"));
            seeOtherPlanslbl.ModifyText(StateType.Normal, Helpers.Misc.ToGdkColor(CommonColor.Parse(UPGRADE_BUTTON_COLOR)));

            captionBackgroundHeader = new ImageView(App.Current.ResourcesLocator.LoadImage(Images.UpgradeDialogBackgroundTop));
            captionFixedHeader.Put(captionBackgroundHeader, 0, 0);

            captionBackgroundBottom = new ImageView(App.Current.ResourcesLocator.LoadImage(Images.UpgradeDialogBackgroundBottom));
            captionFixedBottom.Put(captionBackgroundBottom, 0, 0);
            captionFixedBottom.Put(upgradeButton2, (captionBackgroundBottom.Image.Width / 2) - (upgradeButton2.WidthRequest / 2), 0);
            captionFixedBottom.Put(undecidedlbl, (captionBackgroundBottom.Image.Width / 2) - (undecidedlbl.WidthRequest / 2),
                                   upgradeButton2.HeightRequest + 15);
            captionFixedBottom.Put(seeOtherPlanslbl, (captionBackgroundBottom.Image.Width / 2) - (seeOtherPlanslbl.WidthRequest / 2),
                                   upgradeButton2.HeightRequest + 15 + undecidedlbl.HeightRequest + 5);

            WidthRequest                = captionBackgroundBottom.Image.Width;
            header.WidthRequest         = WidthRequest - (int)headersAlignment.LeftPadding - (int)headersAlignment.RightPadding;
            header.Wrap                 = true;
            header.LineWrap             = true;
            featuresHeader.WidthRequest = WidthRequest - (int)headersAlignment.LeftPadding - (int)headersAlignment.RightPadding;
            featuresHeader.Wrap         = true;
            featuresHeader.LineWrap     = true;
            Bind();
        }