void ShowTooltipWindow(int x, int y) { tooltipTimeout = 0; int dx = (int)((double)Allocation.Width * dividerPosition); if (x >= dx) { return; } var row = GetAllRows(true).FirstOrDefault(r => !r.IsCategory && y >= r.EditorBounds.Y && y <= r.EditorBounds.Bottom); if (row != null) { tooltipWindow = new TooltipPopoverWindow(); tooltipWindow.ShowArrow = true; var s = "<b>" + row.Property.DisplayName + "</b>\n\n"; s += GLib.Markup.EscapeText(row.Property.Description); tooltipWindow.Markup = s; tooltipWindow.ShowPopup(this, new Gdk.Rectangle(0, row.EditorBounds.Y, Allocation.Width, row.EditorBounds.Height), PopupPosition.Right); } }
void ShowTooltipWindow(int x, int y) { tooltipTimeout = 0; if (x >= Allocation.Width) { return; } var row = GetAllRows(true).FirstOrDefault(r => !r.IsCategory && y >= r.EditorBounds.Y && y <= r.EditorBounds.Bottom); if (row != null) { if (tooltipWindow == null) { tooltipWindow = TooltipPopoverWindow.Create(); tooltipWindow.ShowArrow = true; } var s = new System.Text.StringBuilder("<b>" + row.Property.DisplayName + "</b>"); s.AppendLine(); s.AppendLine(); s.Append(GLib.Markup.EscapeText(row.Property.Description)); if (row.Property.Converter.CanConvertTo(row, typeof(string))) { var value = Convert.ToString(row.Property.GetValue(row.Instance)); if (!string.IsNullOrEmpty(value)) { const int chunkLength = 200; var multiLineValue = string.Join(Environment.NewLine, Enumerable.Range(0, (int)Math.Ceiling((double)value.Length / chunkLength)).Select(n => string.Concat(value.Skip(n * chunkLength).Take(chunkLength)))); s.AppendLine(); s.AppendLine(); s.Append("Value: ").Append(multiLineValue); } } tooltipWindow.Markup = s.ToString(); tooltipWindow.ShowPopup(this, new Gdk.Rectangle(0, row.EditorBounds.Y, Allocation.Width, row.EditorBounds.Height), PopupPosition.Right); } }
void ShowTooltipWindow(int x, int y) { tooltipTimeout = 0; int dx = (int)((double)Allocation.Width * dividerPosition); if (x >= dx) return; var row = GetAllRows (true).FirstOrDefault (r => !r.IsCategory && y >= r.EditorBounds.Y && y <= r.EditorBounds.Bottom); if (row != null) { tooltipWindow = new TooltipPopoverWindow (); tooltipWindow.ShowArrow = true; var s = new System.Text.StringBuilder ("<b>" + row.Property.DisplayName + "</b>"); s.AppendLine (); s.AppendLine (); s.Append (GLib.Markup.EscapeText (row.Property.Description)); if (row.Property.Converter.CanConvertTo (typeof(string))) { var value = Convert.ToString (row.Property.GetValue (row.Instace)); if (!string.IsNullOrEmpty (value)) { const int chunkLength = 200; var multiLineValue = string.Join (Environment.NewLine, Enumerable.Range (0, (int)Math.Ceiling ((double)value.Length / chunkLength)).Select (n => string.Concat (value.Skip (n * chunkLength).Take (chunkLength)))); s.AppendLine (); s.AppendLine (); s.Append ("Value: " + multiLineValue); } } tooltipWindow.Markup = s.ToString (); tooltipWindow.ShowPopup (this, new Gdk.Rectangle (0, row.EditorBounds.Y, Allocation.Width, row.EditorBounds.Height), PopupPosition.Right); } }
void HandleKeyTreeMotion(double mouseX, double mouseY) { if (keyBindingsPanel.duplicates?.Count <= 0) { return; } var hit = HitTest(mouseX, mouseY); if (hit.ButtonBounds.IsEmpty) { HideConflictTooltip(); return; } if (hit.AllKeys.Count == 0) { return; } HashSet <Command> keyDuplicates = null; if (keyBindingsPanel.duplicates.TryGetValue(hit.AllKeys [hit.SelectedKey], out keyDuplicates)) { var cmdDuplicates = keyDuplicates.Where(cmd => cmd != hit.Command); if (tooltipWindow == null) { tooltipWindow = TooltipPopoverWindow.Create(); tooltipWindow.ShowArrow = true; //tooltipWindow.LeaveNotifyEvent += delegate { HideConflictTooltip (); }; } var text = string.Empty; HashSet <Command> cmdConflicts = null; bool hasConflict = false; if (keyBindingsPanel.conflicts != null && keyBindingsPanel.conflicts.TryGetValue(hit.AllKeys [hit.SelectedKey], out cmdConflicts)) { hasConflict = cmdConflicts.Contains(hit.Command); } if (hasConflict) { var acmdConflicts = cmdConflicts.Where(cmd => cmd != hit.Command).ToArray(); text += GettextCatalog.GetPluralString( "This shortcut is assigned to another command that is available\nin the same context. Please set a different shortcut.", "This shortcut is assigned to other commands that are available\nin the same context. Please set a different shortcut.", acmdConflicts.Length) + "\n\n"; text += GettextCatalog.GetString("Conflicts:"); foreach (var conflict in acmdConflicts) { text += "\n\u2022 " + conflict.Category + " \u2013 " + conflict.DisplayName; } cmdDuplicates = cmdDuplicates.Except(acmdConflicts); } if (cmdDuplicates.Count() > 0) { if (hasConflict) { text += "\n\n"; } text += GettextCatalog.GetString("Duplicates:"); foreach (var cmd in cmdDuplicates) { text += "\n\u2022 " + cmd.Category + " \u2013 " + cmd.DisplayName; } } tooltipWindow.Markup = text; tooltipWindow.Severity = hasConflict ? Tasks.TaskSeverity.Error : Tasks.TaskSeverity.Warning; tooltipWindow.ShowPopup(keyBindingsTree, hit.ButtonBounds, PopupPosition.Top); } else { HideConflictTooltip(); } }
void ShowTooltipWindow (int x, int y) { tooltipTimeout = 0; int dx = (int)((double)Allocation.Width * dividerPosition); if (x >= dx) return; var row = GetAllRows (true).FirstOrDefault (r => !r.IsCategory && y >= r.EditorBounds.Y && y <= r.EditorBounds.Bottom); if (row != null) { tooltipWindow = new TooltipPopoverWindow (); tooltipWindow.ShowArrow = true; var s = "<b>" + row.Property.DisplayName + "</b>\n\n"; s += GLib.Markup.EscapeText (row.Property.Description); tooltipWindow.Markup = s; tooltipWindow.ShowPopup (this, new Gdk.Rectangle (0, row.EditorBounds.Y, Allocation.Width, row.EditorBounds.Height), PopupPosition.Right); } }