Example #1
0
        public LoginDialog(Window parent, string errorMsg)
            : base("Login", parent)
        {
            XML gxml = new XML(null, "MultiMC.GTKGUI.LoginDialog.glade",
                "loginTable", null);
            gxml.Autoconnect(this);

            labelErrorMsg.Text = errorMsg;

            Alignment loginAlign = new Alignment(0.5f, 0.5f, 1, 1);
            loginAlign.Add(loginTable);
            loginAlign.SetPadding(4, 4, 4, 4);
            this.VBox.Add(loginAlign);
            loginAlign.ShowAll();

            okButton = this.AddButton("_OK", ResponseType.Ok) as Button;
            cancelButton = this.AddButton("_Cancel", ResponseType.Cancel) as Button;

            this.Default = okButton;

            this.WidthRequest = 420;

            labelErrorMsg.Visible = !string.IsNullOrEmpty(labelErrorMsg.Text);

            entryPassword.Visibility = false;
        }
		public DocumentOutlinePad ()
		{
			box = new Gtk.Alignment (0, 0, 1, 1);
			box.BorderWidth = 0;
			SetWidget (null);
			box.ShowAll ();
		}
Example #3
0
        protected void Construct (Widget buttonWidget, Menu menu, bool showArrow)
        {
            WidgetFlags |= WidgetFlags.NoWindow;

            button_widget = buttonWidget;
            Menu = menu;

            toggle_button.Parent = this;
            toggle_button.FocusOnClick = false;
            toggle_button.Relief = ReliefStyle.None;
            toggle_button.Pressed += delegate { ShowMenu (); toggle_button.Active = true; };
            toggle_button.Activated += delegate { ShowMenu (); };

            box.Parent = this;

            if (showArrow) {
                box.PackStart (button_widget, true, true, 0);
                alignment = new Alignment (0f, 0.5f, 0f, 0f);
                arrow = new Arrow (ArrowType.Down, ShadowType.None);
                alignment.Add (arrow);
                box.PackStart (alignment, false, false, 5);
                size_widget = box;
                FocusChain = new Widget[] {toggle_button, box};
                alignment.ShowAll ();
                alignment.NoShowAll = true;
            } else {
                toggle_button.Add (button_widget);
                size_widget = toggle_button;
            }

            ShowAll ();
        }
Example #4
0
        public void UpdateTab()
        {
            if (box != null)
            {
                Remove(box);
                box.Destroy();
                slabel = null;
            }

            Gtk.Alignment align = new Gtk.Alignment(0, 0, 0, 0);

            if (orientation == Gtk.Orientation.Horizontal)
            {
                box = new HBox();
                align.LeftPadding   = ItemPadding;
                align.RightPadding  = ItemPadding;
                align.TopPadding    = BarPadding;
                align.BottomPadding = BarPadding;
            }
            else
            {
                box = new VBox();
                align.LeftPadding   = BarPadding;
                align.RightPadding  = BarPadding;
                align.TopPadding    = ItemPadding;
                align.BottomPadding = ItemPadding;
            }
            align.Add(box);

            if (!string.IsNullOrEmpty(icon))
            {
                box.PackStart(new Gtk.Image(icon, IconSize.Menu), false, false, 0);
            }

            if (!string.IsNullOrEmpty(label))
            {
                string txt = label;
//				string txt = "<b>" + label + "</b>";
                if (running)
                {
                    txt = "<span foreground='blue'>" + txt + "</span>";
                }
                slabel = new Gtk.Label(txt);
                UpdateColor();
                slabel.UseMarkup = true;
                if (orientation == Gtk.Orientation.Vertical)
                {
                    slabel.Angle = 270;
                }
                box.PackStart(slabel, true, true, 0);
            }
            box.Spacing = 2;
            align.ShowAll();

            Add(align);
        }
Example #5
0
        public MeeGoHeaderBox ()
        {
            BorderWidth = 5;
            Spacing = 5;
            RedrawOnAllocate = true;
            AppPaintable = true;

            header = new Alignment (0.0f, 0.5f, 1.0f, 1.0f) {
                LeftPadding = 10,
                RightPadding = 10,
                TopPadding = 5,
                BottomPadding = 5
            };
            header_label = new Label () { Xalign = 0.0f };
            header.Add (header_label);
            header.ShowAll ();
            PackStart (header, false, false, 0);
        }
