public SelectorView () { Cell = new ColoredButtonCell (); BezelStyle = NSBezelStyle.TexturedRounded; Title = ""; RealSelectorView = new PathSelectorView (new CGRect (6, 0, 1, 1)); RealSelectorView.UnregisterDraggedTypes (); AddSubview (RealSelectorView); }
public SelectorView() { Cell = new ColoredButtonCell(); BezelStyle = NSBezelStyle.TexturedRounded; Title = ""; RealSelectorView = new PathSelectorView(new CGRect(6, 0, 1, 1)); RealSelectorView.UnregisterDraggedTypes(); AddSubview(RealSelectorView); }
public RunButton() { UpdateIcons(); Ide.Gui.Styles.Changed += (o, e) => UpdateCell(); Cell = new ColoredButtonCell(); icon = OperationIcon.Run; ImagePosition = NSCellImagePosition.ImageOnly; BezelStyle = NSBezelStyle.TexturedRounded; Enabled = false; }
public RunButton () { UpdateIcons (); Ide.Gui.Styles.Changed += (o, e) => UpdateCell (); Cell = new ColoredButtonCell (); icon = OperationIcon.Run; ImagePosition = NSCellImagePosition.ImageOnly; BezelStyle = NSBezelStyle.TexturedRounded; Enabled = false; }
public SelectorView() { Cell = new ColoredButtonCell(); BezelStyle = NSBezelStyle.TexturedRounded; Title = ""; var nsa = (INSAccessibility)this; nsa.AccessibilityElement = false; RealSelectorView = new PathSelectorView(new CGRect(6, 0, 1, 1)); RealSelectorView.UnregisterDraggedTypes(); AddSubview(RealSelectorView); // Disguise this NSButton as a group AccessibilityRole = NSAccessibilityRoles.GroupRole; // For some reason AddSubview hasn't added RealSelectorView as an accessibility child of SelectorView nsa.AccessibilityChildren = new NSObject [] { RealSelectorView }; }
public StatusBar() { Cell = new ColoredButtonCell(); BezelStyle = NSBezelStyle.TexturedRounded; Title = ""; Enabled = false; LoadStyles(); // We don't need to resize the Statusbar here as a style change will trigger a complete relayout of the Awesomebar Ide.Gui.Styles.Changed += LoadStyles; textField.Cell = new VerticallyCenteredTextFieldCell(0f); textField.Cell.StringValue = ""; UpdateApplicationNamePlaceholderText(); // The rect is empty because we use InVisibleRect to track the whole of the view. textFieldArea = new NSTrackingArea(CGRect.Empty, NSTrackingAreaOptions.MouseEnteredAndExited | NSTrackingAreaOptions.ActiveInKeyWindow | NSTrackingAreaOptions.InVisibleRect, this, null); textField.AddTrackingArea(textFieldArea); imageView.Frame = new CGRect(0.5, 0, 0, 0); imageView.Image = ImageService.GetIcon(Stock.StatusSteady).ToNSImage(); buildResults = new BuildResultsView(); buildResults.Hidden = true; ctxHandler = new StatusBarContextHandler(this); updateHandler = delegate { int ec = 0, wc = 0; foreach (var t in TaskService.Errors) { if (t.Severity == TaskSeverity.Error) { ec++; } else if (t.Severity == TaskSeverity.Warning) { wc++; } } Runtime.RunInMainThread(delegate { buildResults.Hidden = (ec == 0 && wc == 0); buildResults.ResultCount = ec > 0 ? ec : wc; buildImageId = ec > 0 ? "md-status-error-count" : "md-status-warning-count"; buildResults.IconImage = ImageService.GetIcon(buildImageId, Gtk.IconSize.Menu).ToNSImage(); RepositionStatusIcons(); }); }; updateHandler(null, null); TaskService.Errors.TasksAdded += updateHandler; TaskService.Errors.TasksRemoved += updateHandler; BrandingService.ApplicationNameChanged += ApplicationNameChanged; AddSubview(buildResults); AddSubview(imageView); AddSubview(textField); progressView = new ProgressView(); AddSubview(progressView); }
public StatusBar () { Cell = new ColoredButtonCell (); BezelStyle = NSBezelStyle.TexturedRounded; Title = ""; Enabled = false; LoadStyles (); // We don't need to resize the Statusbar here as a style change will trigger a complete relayout of the Awesomebar Ide.Gui.Styles.Changed += LoadStyles; textField.Cell = new VerticallyCenteredTextFieldCell (0f); textField.Cell.StringValue = ""; UpdateApplicationNamePlaceholderText (); // The rect is empty because we use InVisibleRect to track the whole of the view. textFieldArea = new NSTrackingArea (CGRect.Empty, NSTrackingAreaOptions.MouseEnteredAndExited | NSTrackingAreaOptions.ActiveInKeyWindow | NSTrackingAreaOptions.InVisibleRect, this, null); textField.AddTrackingArea (textFieldArea); imageView.Frame = new CGRect (0.5, 0, 0, 0); imageView.Image = ImageService.GetIcon (Stock.StatusSteady).ToNSImage (); buildResults = new BuildResultsView (); buildResults.Hidden = true; cancelButton = new CancelButton (); cancelButton.Activated += (o, e) => { cts?.Cancel (); }; ctxHandler = new StatusBarContextHandler (this); updateHandler = delegate { int ec = 0, wc = 0; foreach (var t in TaskService.Errors) { if (t.Severity == TaskSeverity.Error) ec++; else if (t.Severity == TaskSeverity.Warning) wc++; } Runtime.RunInMainThread (delegate { buildResults.Hidden = (ec == 0 && wc == 0); buildResults.ResultCount = ec > 0 ? ec : wc; buildImageId = ec > 0 ? "md-status-error-count" : "md-status-warning-count"; buildResults.IconImage = ImageService.GetIcon (buildImageId, Gtk.IconSize.Menu).ToNSImage (); RepositionStatusIcons (); }); }; updateHandler (null, null); TaskService.Errors.TasksAdded += updateHandler; TaskService.Errors.TasksRemoved += updateHandler; BrandingService.ApplicationNameChanged += ApplicationNameChanged; AddSubview (cancelButton); AddSubview (buildResults); AddSubview (imageView); AddSubview (textField); progressView = new ProgressView (); AddSubview (progressView); }
public StatusBar() { var nsa = (INSAccessibility)this; // Pretend that this button is a Group AccessibilityRole = NSAccessibilityRoles.GroupRole; nsa.AccessibilityIdentifier = "MainToolbar.StatusDisplay"; Cell = new ColoredButtonCell(); BezelStyle = NSBezelStyle.TexturedRounded; Title = ""; Enabled = false; LoadStyles(); // We don't need to resize the Statusbar here as a style change will trigger a complete relayout of the Awesomebar Ide.Gui.Styles.Changed += LoadStyles; textField.Cell = new VerticallyCenteredTextFieldCell(0f); textField.Cell.StringValue = ""; textField.AccessibilityRole = NSAccessibilityRoles.StaticTextRole; textField.AccessibilityEnabled = true; textField.AccessibilityHelp = GettextCatalog.GetString("Status of the current operation"); var tfNSA = (INSAccessibility)textField; tfNSA.AccessibilityIdentifier = "MainToolbar.StatusDisplay.Status"; UpdateApplicationNamePlaceholderText(); // The rect is empty because we use InVisibleRect to track the whole of the view. textFieldArea = new NSTrackingArea(CGRect.Empty, NSTrackingAreaOptions.MouseEnteredAndExited | NSTrackingAreaOptions.ActiveInKeyWindow | NSTrackingAreaOptions.InVisibleRect, this, null); textField.AddTrackingArea(textFieldArea); imageView.Frame = new CGRect(0.5, 0, 0, 0); imageView.Image = ImageService.GetIcon(Stock.StatusSteady).ToNSImage(); // Hide this image from accessibility imageView.AccessibilityElement = false; buildResults = new BuildResultsView(); buildResults.Hidden = true; cancelButton = new CancelButton(); cancelButton.Activated += (o, e) => { cts?.Cancel(); }; ctxHandler = new StatusBarContextHandler(this); updateHandler = delegate { int ec = 0, wc = 0; foreach (var t in TaskService.Errors) { if (t.Severity == TaskSeverity.Error) { ec++; } else if (t.Severity == TaskSeverity.Warning) { wc++; } } Runtime.RunInMainThread(delegate { buildResults.Hidden = (ec == 0 && wc == 0); buildResults.ResultCount = ec > 0 ? ec : wc; buildResults.Type = ec > 0 ? BuildResultsView.ResultsType.Error : BuildResultsView.ResultsType.Warning; buildImageId = ec > 0 ? "md-status-error-count" : "md-status-warning-count"; buildResults.IconImage = ImageService.GetIcon(buildImageId, Gtk.IconSize.Menu).ToNSImage(); RepositionStatusIcons(); }); }; updateHandler(null, null); TaskService.Errors.TasksAdded += updateHandler; TaskService.Errors.TasksRemoved += updateHandler; BrandingService.ApplicationNameChanged += ApplicationNameChanged; AddSubview(cancelButton); AddSubview(buildResults); AddSubview(imageView); AddSubview(textField); progressView = new ProgressView(); AddSubview(progressView); var newChildren = new NSObject [] { textField, buildResults, progressView }; AccessibilityChildren = newChildren; }