コード例 #1
0
ファイル: StatusBar.cs プロジェクト: harsimranb/monodevelop
        public StatusBarIcon ShowStatusIcon(Xwt.Drawing.Image pixbuf)
        {
            nfloat right = layerToStatus.Count == 0 ?
                           Layer.Frame.Width :
                           Layer.Sublayers.Last(i => i.Name != null && i.Name.StartsWith(StatusIconPrefixId, StringComparison.Ordinal)).Frame.Left;

            right -= (nfloat)pixbuf.Width + 6;
            var layer = CALayer.Create();

            layer.Name   = StatusIconPrefixId + (++statusCounter);
            layer.Bounds = new CGRect(0, 0, (nfloat)pixbuf.Width, (nfloat)pixbuf.Height);
            layer.Frame  = new CGRect(right, 3, (nfloat)pixbuf.Width, (nfloat)pixbuf.Height);

            var area = new NSTrackingArea(layer.Frame, NSTrackingAreaOptions.MouseEnteredAndExited | NSTrackingAreaOptions.ActiveInKeyWindow, this, null);

            AddTrackingArea(area);

            var statusIcon = new StatusIcon(this, layer, area)
            {
                Image = pixbuf,
            };

            layerToStatus [layer.Name] = statusIcon;

            Layer.AddSublayer(layer);

            textField.SetFrameSize(new CGSize(right - 6 - textField.Frame.Left, Frame.Height));

            return(statusIcon);
        }
コード例 #2
0
ファイル: StatusBar.cs プロジェクト: srsmithdata/monodevelop
        internal void RemoveStatusIcon(StatusIcon icon)
        {
            statusIcons.Remove(icon);

            icon.Entered -= ShowPopoverForIcon;
            icon.Exited  -= DestroyPopover;
            icon.Clicked -= DestroyPopover;

            RepositionStatusIcons();
        }
コード例 #3
0
        internal void RemoveStatusIcon(StatusIcon icon)
        {
            statusIcons.Remove(icon);

            icon.Entered -= ShowPopoverForIcon;
            icon.Exited  -= DestroyPopover;
            icon.Clicked -= DestroyPopover;

            if (!popoverForStatus && popover != null)
            {
                DestroyPopover(null, null);
            }

            RepositionStatusIcons();
        }
コード例 #4
0
        public StatusBarIcon ShowStatusIcon(Xwt.Drawing.Image pixbuf)
        {
            var layer = CALayer.Create();

            layer.Name   = StatusIconPrefixId + (++statusCounter);
            layer.Bounds = new CGRect(0, 0, (nfloat)pixbuf.Width, (nfloat)pixbuf.Height);
            var statusIcon = new StatusIcon(this, layer, null)
            {
                Image = pixbuf,
            };

            layerToStatus [layer.Name] = statusIcon;

            Layer.AddSublayer(layer);

            RepositionStatusLayers();

            return(statusIcon);
        }
コード例 #5
0
ファイル: StatusBar.cs プロジェクト: srsmithdata/monodevelop
        public StatusBarIcon ShowStatusIcon(Xwt.Drawing.Image pixbuf)
        {
            var statusIcon = new StatusIcon(this)
            {
                Image = pixbuf,
            };

            statusIcons.Add(statusIcon);

            statusIcon.Entered += ShowPopoverForIcon;
            statusIcon.Exited  += DestroyPopover;

            // We need to destroy the popover otherwise the window doesn't come up correctly
            statusIcon.Clicked += DestroyPopover;

            AddSubview(statusIcon);
            RepositionStatusIcons();

            return(statusIcon);
        }
コード例 #6
0
		public StatusBarIcon ShowStatusIcon (Xwt.Drawing.Image pixbuf)
		{
			var statusIcon = new StatusIcon (this) {
				Image = pixbuf,
			};
			statusIcons.Add (statusIcon);

			statusIcon.Entered += ShowPopoverForIcon;
			statusIcon.Exited += DestroyPopover;

			// We need to destroy the popover otherwise the window doesn't come up correctly
			statusIcon.Clicked += DestroyPopover;

			AddSubview (statusIcon);
			RepositionStatusIcons ();

			return statusIcon;
		}
コード例 #7
0
		internal void RemoveStatusIcon (StatusIcon icon)
		{
			statusIcons.Remove (icon);

			icon.Entered -= ShowPopoverForIcon;
			icon.Exited -= DestroyPopover;
			icon.Clicked -= DestroyPopover;

			RepositionStatusIcons ();
		}
コード例 #8
0
ファイル: StatusBar.cs プロジェクト: RussellHaley/monodevelop
		public StatusBarIcon ShowStatusIcon (Xwt.Drawing.Image pixbuf)
		{
			nfloat right = layerToStatus.Count == 0 ?
				Layer.Frame.Width :
				Layer.Sublayers.Last (i => i.Name != null && i.Name.StartsWith (StatusIconPrefixId, StringComparison.Ordinal)).Frame.Left;

			right -= (nfloat)pixbuf.Width + 6;
			var layer = CALayer.Create ();
			layer.Name = StatusIconPrefixId + (++statusCounter);
			layer.Bounds = new CGRect (0, 0, (nfloat)pixbuf.Width, (nfloat)pixbuf.Height);
			layer.Frame = new CGRect (right, 3, (nfloat)pixbuf.Width, (nfloat)pixbuf.Height);

			var area = new NSTrackingArea (layer.Frame, NSTrackingAreaOptions.MouseEnteredAndExited | NSTrackingAreaOptions.ActiveInKeyWindow, this, null);
			AddTrackingArea (area);

			var statusIcon = new StatusIcon (this, layer, area) {
				Image = pixbuf,
			};
			layerToStatus [layer.Name] = statusIcon;

			Layer.AddSublayer (layer);

			textField.SetFrameSize (new CGSize (right - 6 - textField.Frame.Left, Frame.Height));

			return statusIcon;
		}
コード例 #9
0
		public StatusBarIcon ShowStatusIcon (Xwt.Drawing.Image pixbuf)
		{
			var layer = CALayer.Create ();
			layer.Name = StatusIconPrefixId + (++statusCounter);
			layer.Bounds = new CGRect (0, 0, (nfloat)pixbuf.Width, (nfloat)pixbuf.Height);
			var statusIcon = new StatusIcon (this, layer, null) {
				Image = pixbuf,
			};
			layerToStatus [layer.Name] = statusIcon;

			Layer.AddSublayer (layer);

			RepositionStatusLayers ();

			return statusIcon;
		}