Example #6
0
        private static bool ConfirmUnmap(IUnmapableSource source)
        {
            string key        = "no_confirm_unmap_" + source.GetType().Name.ToLower();
            bool   do_not_ask = ConfigurationClient.Get <bool> ("sources", key, false);

            if (do_not_ask)
            {
                return(true);
            }

            Hyena.Widgets.HigMessageDialog dialog = new Hyena.Widgets.HigMessageDialog(
                ServiceManager.Get <GtkElementsService> ().PrimaryWindow,
                Gtk.DialogFlags.Modal,
                Gtk.MessageType.Question,
                Gtk.ButtonsType.Cancel,
                String.Format(Catalog.GetString("Are you sure you want to delete this {0}?"),
                              source.GenericName.ToLower()),
                source.Name);

            dialog.AddButton(Gtk.Stock.Delete, Gtk.ResponseType.Ok, false);

            Gtk.Alignment alignment = new Gtk.Alignment(0.0f, 0.0f, 0.0f, 0.0f);
            alignment.TopPadding = 10;
            Gtk.CheckButton confirm_button = new Gtk.CheckButton(String.Format(Catalog.GetString(
                                                                                   "Do not ask me this again"), source.GenericName.ToLower()));
            confirm_button.Toggled += delegate {
                do_not_ask = confirm_button.Active;
            };
            alignment.Add(confirm_button);
            alignment.ShowAll();
            dialog.LabelVBox.PackStart(alignment, false, false, 0);

            try {
                if (dialog.Run() == (int)Gtk.ResponseType.Ok)
                {
                    ConfigurationClient.Set <bool> ("sources", key, do_not_ask);
                    return(true);
                }

                return(false);
            } finally {
                dialog.Destroy();
            }
        }
Example #7
0
		public TileTemplate (Beagle.Hit hit, Beagle.Query query) : base (hit, query)
		{
			Alignment alignment = new Alignment (0.0f, 0.5f, 1.0f, 0.0f);
			HBox.PackStart (alignment, true, true, 0);

			VBox vbox = new VBox (false, 0);
			alignment.Add (vbox);

			title_label = WidgetFu.NewLabel ();
			title_label.LineWrap = true;
			WidgetFu.EllipsizeLabel (title_label, 30);
			vbox.PackStart (title_label, false, false, 0);

			desc_label = WidgetFu.NewGrayLabel ();
			desc_label.NoShowAll = true;
			WidgetFu.EllipsizeLabel (desc_label, 30);
			vbox.PackStart (desc_label, false, false, 0);

			alignment.ShowAll ();
		}
Example #8
0
        public StatusArea()
        {
            theme = new StatusAreaTheme ();
            renderArg = new RenderArg ();

            mainContext = new MainStatusBarContextImpl (this);
            activeContext = mainContext;
            contexts.Add (mainContext);

            VisibleWindow = false;
            NoShowAll = true;
            WidgetFlags |= Gtk.WidgetFlags.AppPaintable;

            statusIconBox.BorderWidth = 0;
            statusIconBox.Spacing = 3;

            Action<bool> animateProgressBar =
                showing => this.Animate ("ProgressBarFade",
                                         val => renderArg.ProgressBarAlpha = val,
                                         renderArg.ProgressBarAlpha,
                                         showing ? 1.0f : 0.0f,
                                         easing: Easing.CubicInOut);

            ProgressBegin += delegate {
                renderArg.ShowProgressBar = true;
            //				StartBuildAnimation ();
                renderArg.ProgressBarFraction = 0;
                QueueDraw ();
                animateProgressBar (true);
            };

            ProgressEnd += delegate {
                renderArg.ShowProgressBar = false;
            //				StopBuildAnimation ();
                QueueDraw ();
                animateProgressBar (false);
            };

            ProgressFraction += delegate(object sender, FractionEventArgs e) {
                renderArg.ProgressBarFraction = (float)e.Work;
                QueueDraw ();
            };

            contentBox.PackStart (messageBox, true, true, 0);
            contentBox.PackEnd (statusIconBox, false, false, 0);
            contentBox.PackEnd (statusIconSeparator = new StatusAreaSeparator (), false, false, 0);
            contentBox.PackEnd (buildResultWidget = CreateBuildResultsWidget (Orientation.Horizontal), false, false, 0);

            HasTooltip = true;
            QueryTooltip += messageBoxToolTip;

            mainAlign = new Alignment (0, 0.5f, 1, 0);
            mainAlign.LeftPadding = 12;
            mainAlign.RightPadding = 8;
            mainAlign.Add (contentBox);
            Add (mainAlign);

            mainAlign.ShowAll ();
            statusIconBox.Hide ();
            statusIconSeparator.Hide ();
            buildResultWidget.Hide ();
            Show ();

            this.ButtonPressEvent += delegate {
                if (sourcePad != null)
                    sourcePad.BringToFront (true);
            };

            statusIconBox.Shown += delegate {
                UpdateSeparators ();
            };

            statusIconBox.Hidden += delegate {
                UpdateSeparators ();
            };

            messageQueue = new Queue<Message> ();

            tracker = new MouseTracker(this);
            tracker.MouseMoved += (sender, e) => QueueDraw ();
            tracker.HoveredChanged += (sender, e) => {
                this.Animate ("Hovered",
                              x => renderArg.HoverProgress = x,
                              renderArg.HoverProgress,
                              tracker.Hovered ? 1.0f : 0.0f,
                              easing: Easing.SinInOut);
            };

            IdeApp.FocusIn += delegate {
                // If there was an error while the application didn't have the focus,
                // trigger the error animation again when it gains the focus
                if (errorAnimPending) {
                    errorAnimPending = false;
                    TriggerErrorAnimation ();
                }
            };
        }
