Exemplo n.º 1
0
        Widget CreateButton(WelcomeButton b)
        {
            Button button;
            VBox   box;

            Gtk.Image     image;
            Gtk.Alignment alignment;
            Label         label;

            image = new Gtk.Image(
                Helpers.Misc.LoadIcon(b.name, StyleConf.WelcomeIconImageSize, 0));

            button               = new Button();
            button.Clicked      += (sender, e) => (b.func());
            button.HeightRequest = StyleConf.WelcomeIconSize;
            button.WidthRequest  = StyleConf.WelcomeIconSize;
            button.Add(image);

            alignment = new Alignment(0.5f, 0.5f, 0.0f, 0.0f);
            alignment.Add(button);

            label              = new Label(b.text);
            label.LineWrap     = true;
            label.LineWrapMode = Pango.WrapMode.Word;
            label.Justify      = Justification.Center;
            sizegroup.AddWidget(label);

            box = new VBox(false, StyleConf.WelcomeIconsTextSpacing);
            box.PackStart(alignment, false, false, 0);
            box.PackStart(label, false, false, 0);
            box.ShowAll();
            box.Name = b.name + "roundedbutton";
            return(box);
        }
Exemplo n.º 2
0
        Widget CreateButton(WelcomeButton b)
        {
            Button    button;
            VBox      box;
            ImageView image;

            Gtk.Alignment alignment;
            Label         label;

            if (b.Icon == null)
            {
                image = new ImageView(App.Current.ResourcesLocator.LoadIcon(b.Name, Sizes.WelcomeIconImageSize));
            }
            else
            {
                image = new ImageView(b.Icon);
            }
            image.SetSize(Sizes.WelcomeIconImageSize, Sizes.WelcomeIconImageSize);

            button               = new Button();
            button.Clicked      += (sender, e) => b.Func();
            button.HeightRequest = Sizes.WelcomeIconSize;
            button.WidthRequest  = Sizes.WelcomeIconSize;
            button.Add(image);
            if (buttonWidgets.Count == 0)
            {
                button.Realized += (sender, e) => button.GrabFocus();
            }

            alignment = new Alignment(0.5f, 0.5f, 0.0f, 0.0f);
            alignment.Add(button);

            label = new Label(b.Text);
            label.ModifyFont(Pango.FontDescription.FromString("Ubuntu 12"));
            label.LineWrap     = true;
            label.LineWrapMode = Pango.WrapMode.Word;
            label.Justify      = Justification.Center;
            sizegroup.AddWidget(label);

            box = new VBox(false, Sizes.WelcomeIconsTextSpacing);
            box.PackStart(alignment, false, false, 0);
            box.PackStart(label, false, false, 0);

            box.Name = b.Name + "roundedbutton";

            return(box);
        }
Exemplo n.º 3
0
        Widget CreateButton(WelcomeButton b)
        {
            Button button;
            VBox box;
            Gtk.Image image;
            Gtk.Alignment alignment;
            Label label;

            if (b.Icon == null) {
                image = new Gtk.Image (
                    Helpers.Misc.LoadIcon (b.Name, StyleConf.WelcomeIconImageSize, 0));
            } else {
                image = new Gtk.Image (b.Icon.Value);
            }

            button = new Button ();
            button.Clicked += (sender, e) => (b.Func ());
            button.HeightRequest = StyleConf.WelcomeIconSize;
            button.WidthRequest = StyleConf.WelcomeIconSize;
            button.Add (image);
            if (buttonWidgets.Count == 0) {
                button.Realized += (sender, e) => button.GrabFocus ();
            }

            alignment = new Alignment (0.5f, 0.5f, 0.0f, 0.0f);
            alignment.Add (button);

            label = new Label (b.Text);
            label.ModifyFont (Pango.FontDescription.FromString ("Ubuntu 12"));
            label.LineWrap = true;
            label.LineWrapMode = Pango.WrapMode.Word;
            label.Justify = Justification.Center;
            sizegroup.AddWidget (label);

            box = new VBox (false, StyleConf.WelcomeIconsTextSpacing);
            box.PackStart (alignment, false, false, 0);
            box.PackStart (label, false, false, 0);

            box.Name = b.Name + "roundedbutton";

            return box;
        }
Exemplo n.º 4
0
        Widget CreateButton(WelcomeButton b)
        {
            Button button;
            VBox box;
            Gtk.Image image;
            Gtk.Alignment alignment;
            Label label;

            image = new Gtk.Image (
                Helpers.Misc.LoadIcon (b.name, StyleConf.WelcomeIconImageSize, 0));

            button = new Button ();
            button.Clicked += (sender, e) => (b.func ());
            button.HeightRequest = StyleConf.WelcomeIconSize;
            button.WidthRequest = StyleConf.WelcomeIconSize;
            button.Add (image);

            alignment = new Alignment (0.5f, 0.5f, 0.0f, 0.0f);
            alignment.Add (button);

            label = new Label (b.text);
            label.LineWrap = true;
            label.LineWrapMode = Pango.WrapMode.Word;
            label.Justify = Justification.Center;
            sizegroup.AddWidget (label);

            box = new VBox (false, StyleConf.WelcomeIconsTextSpacing);
            box.PackStart (alignment, false, false, 0);
            box.PackStart (label, false, false, 0);
            box.ShowAll ();
            box.Name = b.name + "roundedbutton";
            return box;
        }