Beispiel #1
0
        VBox CreateCategory(string categoryName, string categoryContentMarkup)
        {
            var vbox = new VBox();

            vbox.Spacing = 2;

            var catLabel = new MonoDevelop.Components.FixedWidthWrapLabel();

            catLabel.Text = categoryName;
            catLabel.ModifyFg(StateType.Normal, (HslColor)foreColor);

            vbox.PackStart(catLabel, false, true, 0);

            var contentLabel = new MonoDevelop.Components.FixedWidthWrapLabel();

            contentLabel.MaxWidth           = Math.Max(440, this.Allocation.Width);
            contentLabel.Wrap               = Pango.WrapMode.WordChar;
            contentLabel.BreakOnCamelCasing = true;
            contentLabel.BreakOnPunctuation = true;
            contentLabel.Markup             = categoryContentMarkup.Trim();
            contentLabel.ModifyFg(StateType.Normal, (HslColor)foreColor);

            vbox.PackStart(contentLabel, true, true, 0);

            return(vbox);
        }
        protected override void OnShown()
        {
            var scheme = SyntaxModeService.GetColorStyle(IdeApp.Preferences.ColorScheme);

            Theme.SetSchemeColors(scheme);
            foreColor = scheme.PlainText.Foreground;
            headlabel.ModifyFg(StateType.Normal, foreColor.ToGdkColor());

            base.OnShown();
        }
        void ShowOverload()
        {
            ClearDescriptions();

            if (current_overload >= 0 && current_overload < overloads.Count)
            {
                var o = overloads[current_overload];
                headlabel.BreakOnCamelCasing = false;
                headlabel.BreakOnPunctuation = false;
                headlabel.Markup             = o.SignatureMarkup;
                headlabel.Visible            = true;

                if (Theme.DrawPager && overloads.Count > 1)
                {
                    headlabel.WidthRequest = headlabel.RealWidth + 70;
                }
                else
                {
                    headlabel.WidthRequest = -1;
                }
                foreach (var cat in o.Categories)
                {
                    descriptionBox.PackStart(CreateCategory(cat.Item1, cat.Item2), true, true, 4);
                }

                if (!string.IsNullOrEmpty(o.SummaryMarkup))
                {
                    descriptionBox.PackStart(CreateCategory(GettextCatalog.GetString("Summary"), o.SummaryMarkup), true, true, 4);
                }
                if (!string.IsNullOrEmpty(o.FooterMarkup))
                {
                    var contentLabel = new MonoDevelop.Components.FixedWidthWrapLabel();
                    contentLabel.Wrap = Pango.WrapMode.WordChar;
                    contentLabel.BreakOnCamelCasing = true;
                    contentLabel.MaxWidth           = 400;
                    contentLabel.BreakOnPunctuation = true;
                    contentLabel.Markup             = o.FooterMarkup.Trim();
                    contentLabel.ModifyFg(StateType.Normal, (HslColor)foreColor);

                    descriptionBox.PackEnd(contentLabel, true, true, 4);
                }

                if (string.IsNullOrEmpty(o.SummaryMarkup) && string.IsNullOrEmpty(o.FooterMarkup) && !o.Categories.Any())
                {
                    descriptionBox.Hide();
                }
                else
                {
                    descriptionBox.ShowAll();
                }
                Theme.CurrentPage = current_overload;
                QueueResize();
            }
        }
        public TooltipInformationWindow() : base()
        {
            TypeHint             = Gdk.WindowTypeHint.Tooltip;
            this.SkipTaskbarHint = true;
            this.SkipPagerHint   = true;
            if (IdeApp.Workbench != null)
            {
                this.TransientFor = IdeApp.Workbench.RootWindow;
            }
            this.AllowShrink = false;
            this.AllowGrow   = false;
            this.CanFocus    = false;
            this.CanDefault  = false;
            this.Events     |= Gdk.EventMask.EnterNotifyMask;

            headlabel        = new MonoDevelop.Components.FixedWidthWrapLabel();
            headlabel.Indent = -20;
            var des = FontService.GetFontDescription("Editor").Copy();

            des.Size = des.Size * 9 / 10;
            headlabel.FontDescription = des;
//			headlabel.MaxWidth = 400;
            headlabel.Wrap = Pango.WrapMode.WordChar;
            headlabel.BreakOnCamelCasing = true;
//			headlabel.BreakOnPunctuation = true;
            descriptionBox.Spacing = 4;
            VBox vb = new VBox(false, 8);

            vb.PackStart(headlabel, true, true, 0);
            vb.PackStart(descriptionBox, true, true, 0);

            HBox hb = new HBox(false, 0);

            hb.PackStart(vb, true, true, 0);
            WindowTransparencyDecorator.Attach(this);

            vb2.Spacing = 4;
            vb2.PackStart(hb, true, true, 0);
            ContentBox.Add(vb2);
            var scheme = Mono.TextEditor.Highlighting.SyntaxModeService.GetColorStyle(IdeApp.Preferences.ColorScheme);

            Theme.SetSchemeColors(scheme);
            foreColor = scheme.PlainText.Foreground;
            headlabel.ModifyFg(StateType.Normal, (HslColor)foreColor);
            ShowAll();
            DesktopService.RemoveWindowShadow(this);
        }
        public ParameterInformationWindow()
        {
            TypeHint             = Gdk.WindowTypeHint.Tooltip;
            this.SkipTaskbarHint = true;
            this.SkipPagerHint   = true;
            this.AllowShrink     = false;
            this.AllowGrow       = false;
            this.CanFocus        = false;
            this.CanDefault      = false;
            Mono.TextEditor.PopupWindow.WindowTransparencyDecorator.Attach(this);

            headlabel        = new MonoDevelop.Components.FixedWidthWrapLabel();
            headlabel.Indent = -20;

            headlabel.FontDescription = FontService.GetFontDescription("Editor").CopyModified(1.1);

            headlabel.Wrap = Pango.WrapMode.WordChar;
            headlabel.BreakOnCamelCasing = false;
            headlabel.BreakOnPunctuation = false;
            descriptionBox.Spacing       = 4;
            VBox vb = new VBox(false, 0);

            vb.PackStart(headlabel, true, true, 0);
            vb.PackStart(descriptionBox, true, true, 0);

            HBox hb = new HBox(false, 0);

            hb.PackStart(vb, true, true, 0);


            vb2.Spacing = 4;
            vb2.PackStart(hb, true, true, 0);
            ContentBox.Add(vb2);
            var scheme = Mono.TextEditor.Highlighting.SyntaxModeService.GetColorStyle(IdeApp.Preferences.ColorScheme);

            Theme.SetSchemeColors(scheme);

            foreColor = scheme.PlainText.Foreground;
            headlabel.ModifyFg(StateType.Normal, foreColor.ToGdkColor());
            ShowAll();
            DesktopService.RemoveWindowShadow(this);
        }