Example #9
0
        public void UpdateTab()
        {
            if (Child != null) {
                Widget w = Child;
                Remove (w);
                w.Destroy ();
            }

            mainBox = new Alignment (0,0,1,1);
            if (bar.Orientation == Gtk.Orientation.Horizontal) {
                box = new HBox ();
                mainBox.LeftPadding = mainBox.RightPadding = 2;
            }
            else {
                box = new VBox ();
                mainBox.TopPadding = mainBox.BottomPadding = 2;
            }

            Gtk.Widget customLabel = null;
            if (it.DockLabelProvider != null)
                customLabel = it.DockLabelProvider.CreateLabel (bar.Orientation);

            if (customLabel != null) {
                customLabel.ShowAll ();
                box.PackStart (customLabel, true, true, 0);
            }
            else {
                if (it.Icon != null)
                    box.PackStart (new Gtk.Image (it.Icon), false, false, 0);

                if (!string.IsNullOrEmpty (it.Label)) {
                    label = new Gtk.Label (it.Label);
                    label.UseMarkup = true;
                    if (bar.Orientation == Gtk.Orientation.Vertical)
                        label.Angle = 270;
                    box.PackStart (label, true, true, 0);
                } else
                    label = null;
            }

            box.BorderWidth = 2;
            box.Spacing = 2;
            mainBox.Add (box);
            mainBox.ShowAll ();
            Add (mainBox);
            SetNormalColor ();
        }
Example #10
0
        void BuildLayout ()
        {
            var primary_vbox = new VBox () {
                Spacing = 6
            };

            // Source selector
            var combo_align = new Alignment (0, .5f, 0, 0);
            var combo_hbox = new HBox (false, 6);
            combo_hbox.Add (new Label (Catalog.GetString ("Import from:")));
            sources_combo = new ComboBox (sources_model);
            var render = new CellRendererText ();
            sources_combo.PackStart (render, true);
            sources_combo.SetAttributes (render, "text", 1);
            combo_hbox.Add (sources_combo);
            combo_align.Add (combo_hbox);
            combo_align.ShowAll ();
            primary_vbox.Add (combo_align);

            // Button row near the top
            var align = new Alignment (1, .5f, 0, 0);
            var button_box = new HButtonBox () {
                Spacing = 6
            };
            button_box.Add (cancel_button = new Button (Stock.Cancel));
            button_box.Add (import_button = new Button (Stock.Add));
            align.Add (button_box);
            align.ShowAll ();

            primary_vbox.Add (align);
            primary_vbox.Show ();

            Add (primary_vbox);
        }
		private void BuildWidget ()
		{
			alignment = new Alignment (0.5f, 0.5f, 1f, 0f);
			alignment.SetPadding (1, 1, 3, 3);
			VisibleWindow = false;

			box = new HBox ();
			entry = new FramelessEntry (this);
			filter_button = new HoverImageButton (IconSize.Menu, "md-searchbox-search");
			clear_button = new HoverImageButton (IconSize.Menu, "md-searchbox-clear");

			entryAlignment = new Gtk.Alignment (0.5f, 0.5f, 1f, 1f);
			alignment.SetPadding (0, 0, 3, 3);
			entryAlignment.Add (entry);
			box.PackStart (filter_button, false, false, 0);
			box.PackStart (entryAlignment, true, true, 0);
			box.PackStart (clear_button, false, false, 0);
			alignment.Add (box);
			Add (alignment);
			alignment.ShowAll ();
			
			entry.StyleSet += OnInnerEntryStyleSet;
			entry.StateChanged += OnInnerEntryStateChanged;
			entry.FocusInEvent += OnInnerEntryFocusEvent;
			entry.FocusOutEvent += OnInnerEntryFocusEvent;
			entry.Changed += OnInnerEntryChanged;
			entry.Activated += delegate {
				NotifyActivated ();
			};

			filter_button.Image.Xpad = 0;
			clear_button.Image.Xpad = 0;
			filter_button.CanFocus = false;
			clear_button.CanFocus = false;
			
			filter_button.ButtonReleaseEvent += OnButtonReleaseEvent;
			clear_button.ButtonReleaseEvent += OnButtonReleaseEvent;
			clear_button.Clicked += OnClearButtonClicked;

			ShowHideButtons ();
		}
        private bool need_authorization_checked = true; // state for at which button the auth arrows should point

        private void OnPreferencesServiceInstallWidgetAdapters (object sender, EventArgs args)
        {
            if (reporting_preference != null && scrobbler != null) {
                reporting_preference.Value = scrobbler.Enabled;
            }

            if (account_section == null) {
                return;
            }

            var align = new Alignment (0.0f, 0.0f, 1.0f, 1.0f) {
                LeftPadding = 20,
                RightPadding = 20
            };

            sign_in_box = new Table (0, 0, false) {
                ColumnSpacing = 6,
                RowSpacing = 2
            };

            align.Add (sign_in_box);
            align.Show ();

            username_preference.DisplayWidget = align;

            align = new Alignment (0.5f, 0.5f, 1.0f, 1.0f) {
                LeftPadding = 20,
                RightPadding = 20,
                TopPadding = 5
            };

            var button_box = new HBox () {
                Spacing = 6
            };

            button_box.PackStart (new Badge (source.Account), false, false, 0);

            signup_button = new Gtk.LinkButton (source.Account.SignUpUrl, Catalog.GetString ("Sign up for Last.fm"));
            signup_button.Xalign = 0f;
            button_box.PackStart (signup_button, false, false, 0);

            profile_page_button = new Gtk.LinkButton (String.Empty, Catalog.GetString ("Visit Your Last.fm Profile Page"));
            profile_page_button.Clicked += (o, e) => source.Account.VisitUserProfile (source.Account.UserName);
            profile_page_button.Xalign = 0f;
            button_box.PackStart (profile_page_button, false, false, 0);

            align.Add (button_box);
            align.ShowAll ();

            account_section["lastfm-signup"].DisplayWidget = align;

            GetSignInState ();
            BuildSignIn ();
        }
Example #13
0
        private Gtk.HBox create_element(Item item, string search_text, string snippet_text, VoidFunction update)
        {
            Gtk.HBox element = new Gtk.HBox();
            Gtk.VBox lines = new Gtk.VBox();
            Gtk.HBox title_date = new Gtk.HBox();

            Gtk.EventBox title_wrapper = new Gtk.EventBox();
            Gtk.Label title = new Gtk.Label();

            string str_title = item.name(40);

            string capitalized = search_text.Substring(0, 1).ToUpper() + search_text.Substring(1);

            if (str_title.Contains(search_text)) {
                int index = str_title.IndexOf(search_text);
                str_title = str_title.Substring(0, index) + "<b>" + search_text + "</b>" + str_title.Substring(index+search_text.Length);
            } else if (str_title.Contains(capitalized)) {
                int index = str_title.IndexOf(capitalized);
                str_title = str_title.Substring(0, index) + "<b>" + capitalized + "</b>" + str_title.Substring(index+capitalized.Length);
            }

            title.Markup = "<big>" + str_title + "</big>";
            title.UseUnderline = false;
            title.SetAlignment(0, 0); // left aligned
            title_wrapper.ButtonPressEvent += delegate(object sender, Gtk.ButtonPressEventArgs args) {
                if (args.Event.Button == 1)
                    item.open();
            };
            title_wrapper.Add(title);
            GtkCommon.set_background_color(title_wrapper, "white");

            GtkCommon.show_hand_and_tooltip(title_wrapper, String.Format(Mono.Unix.Catalog.GetString("Open: {0}"), item.long_name));

            GtkCommon.create_preview(item, lines, title_wrapper);

            title_date.PackStart(title_wrapper, true, true, 0);

            Gtk.Alignment date_alignment = new Gtk.Alignment(1, 0, 0, 0);
            Gtk.Label date = new Gtk.Label();
            date.Markup = "<big>" + String.Format("{0:dd/MM/yy}", item.last_modify) + "</big>";
            date_alignment.Add(date);
            date_alignment.LeftPadding = 10;
            title_date.PackStart(date_alignment, true, true, 0);

            lines.PackStart(title_date, true, true, 0);

            try {
                DocumentItem doc_item = item as DocumentItem;

                if (doc_item != null) {
                    doc_item.on_snippet_callback = delegate (string snippet) {
                        if (!String.IsNullOrEmpty(snippet)) {

                            System.Console.WriteLine("got snippet: {0}", snippet);

                            Gtk.Label snippet_label = new Gtk.Label();
                            snippet_label.SetAlignment(0, 0); // left aligned
                            snippet_label.Markup = snippet;
                            lines.PackStart(snippet_label, true, true, 2);
                            lines.ReorderChild(snippet_label, 1);

                            update();
                        }
                    };
                    if (!String.IsNullOrEmpty(doc_item.snippet))
                        doc_item.on_snippet_callback(doc_item.snippet);
                }
            } catch (Exception) { // not document item
            }

            Gtk.HBox label_links = new Gtk.HBox();

            Gtk.HBox bubbles = new Gtk.HBox();

            foreach (UserLabel label in item.labels)
                bubbles.Add(label.dot());

            label_links.PackStart(bubbles, false, false, 0);

            item.on_labels_callback = delegate() {
                foreach (Widget w in bubbles)
                    w.Destroy();

                foreach (UserLabel label in item.labels)
                    bubbles.Add(label.dot());

                element.ShowAll();
            };

            Gtk.Alignment links_alignment = new Gtk.Alignment(1,1,0,0);
            Gtk.HBox links = new Gtk.HBox();

            add_link(Mono.Unix.Catalog.GetString("Go to week"), CalendarDriver.View.Week, item.last_modify, links);
            add_link(Mono.Unix.Catalog.GetString("Go to month"), CalendarDriver.View.Month, item.last_modify, links);
            add_link(Mono.Unix.Catalog.GetString("Go to year"), CalendarDriver.View.Year, item.last_modify, links);

            links_alignment.Add(links);

            label_links.PackStart(links_alignment, true, true, 0);

            lines.PackStart(label_links, true, true, 2);

            string image = String.Empty;

            if (item.file != null)
                image = Singleton<Types>.Instance.get_type((int)item.file.type.category).icon;

            Gtk.Alignment img_alignment = new Gtk.Alignment(0, (float)0.05, 0,0);

            if (!String.IsNullOrEmpty(image))
            {
                Gtk.Image img;

                if (item.file.starred)
                    img = CairoDrawing.create_small_starred_image(image);
                else
                    img = new Gtk.Image(null, image);

                item.register_small_starred_change(delegate(bool starred) {
                    foreach (Widget w in img_alignment)
                        w.Destroy();
                    if (starred)
                        img = CairoDrawing.create_small_starred_image(image);
                    else
                        img = new Gtk.Image(null, image);
                    img_alignment.Add(img);
                    img_alignment.ShowAll();
                });

                img_alignment.Add(img);
                img_alignment.ShowAll();
            }

            element.PackStart(img_alignment, false, false, 5);

            element.PackStart(lines, true, true, 0);

            return element;
        }