Beispiel #6
0
        void UpdateStyle()
        {
            var scheme = SyntaxHighlightingService.GetEditorTheme(IdeApp.Preferences.ColorScheme);

            if (!scheme.FitsIdeTheme(IdeApp.Preferences.UserInterfaceTheme))
            {
                scheme = SyntaxHighlightingService.GetDefaultColorStyle(IdeApp.Preferences.UserInterfaceTheme);
            }

            Theme.SetSchemeColors(scheme);
            Theme.Font        = FontService.SansFont.CopyModified(Styles.FontScale11).ToXwtFont();
            Theme.ShadowColor = Styles.PopoverWindow.ShadowColor;
            foreColor         = Styles.PopoverWindow.DefaultTextColor.ToCairoColor();

            headlabel.ModifyFg(StateType.Normal, foreColor.ToGdkColor());
            headlabel.FontDescription = FontService.GetFontDescription("Editor").CopyModified(Styles.FontScale11);

            //if (this.Visible)
            //	QueueDraw ();
        }
		public TooltipInformationWindow () : base ()
		{
			TypeHint = Gdk.WindowTypeHint.Tooltip;
			this.SkipTaskbarHint = true;
			this.SkipPagerHint = true;
			if (IdeApp.Workbench != null)
				this.TransientFor = IdeApp.Workbench.RootWindow;
			this.AllowShrink = false;
			this.AllowGrow = false;
			this.CanFocus = false;
			this.CanDefault = false;
			this.Events |= Gdk.EventMask.EnterNotifyMask; 
			
			headlabel = new FixedWidthWrapLabel ();
			headlabel.Indent = -20;
			var des = FontService.GetFontDescription ("Editor").Copy ();
			des.Size = des.Size * 9 / 10;
			headlabel.FontDescription = des;
//			headlabel.MaxWidth = 400;
			headlabel.Wrap = Pango.WrapMode.WordChar;
			headlabel.BreakOnCamelCasing = false;
			headlabel.BreakOnPunctuation = false;
			descriptionBox.Spacing = 4;
			VBox vb = new VBox (false, 8);
			vb.PackStart (headlabel, true, true, 0);
			vb.PackStart (descriptionBox, true, true, 0);

			HBox hb = new HBox (false, 0);
			hb.PackStart (vb, true, true, 0);
			WindowTransparencyDecorator.Attach (this);

			vb2.Spacing = 4;
			vb2.PackStart (hb, true, true, 0);
			ContentBox.Add (vb2);
			var scheme = Mono.TextEditor.Highlighting.SyntaxModeService.GetColorStyle (IdeApp.Preferences.ColorScheme);
			Theme.SetSchemeColors (scheme);
			foreColor = scheme.PlainText.Foreground;
			headlabel.ModifyFg (StateType.Normal, (HslColor)foreColor);
			ShowAll ();
			DesktopService.RemoveWindowShadow (this);
		}
		VBox CreateCategory (string categoryName, string categoryContentMarkup)
		{
			var vbox = new VBox ();

			vbox.Spacing = 2;

			var catLabel = new FixedWidthWrapLabel ();
			catLabel.Text = categoryName;
			catLabel.ModifyFg (StateType.Normal, (HslColor)foreColor);

			vbox.PackStart (catLabel, false, true, 0);

			var contentLabel = new FixedWidthWrapLabel ();
			contentLabel.Wrap = Pango.WrapMode.WordChar;
			contentLabel.BreakOnCamelCasing = false;
			contentLabel.BreakOnPunctuation = false;
			contentLabel.MaxWidth = 400;
			contentLabel.Markup = categoryContentMarkup.Trim ();
			contentLabel.ModifyFg (StateType.Normal, (HslColor)foreColor);

			vbox.PackStart (contentLabel, true, true, 0);

			return vbox;
		}
		void ShowOverload ()
		{
			ClearDescriptions ();

			if (current_overload >= 0 && current_overload < overloads.Count) {
				var o = overloads[current_overload];
				headlabel.Markup = o.SignatureMarkup;
				headlabel.Visible = true;
				int x, y;
				GetPosition (out x, out y);
				var geometry = DesktopService.GetUsableMonitorGeometry (Screen, Screen.GetMonitorAtPoint (x, y));
				headlabel.MaxWidth = Math.Max (geometry.Width / 5, 480);

				if (Theme.DrawPager && overloads.Count > 1) {
					headlabel.WidthRequest = headlabel.RealWidth + 70;
				} else {
					headlabel.WidthRequest = -1;
				}
				foreach (var cat in o.Categories) {
					descriptionBox.PackStart (CreateCategory (cat.Item1, cat.Item2), true, true, 4);
				}

				if (!string.IsNullOrEmpty (o.SummaryMarkup)) {
					descriptionBox.PackStart (CreateCategory (GettextCatalog.GetString ("Summary"), o.SummaryMarkup), true, true, 4);
				}
				if (!string.IsNullOrEmpty (o.FooterMarkup)) {

					var contentLabel = new FixedWidthWrapLabel ();
					contentLabel.Wrap = Pango.WrapMode.WordChar;
					contentLabel.BreakOnCamelCasing = false;
					contentLabel.BreakOnPunctuation = false;
					contentLabel.MaxWidth = 400;
					contentLabel.Markup = o.FooterMarkup.Trim ();
					contentLabel.ModifyFg (StateType.Normal, (HslColor)foreColor);

					descriptionBox.PackEnd (contentLabel, true, true, 4);
				}

				if (string.IsNullOrEmpty (o.SummaryMarkup) && string.IsNullOrEmpty (o.FooterMarkup) && !o.Categories.Any ()) {
					descriptionBox.Hide ();
				} else {
					descriptionBox.ShowAll ();
				}
				Theme.CurrentPage = current_overload;
				QueueResize ();
			}
		}
		void ShowOverload ()
		{
			ClearDescriptions ();

			if (current_overload >= 0 && current_overload < overloads.Count) {
				var o = overloads[current_overload];
				headlabel.Markup = o.SignatureMarkup;
				headlabel.Visible = true;
				if (Theme.DrawPager && overloads.Count > 1) {
					headlabel.WidthRequest = headlabel.RealWidth + 70;
				} else {
					headlabel.WidthRequest = -1;
				}
				foreach (var cat in o.Categories) {
					descriptionBox.PackStart (CreateCategory (cat.Item1, cat.Item2), true, true, 4);
				}

				if (!string.IsNullOrEmpty (o.SummaryMarkup)) {
					descriptionBox.PackStart (CreateCategory (GettextCatalog.GetString ("Summary"), o.SummaryMarkup), true, true, 4);
				}
				if (!string.IsNullOrEmpty (o.FooterMarkup)) {

					var contentLabel = new MonoDevelop.Components.FixedWidthWrapLabel ();
					contentLabel.Wrap = Pango.WrapMode.WordChar;
					contentLabel.BreakOnCamelCasing = true;
					contentLabel.MaxWidth = 400;
					contentLabel.BreakOnPunctuation = true;
					contentLabel.Markup = o.FooterMarkup.Trim ();
					contentLabel.ModifyFg (StateType.Normal, (HslColor)foreColor);

					descriptionBox.PackEnd (contentLabel, true, true, 4);
				}

				if (string.IsNullOrEmpty (o.SummaryMarkup) && string.IsNullOrEmpty (o.FooterMarkup) && !o.Categories.Any ()) {
					descriptionBox.Hide ();
				} else {
					descriptionBox.ShowAll ();
				}
				Theme.CurrentPage = current_overload;
				QueueResize ();
			}
		}
		VBox CreateCategory (string categoryName, string categoryContentMarkup)
		{
			var vbox = new VBox ();
			
			vbox.Spacing = 2;
			
			var catLabel = new MonoDevelop.Components.FixedWidthWrapLabel ();
			catLabel.Text = categoryName;
			catLabel.ModifyFg (StateType.Normal, (HslColor)foreColor);
			
			vbox.PackStart (catLabel, false, true, 0);
			
			var contentLabel = new MonoDevelop.Components.FixedWidthWrapLabel ();
			contentLabel.MaxWidth = Math.Max (440, this.Allocation.Width);
			contentLabel.Wrap = Pango.WrapMode.WordChar;
			contentLabel.BreakOnCamelCasing = true;
			contentLabel.BreakOnPunctuation = true;
			contentLabel.Markup = categoryContentMarkup.Trim ();
			contentLabel.ModifyFg (StateType.Normal, (HslColor)foreColor);
			
			vbox.PackStart (contentLabel, true, true, 0);
			
			return vbox;
		}
        public ParameterInformationWindow()
        {
            TypeHint = Gdk.WindowTypeHint.Tooltip;
            this.SkipTaskbarHint = true;
            this.SkipPagerHint = true;
            this.AllowShrink = false;
            this.AllowGrow = false;
            this.CanFocus = false;
            this.CanDefault = false;
            Mono.TextEditor.PopupWindow.WindowTransparencyDecorator.Attach (this);

            headlabel = new MonoDevelop.Components.FixedWidthWrapLabel ();
            headlabel.Indent = -20;

            headlabel.FontDescription = FontService.GetFontDescription ("Editor").CopyModified (1.1);

            headlabel.Wrap = Pango.WrapMode.WordChar;
            headlabel.BreakOnCamelCasing = false;
            headlabel.BreakOnPunctuation = false;
            descriptionBox.Spacing = 4;
            VBox vb = new VBox (false, 0);
            vb.PackStart (headlabel, true, true, 0);
            vb.PackStart (descriptionBox, true, true, 0);

            HBox hb = new HBox (false, 0);
            hb.PackStart (vb, true, true, 0);

            vb2.Spacing = 4;
            vb2.PackStart (hb, true, true, 0);
            ContentBox.Add (vb2);
            var scheme = Mono.TextEditor.Highlighting.SyntaxModeService.GetColorStyle (IdeApp.Preferences.ColorScheme);
            Theme.SetSchemeColors (scheme);

            foreColor = scheme.PlainText.Foreground;
            headlabel.ModifyFg (StateType.Normal, foreColor.ToGdkColor ());
            ShowAll ();
            DesktopService.RemoveWindowShadow (this);
        }
		internal static VBox CreateCategory (string categoryName, string categoryContentMarkup, Cairo.Color foreColor)
		{
			var vbox = new VBox ();

			vbox.Spacing = 8;

			if (categoryName != null) {
				var catLabel = new FixedWidthWrapLabel ();
				catLabel.Markup = categoryName;
				catLabel.ModifyFg (StateType.Normal, foreColor.ToGdkColor ());
				catLabel.FontDescription = FontService.GetFontDescription ("Editor");
				vbox.PackStart (catLabel, false, true, 0);
			}

			var contentLabel = new FixedWidthWrapLabel ();
			HBox hbox = new HBox ();

			// hbox.PackStart (new Label(), false, true, 10);


			contentLabel.Wrap = Pango.WrapMode.WordChar;
			contentLabel.BreakOnCamelCasing = false;
			contentLabel.BreakOnPunctuation = false;
			contentLabel.MaxWidth = 400;
			contentLabel.Markup = categoryContentMarkup.Trim ();
			contentLabel.ModifyFg (StateType.Normal, foreColor.ToGdkColor ());
			contentLabel.FontDescription = FontService.GetFontDescription ("Editor");

			hbox.PackStart (contentLabel, true, true, 0);
			vbox.PackStart (hbox, true, true, 0);

			return vbox;
		}
		internal static VBox CreateCategory (string categoryName, string categoryContentMarkup, Cairo.Color foreColor, Pango.FontDescription font)
		{
			var vbox = new VBox ();

			vbox.Spacing = 8;

			if (categoryName != null) {
				var catLabel = new FixedWidthWrapLabel ();
				catLabel.Markup = categoryName;
				catLabel.ModifyFg (StateType.Normal, foreColor.ToGdkColor ());
				catLabel.FontDescription = font.Copy ();
				catLabel.FontDescription.Weight = Pango.Weight.Bold;
				catLabel.FontDescription.Size = catLabel.FontDescription.Size + (int)(1 * Pango.Scale.PangoScale);
				vbox.PackStart (catLabel, false, true, 0);
			}

			var contentLabel = new FixedWidthWrapLabel ();
			HBox hbox = new HBox ();

			// hbox.PackStart (new Label(), false, true, 10);


			contentLabel.Wrap = Pango.WrapMode.WordChar;
			contentLabel.Spacing = 1;
			contentLabel.BreakOnCamelCasing = false;
			contentLabel.BreakOnPunctuation = false;
			contentLabel.MaxWidth = 400;
			contentLabel.Markup = categoryContentMarkup.Trim ();
			contentLabel.ModifyFg (StateType.Normal, foreColor.ToGdkColor ());
			contentLabel.FontDescription = font;

			hbox.PackStart (contentLabel, true, true, 0);
			vbox.PackStart (hbox, true, true, 0);

			return vbox;
		}
		void ShowOverload ()
		{
			ClearDescriptions ();

			if (current_overload >= 0 && current_overload < overloads.Count) {
				var o = overloads[current_overload];
				headLabel.Markup = o.SignatureMarkup;
				headLabel.Visible = !string.IsNullOrEmpty (o.SignatureMarkup);
				int x, y;
				GetPosition (out x, out y);
				var geometry = DesktopService.GetUsableMonitorGeometry (Screen.Number, Screen.GetMonitorAtPoint (x, y));
				headLabel.MaxWidth = Math.Max ((int)geometry.Width / 5, 480);

				if (Theme.DrawPager && overloads.Count > 1) {
					headLabel.WidthRequest = headLabel.RealWidth + 70;
				} else {
					headLabel.WidthRequest = -1;
				}
				foreach (var cat in o.Categories) {
					descriptionBox.PackStart (CreateCategory (GetHeaderMarkup (cat.Item1), cat.Item2, foreColor, Theme.Font), true, true, 4);
				}

				if (!string.IsNullOrEmpty (o.SummaryMarkup)) {
					descriptionBox.PackStart (CreateCategory (GetHeaderMarkup (GettextCatalog.GetString ("Summary")), o.SummaryMarkup, foreColor, Theme.Font), true, true, 4);
				}
				if (!string.IsNullOrEmpty (o.FooterMarkup)) {

					var contentLabel = new FixedWidthWrapLabel ();
					contentLabel.Wrap = Pango.WrapMode.WordChar;
					contentLabel.BreakOnCamelCasing = false;
					contentLabel.BreakOnPunctuation = false;
					contentLabel.MaxWidth = 400;
					contentLabel.Markup = o.FooterMarkup.Trim ();
					contentLabel.ModifyFg (StateType.Normal, foreColor.ToGdkColor ());
					contentLabel.FontDescription = Theme.Font;

					descriptionBox.PackEnd (contentLabel, true, true, 4);
				}

				if (string.IsNullOrEmpty (o.SummaryMarkup) && string.IsNullOrEmpty (o.FooterMarkup) && !o.Categories.Any ()) {
					descriptionBox.Hide ();
				} else {
					descriptionBox.ShowAll ();
				}
				Theme.CurrentPage = current_overload;
				// if the target is not on the left or top side, we may loose the arrow alignment on our target
				// and must reposition
				if (!CurrentPosition.HasFlag (PopupPosition.Left) &&
				    !CurrentPosition.HasFlag (PopupPosition.Top))
					RepositionWindow ();
				else
					QueueResize ();
			}
		}