Example #14
0
        public override void Clicked()
        {
            Window w = new Window("Maple Appearance Locations");

            var minimapContainer = new Alignment(1.0f,1.0f,1.0f,1.0f);

            ComboBox comboBox = new ComboBox(
                    new string[] {
                    "Present (Ricky)",
                    "Present (Dimitri)",
                    "Present (Moosh)",
                    "Past"
                    });

            comboBox.Changed += (a,b) => {
                int i = comboBox.Active;
                Data data;
                Map map;

                if (i == 3) {
                    data = Project.GetData("maplePastLocations");
                    map = Project.GetIndexedDataType<WorldMap>(1);
                }
                else {
                    data = Project.GetData(Project.GetData("maplePresentLocationsTable", i*2).GetValue(0));
                    map = Project.GetIndexedDataType<WorldMap>(0);
                }

                var minimap = new MyMinimap(data);
                minimap.Width = map.MapWidth;
                minimap.Height = map.MapHeight;

                minimap.SetMap(map);
                minimap.Selectable = false;

                minimapContainer.Remove(minimapContainer.Child);
                minimapContainer.Add(minimap);
                minimapContainer.ShowAll();
            };
            if (manager.GetActiveMap().Group == 1)
                comboBox.Active = 3;
            else
                comboBox.Active = 0;

            VBox vbox = new VBox();
            vbox.Add(comboBox);
            vbox.Add(minimapContainer);

            w.Add(vbox);
            w.ShowAll();
        }
Example #15
0
        private void BuildViews()
        {
            VBox source_box = new VBox ();
            source_box.PackStart (new UserJobTileHost (), false, false, 0);

            view_container = new ViewContainer ();
            composite_view = new LtrTrackSourceContents ();
            composite_view.TrackView.HeaderVisible = false;
            view_container.Content = composite_view;
            view_container.Show ();

            view_box = new Alignment (0.0f, 0.0f, 1.0f, 1.0f);
            view_box.Add (view_container);
            view_box.ShowAll ();

            primary_vbox.PackStart (view_box, true, true, 0);
        }
Example #16
0
        private void BuildPrimaryLayout()
        {
            primary_vbox = new VBox ();

            BuildHeader ();
            BuildViews ();
            BuildFooter ();

            search_entry_align = new Alignment (1.0f, 0.5f, 0f, 0f);
            var box = new HBox () { Spacing = 2 };
            var grabber = new GrabHandle ();
            var search_entry = view_container.SearchEntry;
            grabber.ControlWidthOf (search_entry, 150, 350, false);

            int search_entry_width = SearchEntryWidth.Get ();

            // -1 indicates that height should be preserved
            search_entry.SetSizeRequest (search_entry_width, -1);

            search_entry.SizeAllocated += (o, a) => {
                SearchEntryWidth.Set (search_entry.Allocation.Width);
            };

            box.PackStart (grabber, false, false, 0);
            box.PackStart (view_container.SearchEntry, false, false, 0);
            search_entry_align.Child = box;

            ActionService.PopulateToolbarPlaceholder (header_toolbar, "/HeaderToolbar/SearchEntry", search_entry_align);
            search_entry_align.Visible = view_container.SearchSensitive = true;
            search_entry_align.ShowAll ();

            primary_vbox.Show ();
            Add (primary_vbox);
        }
Example #17
0
        private void BuildHeader()
        {
            Alignment toolbar_alignment = new Alignment (0.0f, 0.0f, 1.0f, 1.0f);
            toolbar_alignment.TopPadding = 3;
            toolbar_alignment.BottomPadding = 3;

            header_toolbar = (Toolbar)ActionService.UIManager.GetWidget ("/MuinsheeHeaderToolbar");
            header_toolbar.ShowArrow = false;
            header_toolbar.ToolbarStyle = ToolbarStyle.BothHoriz;

            toolbar_alignment.Add (header_toolbar);
            toolbar_alignment.ShowAll ();

            main_vbox.PackStart (toolbar_alignment, false, false, 0);

            Widget next_button = new NextButton (ActionService);
            next_button.Show ();
            ActionService.PopulateToolbarPlaceholder (header_toolbar, "/MuinsheeHeaderToolbar/NextArrowButton", next_button);

            ConnectedVolumeButton volume_button = new ConnectedVolumeButton ();
            volume_button.Show ();
            ActionService.PopulateToolbarPlaceholder (header_toolbar, "/MuinsheeHeaderToolbar/VolumeButton", volume_button);
        }
        private void BuildHeader ()
        {
            header_align = new Alignment (0.0f, 0.5f, 1.0f, 1.0f);
            if (Hyena.PlatformDetection.IsMeeGo) {
                header_align.RightPadding = 5;
                header_align.TopPadding = 5;
            }

            header = new HBox ();
            footer = new VBox ();

            default_title_box = new EventBox ();
            title_label = new Label ();
            title_label.Xalign = 0.0f;
            title_label.Ellipsize = Pango.EllipsizeMode.End;

            default_title_box.Add (title_label);

            // Show the source context menu when the title is right clicked
            default_title_box.PopupMenu += delegate {
                ServiceManager.Get<InterfaceActionService> ().SourceActions ["SourceContextMenuAction"].Activate ();
            };

            default_title_box.ButtonPressEvent += delegate (object o, ButtonPressEventArgs press) {
                if (press.Event.Button == 3) {
                    ServiceManager.Get<InterfaceActionService> ().SourceActions ["SourceContextMenuAction"].Activate ();
                }
            };

            header_box = new EventBox ();

            custom_title_box = new HBox () { Visible = false };

            BuildSearchEntry ();

            header.PackStart (default_title_box, true, true, 0);
            header.PackStart (custom_title_box, true, true, 0);
            header.PackStart (header_box, false, false, 0);
            header.PackStart (search_entry, false, false, 0);

            InterfaceActionService uia = ServiceManager.Get<InterfaceActionService> ();
            if (uia != null) {
                Gtk.Action action = uia.GlobalActions["WikiSearchHelpAction"];
                if (action != null) {
                    MenuItem item = new SeparatorMenuItem ();
                    item.Show ();
                    search_entry.Menu.Append (item);

                    item = new ImageMenuItem (Stock.Help, null);
                    item.Activated += delegate { action.Activate (); };
                    item.Show ();
                    search_entry.Menu.Append (item);
                }
            }

            header_align.Add (header);
            header_align.ShowAll ();
            search_entry.Show ();

            PackStart (header_align, false, false, 0);
            PackEnd (footer, false, false, 0);

            context_pane = new Banshee.ContextPane.ContextPane ();
            context_pane.ExpandHandler = b => {
                SetChildPacking (content.Widget, !b, true, 0, PackType.Start);
                SetChildPacking (context_pane, b, b, 0, PackType.End);
            };
            PackEnd (context_pane, false, false, 0);

            PackEnd (new ConnectedMessageBar (), false, true, 0);
        }
Example #19
0
		public void UpdateTab ()
		{
			if (Child != null) {
				Widget w = Child;
				Remove (w);
				w.Destroy ();
			}
			
			mainBox = new Alignment (0,0,1,1);
			if (bar.Orientation == Gtk.Orientation.Horizontal) {
				box = new HBox ();
				if (bar.AlignToEnd)
					mainBox.SetPadding (3, 3, 11, 9);
				else
					mainBox.SetPadding (3, 3, 9, 11);
			}
			else {
				box = new VBox ();
				if (bar.AlignToEnd)
					mainBox.SetPadding (11, 9, 3, 3);
				else
					mainBox.SetPadding (9, 11, 3, 3);
			}
			
			Gtk.Widget customLabel = null;
			if (it.DockLabelProvider != null)
				customLabel = it.DockLabelProvider.CreateLabel (bar.Orientation);
			
			if (customLabel != null) {
				customLabel.ShowAll ();
				box.PackStart (customLabel, true, true, 0);
			}
			else {
				if (it.Icon != null) {
					var desat = it.Icon.WithAlpha (0.5);
					crossfade = new CrossfadeIcon (desat, it.Icon);
					box.PackStart (crossfade, false, false, 0);
					desat.Dispose ();
				}
					
				if (!string.IsNullOrEmpty (it.Label)) {
					label = new Gtk.Label (it.Label);
					label.UseMarkup = true;
					if (bar.Orientation == Gtk.Orientation.Vertical)
						label.Angle = 270;
					box.PackStart (label, true, true, 0);
				} else
					label = null;
			}

			box.Spacing = 2;
			mainBox.Add (box);
			mainBox.ShowAll ();
			Add (mainBox);
			QueueDraw ();
		}
Example #20
0
		public void UpdateTab ()
		{
			if (box != null) {
				Remove (box);
				box.Destroy ();
				slabel = null;
			}
			
			Gtk.Alignment align = new Gtk.Alignment (0,0,0,0);
			
			if (orientation == Gtk.Orientation.Horizontal) {
				box = new HBox ();
				align.LeftPadding = ItemPadding;
				align.RightPadding = ItemPadding;
				align.TopPadding = BarPadding;
				align.BottomPadding = BarPadding;
			}
			else {
				box = new VBox ();
				align.LeftPadding = BarPadding;
				align.RightPadding = BarPadding;
				align.TopPadding = ItemPadding;
				align.BottomPadding = ItemPadding;
			}
			align.Add (box);
			
			if (!string.IsNullOrEmpty (icon))
				box.PackStart (new Gtk.Image (icon, IconSize.Menu), false, false, 0);
				
			if (!string.IsNullOrEmpty (label)) {
				string txt = label;
//				string txt = "<b>" + label + "</b>";
				if (running)
					txt = "<span foreground='blue'>" + txt + "</span>";
				slabel = new Gtk.Label (txt);
				UpdateColor ();
				slabel.UseMarkup = true;
				if (orientation == Gtk.Orientation.Vertical)
					slabel.Angle = 270;
				box.PackStart (slabel, true, true, 0);
			}
			box.Spacing = 2;
			align.ShowAll ();
			
			Add (align);
		}
Example #21
0
        private static bool ConfirmUnmap (IUnmapableSource source)
        {
            string key = "no_confirm_unmap_" + source.GetType ().Name.ToLower ();
            bool do_not_ask = ConfigurationClient.Get<bool> ("sources", key, false);

            if (do_not_ask) {
                return true;
            }

            Hyena.Widgets.HigMessageDialog dialog = new Hyena.Widgets.HigMessageDialog (
                ServiceManager.Get<GtkElementsService> ().PrimaryWindow,
                Gtk.DialogFlags.Modal,
                Gtk.MessageType.Question,
                Gtk.ButtonsType.Cancel,
                String.Format (Catalog.GetString ("Are you sure you want to delete this {0}?"),
                    source.GenericName.ToLower ()),
                source.Name);

            dialog.AddButton (Gtk.Stock.Delete, Gtk.ResponseType.Ok, false);

            Gtk.Alignment alignment = new Gtk.Alignment (0.0f, 0.0f, 0.0f, 0.0f);
            alignment.TopPadding = 10;
            Gtk.CheckButton confirm_button = new Gtk.CheckButton (String.Format (Catalog.GetString (
                "Do not ask me this again"), source.GenericName.ToLower ()));
            confirm_button.Toggled += delegate {
                do_not_ask = confirm_button.Active;
            };
            alignment.Add (confirm_button);
            alignment.ShowAll ();
            dialog.LabelVBox.PackStart (alignment, false, false, 0);

            try {
                if (dialog.Run () == (int)Gtk.ResponseType.Ok) {
                    ConfigurationClient.Set<bool> ("sources", key, do_not_ask);
                    return true;
                }

                return false;
            } finally {
                dialog.Destroy ();
            }
        }
		public MonoGameContentEditorViewContent (MonoDevelop.Core.FilePath filename, MonoDevelop.Projects.Project project)
		{
			this.ContentName = Path.GetFileName (filename.ToString());
			this.Project = project;
			control = new Alignment (0, 0, 1, 1);
			control.SetPadding (5, 5, 5, 5);

			view = new Pipeline.MacOS.MainView (null);

			if (filename != null) {
				view.OpenProjectPath = filename.ToString();
			}
			Pipeline.MacOS.MainView.CreateControllers (view);
			view.BuildUI ();

			control.Add (view);

			control.ShowAll ();
		}
Example #23
0
		public void UpdateTab ()
		{
			if (Child != null) {
				Widget w = Child;
				Remove (w);
				w.Destroy ();
			}
			
			mainBox = new Alignment (0,0,1,1);
			if (bar.Orientation == Gtk.Orientation.Horizontal) {
				box = new HBox ();
				if (bar.AlignToEnd)
					mainBox.SetPadding (5, 5, 11, 9);
				else
					mainBox.SetPadding (5, 5, 9, 11);
			}
			else {
				box = new VBox ();
				if (bar.AlignToEnd)
					mainBox.SetPadding (11, 9, 5, 5);
				else
					mainBox.SetPadding (9, 11, 5, 5);
			}
			
			if (it.Icon != null) {
				var desat = it.Icon.WithAlpha (0.5);
				crossfade = new CrossfadeIcon (desat, it.Icon);
				box.PackStart (crossfade, false, false, 0);
				desat.Dispose ();
			}
				
			if (!string.IsNullOrEmpty (it.Label)) {
				label = new Label (it.Label);
				label.UseMarkup = true;
				label.ModifyFont (FontService.SansFont.CopyModified (Styles.FontScale11));

				if (bar.Orientation == Orientation.Vertical)
					label.Angle = 270;

				// fine-tune label alignment issues
				if (Platform.IsMac) {
					if (bar.Orientation == Orientation.Horizontal)
						label.SetAlignment (0, 0.5f);
					else
						label.SetAlignment (0.6f, 0);
				} else {
					if (bar.Orientation == Orientation.Vertical)
						label.SetAlignment (1, 0);
				}
				// TODO: VV: Test Linux

				box.PackStart (label, true, true, 0);
			} else
				label = null;

			box.Spacing = 2;
			mainBox.Add (box);
			mainBox.ShowAll ();
			Add (mainBox);
			UpdateStyle (this, null); 
			QueueDraw ();
		}
        void ShowConnectingDialog(RemoteDebuggerStartInfo dsi)
        {
            string message = GetConnectingMessage (dsi);

            Gtk.Application.Invoke (delegate {
                if (VirtualMachine != null || Exited)
                    return;

                dialog = new Gtk.Dialog () {
                    Title = "Waiting for debugger"
                };

                var label = new Gtk.Alignment (0.5f, 0.5f, 1f, 1f) {
                    Child = new Gtk.Label (message),
                    BorderWidth = 12
                };
                dialog.VBox.PackStart (label);
                label.ShowAll ();

                dialog.AddButton ("Cancel", Gtk.ResponseType.Cancel);

                int response = MonoDevelop.Ide.MessageService.ShowCustomDialog (dialog);

                dialog = null;

                if (response != (int) Gtk.ResponseType.Ok) {
                    EndSession ();
                }
            });
        }
Example #25
0
        private void BuildPrimaryLayout ()
        {
            primary_vbox = new VBox ();

            BuildHeader ();
            BuildViews ();
            BuildFooter ();

            search_entry_align = new Alignment (1.0f, 0.5f, 0f, 0f);
            var box = new HBox () { Spacing = 2 };
            var grabber = new GrabHandle ();
            grabber.ControlWidthOf (view_container.SearchEntry, 150, 350, false);
            box.PackStart (grabber, false, false, 0);
            box.PackStart (view_container.SearchEntry, false, false, 0);
            search_entry_align.Child = box;

            ActionService.PopulateToolbarPlaceholder (header_toolbar, "/HeaderToolbar/SearchEntry", search_entry_align);
            search_entry_align.Visible = view_container.SearchSensitive = true;
            search_entry_align.ShowAll ();

            primary_vbox.Show ();
            Add (primary_vbox);
        }
Example #26
0
        public UserBrowserPage()
        {
            // Create the files tree
            filesList = new TreeView();
            filesList.RowActivated += on_filesList_row_activated;
            filesList.ButtonPressEvent += filesList_ButtonPressEvent;

            // Create the navigation bar
            Alignment navigationBarAlignment = new Alignment(0, 0, 1, 1);
            navigationBarAlignment.TopPadding = 3;
            navigationBarAlignment.BottomPadding = 3;
            navigationBar = new NavigationBar ();
            navigationBar.PathButtonClicked += on_navigationBar_PathButtonClicked;
            navigationBarAlignment.Add(navigationBar);
            base.PackStart(navigationBarAlignment, false, false, 0);
            navigationBarAlignment.ShowAll ();

            // Load some images
            stockDirectoryPixbuf = Gui.LoadIcon(16, "folder");
            stockFilePixbuf      = Gui.LoadIcon(16, "text-x-generic");
            networkIcon          = Gui.LoadIcon(16, "stock_internet");

            // Set up the file list
            filesList.Selection.Changed += filesList_Selection_Changed;
            filesList.Selection.Mode = SelectionMode.Browse;
            /*
            filesList.Selection.Mode = SelectionMode.Multiple;
            filesList.RubberBanding = true;
            */

            filesListStore = new ListStore (typeof(IDirectoryItem));
            filesList.Model = filesListStore;

            TreeViewColumn column;

            // Add Name column
            column = new TreeViewColumn ();
            column.Title = "Name";
            column.Resizable = true;

            Gtk.CellRendererPixbuf fileListRowIcon = new Gtk.CellRendererPixbuf();
            column.PackStart (fileListRowIcon, false);
            column.SetCellDataFunc (fileListRowIcon, new TreeCellDataFunc(FileNameIconFunc));

            Gtk.CellRendererText fileListRowText = new Gtk.CellRendererText();
            column.PackStart (fileListRowText, true);
            column.SetCellDataFunc (fileListRowText, new TreeCellDataFunc(FileNameTextFunc));

            filesList.AppendColumn (column);

            // Add Size Column
            column = filesList.AppendColumn ("Size", new CellRendererText(), new TreeCellDataFunc (FileSizeFunc));
               	column.Resizable = true;

            // Add Type Column
            column = filesList.AppendColumn ("Type", new CellRendererText(), new TreeCellDataFunc (FileTypeFunc));
            column.Resizable = true;

            // Add InfoHash Column
            column = filesList.AppendColumn ("Info Hash", new CellRendererText(), new TreeCellDataFunc (FileInfoHashFunc));
            column.Resizable = true;

            base.PackStart(Gui.AddScrolledWindow(filesList), true, true, 0);
            filesList.ShowAll();

            waitingBoxAlignment = new Alignment(0.5f, 0.5f, 0, 0);
            VBox waitingBox = new VBox();
            waitProgressBar = new ProgressBar();
            waitLabel = new Label();
            waitingBox.PackStart(waitProgressBar, false, false, 0);
            waitingBox.PackStart(waitLabel, false, false, 0);
            waitingBoxAlignment.Add(waitingBox);
            this.PackStart(waitingBoxAlignment, true, true, 0);

            Core.NetworkAdded += Core_NetworkAdded;
            foreach (Network network in Core.Networks) {
                Core_NetworkAdded (network);
            }

            resultPopupMenu = new Menu();

            ImageMenuItem item = new ImageMenuItem("Download");
            item.Image = new Image(Gui.LoadIcon(16, "go-down"));
            item.Activated += on_mnuFileDownload_activate;
            resultPopupMenu.Append(item);

            item = new ImageMenuItem(Gtk.Stock.Properties, null);
            item.Activated += filePropertiesMenuItem_Activated;
            resultPopupMenu.Append(item);

            NavigateTo ("/");
        }