8000 update · dotdevelop/dotdevelop@a7442ef · GitHub
[go: up one dir, main page]

Skip to content

Commit a7442ef

Browse files
committed
update
1 parent f0047cd commit a7442ef

File tree

11 files changed

+142
-92
lines changed

11 files changed

+142
-92
lines changed

main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/ImportSymbolCompletionData.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -217,19 +217,19 @@ public override async Task<TooltipInformation> CreateTooltipInformation (bool sm
217217
markup.AppendTaggedText (theme, taggedParts);
218218
} else {
219219
markup.AppendTaggedText (theme, taggedParts.Take (i));
220-
//markup.Append ("<span font='");
221-
//markup.Append (IdeServices.FontService.SansFontName);
222-
//markup.Append ("' size='small'>");
220+
markup.Append ("<span font='");
221+
markup.Append (IdeServices.FontService.SansFontName);
222+
markup.Append ("' size='small'>");
223223
markup.AppendLine ();
224224
markup.AppendLine ();
225225
markup.AppendTaggedText (theme, taggedParts.Skip (i + 1));
226226
markup.Append ("</span>");
227227
}
228228
markup.AppendLine ();
229229
markup.AppendLine ();
230-
//markup.Append ("<span font='");
231-
//markup.Append (IdeServices.FontService.SansFontName);
232-
//markup.Append ("' size='small'>");
230+
markup.Append ("<span font='");
231+
markup.Append (IdeServices.FontService.SansFontName);
232+
markup.Append ("' size='small'>");
233233
markup.AppendLine (GettextCatalog.GetString ("Note: creates an using for namespace:"));
234234
markup.Append ("<b>");
235235
markup.Append (Ambience.EscapeText (type.ContainingNamespace.ToDisplayString ()));

main/src/addins/CSharpBinding/MonoDevelop.CSharp.Tooltips/QuickInfoProvider.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,9 @@ static class QuickInfoProvider
8484

8585
var formatter = ctx.RoslynWorkspace.Services.GetLanguageServices (model.Language).GetService<IDocumentationCommentFormattingService> ();
8686
var documentation = symbol.GetDocumentationParts (model, caretOffset, formatter, cancellationToken);
87-
//sb.Append ("<span font='");
88-
//sb.Append (IdeServices.FontService.SansFontName);
89-
//sb.Append("' size='small'>");
87+
sb.Append ("<span font='");
88+
sb.Append (IdeServices.FontService.SansFontName);
89+
sb.Append("' size='small'>");
9090

9191
if (documentation != null && documentation.Any ()) {
9292
sb.AppendLine ();

main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/AssemblyBrowserWidget.cs

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
using System.Text;
3434
using System.Xml;
3535
using Gtk;
36+
using Cairo;
3637

3738
using MonoDevelop.Components.Commands;
3839
using MonoDevelop.Core;
@@ -224,7 +225,7 @@ public AssemblyBrowserWidget ()
224225

225226
documentationScrolledWindow.PackStart (inspectEditor, true, true, 0);
226227

227-
//this.ExposeEvent += HPaneExpose;
228+
this.Drawn += HPaneExpose;
228229
hpaned1 = hpaned1.ReplaceWithWidget (new HPanedThin (), true);
229230
hpaned1.Position = 271;
230231

@@ -912,14 +913,14 @@ void GenerateOutput ()
912913
}
913914

914915
int oldSize2 = -1;
915-
// void HPaneExpose (object sender, Gtk.ExposeEventArgs args)
916-
// {
917-
// int size = this.Allocation.Width;
918-
// if (size == oldSize2)
919-
// return;
920-
// oldSize2 = size;
921-
// this.hpaned1.Position = Math.Min (350, this.Allocation.Width * 2 / 3);
922-
// }
916+
void HPaneExpose (object sender, Gtk.DrawnArgs args)
917+
{
918+
int size = this.Allocation.Width;
919+
if (size == oldSize2)
920+
return;
921+
oldSize2 = size;
922+
this.hpaned1.Position = Math.Min (350, this.Allocation.Width * 2 / 3);
923+
}
923924

924925
internal void Open (string url, AssemblyLoader? currentAssembly = null, bool expandNode = true)
925926
{
@@ -1132,7 +1133,7 @@ protected override void OnDestroyed ()
11321133
// this.searchInCombobox.Changed -= SearchInComboboxhandleChanged;
11331134
// this.searchEntry.Changed -= SearchEntryhandleChanged;
11341135
this.searchTreeview.RowActivated -= SearchTreeviewhandleRowActivated;
1135-
//hpaned1.ExposeEvent -= HPaneExpose;
1136+
hpaned1.Drawn -= HPaneExpose;
11361137
base.OnDestroyed ();
11371138
}
11381139

main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor/Gui/MonoTextEditor.cs

Lines changed: 53 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ namespace Mono.TextEditor
4646
{
4747
[System.ComponentModel.Category("Mono.TextEditor")]
4848
[System.ComponentModel.ToolboxItem(true)]
49-
partial class MonoTextEditor : Container
49+
partial class MonoTextEditor : Gtk.Container, Gtk.IScrollableImplementor
5050
{
5151
readonly TextArea textArea;
5252

@@ -86,7 +86,7 @@ internal MonoTextEditor (TextDocument doc, ITextEditorOptions options, EditMode
8686
uiThread = Thread.CurrentThread;
8787
GtkWorkarounds.FixContainerLeak (this);
8888
this.HasWindow = false;
89-
LayoutCache = new LayoutCache (this);
89+
LayoutCache = new LayoutCache (this);
9090
this.textArea = new TextArea (doc, options, initialMode);
9191
this.textArea.Initialize (this, doc, options, initialMode);
9292
this.textArea.EditorOptionsChanged += (sender, e) => OptionsChanged (sender, e);
@@ -143,25 +143,60 @@ void UnregisterAdjustments ()
143143
vAdjustement = null;
144144
hAdjustement = null;
145145
}
146+
147+
bool Gtk.IScrollableImplementor.GetBorder (out Gtk.Border border) {
148+
border = default;
149+
return true;
150+
}
151+
152+
Gtk.Adjustment hadjustment;
153+
public Gtk.Adjustment Hadjustment {
154+
get {
155+
return hadjustment;
156+
}
157+
set {
158+
hadjustment = value;
159+
if (vadjustment != null) {
160+
OnSetScrollAdjustments (value, vadjustment);
161+
}
162+
}
163+
}
164+
165+
Gtk.Adjustment vadjustment;
166+
public Gtk.Adjustment Vadjustment {
167+
get {
168+
return vadjustment;
169+
}
170+
set {
171+
vadjustment = value;
172+
if (hadjustment != null) {
173+
OnSetScrollAdjustments (hadjustment, value);
174+
}
175+
}
176+
}
177+
178+
public Gtk.ScrollablePolicy HscrollPolicy { get; set; }
179+
180+
public Gtk.ScrollablePolicy VscrollPolicy { get; set; }
146181

147182
Adjustment hAdjustement;
148183
Adjustment vAdjustement;
149-
// protected override void OnSetScrollAdjustments (Adjustment hAdjustement, Adjustment vAdjustement)
150-
// {
151-
// UnregisterAdjustments ();
152-
// this.vAdjustement = vAdjustement;
153-
// this.hAdjustement = hAdjustement;
154-
// base.OnSetScrollAdjustments (hAdjustement, vAdjustement);
155-
// textArea.SetTextEditorScrollAdjustments (hAdjustement, vAdjustement);
156-
// if (hAdjustement != null) {
157-
// hAdjustement.ValueChanged += HandleAdjustmentValueChange;
158-
// }
159-
//
160-
// if (vAdjustement != null) {
161-
// vAdjustement.ValueChanged += HandleAdjustmentValueChange;
162-
// }
163-
// OnScrollAdjustmentsSet ();
164-
// }
184+
protected virtual void OnSetScrollAdjustments (Adjustment hAdjustement, Adjustment vAdjustement)
185+
{
186+
UnregisterAdjustments ();
187+
this.vAdjustement = vAdjustement;
188+
this.hAdjustement = hAdjustement;
189+
//base.OnSetScrollAdjustments (hAdjustement, vAdjustement);
190+
textArea.SetTextEditorScrollAdjustments (hAdjustement, vAdjustement);
191+
if (hAdjustement != null) {
192+
hAdjustement.ValueChanged += HandleAdjustmentValueChange;
193+
}
194+
195+
if (vAdjustement != null) {
196+
vAdjustement.ValueChanged += HandleAdjustmentValueChange;
197+
}
198+
OnScrollAdjustmentsSet ();
199+
}
165200

166201
void HandleAdjustmentValueChange (object sender, EventArgs e)
167202
{

main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor/Gui/TextArea.cs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1561,18 +1561,18 @@ protected override void OnDragDataReceived (DragContext context, int x, int y, S
15611561
{
15621562
var undo = OpenUndoGroup ();
15631563
int dragOffset = Document.LocationToOffset (dragCaretPos);
1564-
// if (context.Action == DragAction.Move) {
1565-
// if (CanEdit (Caret.Line) && !selection.IsEmpty) {
1566-
// var selectionRange = selection.GetSelectionRange (textEditorData);
1567-
// if (selectionRange.Offset < dragOffset)
1568-
// dragOffset -= selectionRange.Length;
1569-
// Caret.PreserveSelection = true;
1570-
// textEditorData.DeleteSelection (selection);
1571-
// Caret.PreserveSelection = false;
1572-
//
1573-
// selection = MonoDevelop.Ide.Editor.Selection.Empty;
1574-
// }
1575-
// }
1564+
if ( context.SelectedAction == DragAction.Move) {
1565+
if (CanEdit (Caret.Line) && !selection.IsEmpty) {
1566+
var selectionRange = selection.GetSelectionRange (textEditorData);
1567+
if (selectionRange.Offset < dragOffset)
1568+
dragOffset -= selectionRange.Length;
1569+
Caret.PreserveSelection = true;
1570+
textEditorData.DeleteSelection (selection);
1571+
Caret.PreserveSelection = false;
1572+
1573+
selection = MonoDevelop.Ide.Editor.Selection.Empty;
1574+
}
1575+
}
15761576
if (selection_data.Length > 0 && selection_data.Format == < 10000 span class=pl-c1>8) {
15771577
Caret.Offset = dragOffset;
15781578
if (CanEdit (dragCaretPos.Line)) {

main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/SourceEditorWidget.cs

Lines changed: 24 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -196,9 +196,15 @@ static bool HasAnyFocusedChild (Widget widget)
196196

197197
class Border : Gtk.DrawingArea
198198
{
199-
protected override bool OnDrawn (Cairo.Context evnt)
199+
protected override bool OnDrawn (Cairo.Context ctx)
200200
{
201201
//evnt.Window.DrawRectangle (this.Style.DarkGC (State), true, evnt.Area);
202+
int radius = 3;
203+
var x = Allocation.X;
204+
var y = Allocation.Y + 9 - 6;
205+
ctx.RoundedRectangle(x, y, Allocation.Width - 1, Allocation.Height - y, radius, CairoCorners.TopLeft | CairoCorners.TopRight);
206+
//ctx.SetSourceColor(VisualStyle.PadBackgroundColor.Value.ToCairoColor());
207+
ctx.Fill();
202208
return true;
203209
}
204210
}
@@ -274,19 +280,27 @@ void SetSuppressScrollbar (bool value)
274280
return;
275281
suppressScrollbar = value;
276282

277-
// if (suppressScrollbar) {
283+
// if (suppressScrollbar) {
278284
// scrolledWindow.VScrollbar.SizeRequested += SuppressSize;
279-
// scrolledWindow.VScrollbar.ExposeEvent += SuppressExpose;
280-
// } else {
285+
// scrolledWindow.VScrollbar.Drawn += SuppressExpose;
286+
// int width, height;
287+
// scrolledWindow.VScrollbar.GetSizeRequest (out width, out height);
288+
//scrolledWindow.VScrollbar.SetSizeRequest (width, height);
289+
290+
// } else {
281291
// scrolledWindow.VScrollbar.SizeRequested -= SuppressSize;
282-
// scrolledWindow.VScrollbar.ExposeEvent -= SuppressExpose;
283-
// }
292+
// scrolledWindow.VScrollbar.Drawn -= SuppressExpose;
293+
// int width, height;
294+
// scrolledWindow.VScrollbar.GetSizeRequest (out width, out height);
295+
// scrolledWindow.VScrollbar.SetSizeRequest (width, height);
296+
297+
// }
284298
}
285299

286300
// [GLib.ConnectBefore]
287-
// static void SuppressExpose (object o, ExposeEventArgs args)
301+
// static void SuppressExpose (object o, Gtk.DrawnArgs args)
288302
// {
289-
// args.RetVal = true;
303+
// args.Cr.Fill ();
290304
// }
291305

292306
// [GLib.ConnectBefore]
@@ -336,8 +350,8 @@ protected override void OnDestroyed ()
336350
SetSuppressScrollbar (false);
337351
QuickTaskStrip.EnableFancyFeatures.Changed -= FancyFeaturesChanged;
338352
scrolledWindow.ButtonPressEvent -= PrepareEvent;
339-
// scrolledWindow.Vadjustment.Destroy ();
340-
// scrolledWindow.Hadjustment.Destroy ();
353+
scrolledWindow.Vadjustment.Dispose ();
354+
scrolledWindow.Hadjustment.Dispose ();
341355
scrolledWindow.Destroy ();
342356
scrolledWindow = null;
343357
strip.Destroy ();

main/src/core/MonoDevelop.Core/MonoDevelop.Core.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@
100100
<PackageReference Include="Mono.Cecil" Version="$(NuGetVersionCecil)" PrivateAssets="runtime" />
101101
<PackageReference Include="MonoDevelopDev.Analyzers" Version="$(NuGetVersionMonoDevelopAnalyzers)" />
102102
<PackageReference Include="Newtonsoft.Json" Version="$(NuGetVersionNewtonsoftJson)" PrivateAssets="runtime" />
103-
<PackageReference Include="SharpZipLib" Version="1.4.2" PrivateAssets="runtime" />
103+
<PackageReference Include="SharpZipLib" Version="1.2.0" PrivateAssets="runtime" />
104104
<PackageReference Include="SQLitePCLRaw.bundle_e_sqlite3" Version="2.1.7" PrivateAssets="runtime,build" />
105105
<PackageReference Include="StreamJsonRpc" Version="1.5.68" PrivateAssets="runtime" />
106106
<PackageReference Include="System.ValueTuple" Version="4.5.0" PrivateAssets="runtime" />

main/src/core/MonoDevelop.Ide/MonoDevelop.Components/ContextMenuExtensionsGtk.cs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -79,19 +79,19 @@ class PoupHandlerWrapper
7979
public PoupHandlerWrapper (ContextMenu menu, Gtk.Menu gtkMenu)
8080
{
8181
this.menu = menu;
82-
//gtkMenu.ExposeEvent += HandleExposeEvent;
82+
gtkMenu.Drawn += HandleExposeEvent;
8383
}
8484

85-
// void HandleExposeEvent (object o, Gtk.ExposeEventArgs args)
86-
// {
87-
// var gtkMenu = (Gtk.Menu)o;
88-
// gtkMenu.ExposeEvent -= HandleExposeEvent;
89-
// int ox, oy;
90-
// gtkMenu.ParentWindow.GetOrigin (out ox, out oy);
91-
// int rx, ry;
92-
// IdeApp.Workbench.RootWindow.GdkWindow.GetOrigin (out rx, out ry);
93-
// menu.Items [0].FireSelectedEvent (new Xwt.Rectangle (ox - rx, oy - ry, gtkMenu.Allocation.Width, gtkMenu.Allocation.Height));
94-
// }
85+
void HandleExposeEvent (object o, Gtk.DrawnArgs args)
86+
{
87+
var gtkMenu = (Gtk.Menu)o;
88+
gtkMenu.Drawn -= HandleExposeEvent;
89+
int ox, oy;
90+
gtkMenu.ParentWindow.GetOrigin (out ox, out oy);
91+
int rx, ry;
92+
IdeApp.Workbench.RootWindow.GdkWindow.GetOrigin (out rx, out ry);
93+
menu.Items [0].FireSelectedEvent (new Xwt.Rectangle (ox - rx, oy - ry, gtkMenu.Allocation.Width, gtkMenu.Allocation.Height));
94+
}
9595
}
9696

9797
public static void ShowContextMenu (Gtk.Widget parent, Gdk.EventButton evt, Gtk.Menu menu)

main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/ListWidget.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -160,9 +160,9 @@ void SetFont ()
160160
if (noMatchFont != null)
161161
noMatchFont.Dispose ();
162162

163-
//itemFont = IdeServices.FontService.MonospaceFont.Copy ();
164-
//categoryFont = IdeServices.FontService.SansFont.CopyModified (Styles.FontScale11);
165-
//noMatchFont = IdeServices.FontService.SansFont.CopyModified (Styles.FontScale11);
163+
itemFont = IdeServices.FontService.MonospaceFont.Copy ();
164+
categoryFont = IdeServices.FontService.SansFont.CopyModified (Styles.FontScale11);
165+
noMatchFont = IdeServices.FontService.SansFont.CopyModified (Styles.FontScale11);
166166

167167
var newItemFontSize = itemFont.Size;
168168
var newCategoryFontSize = categoryFont.Size;

main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.TextMate/ShowTextMateScopesHandler.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ protected override void Run ()
5454

5555

5656
var window = new TooltipPopoverWindow ();
57-
//window.Markup = "<span font='" + IdeServices.FontService.MonospaceFontName + "'>" + sb.ToString () + "</span>";
57+
window.Markup = "<span font='" + IdeServices.FontService.MonospaceFontName + "'>" + sb.ToString () + "</span>";
5858
editor.ShowTooltipWindow (window);
5959
}
6060
}

0 commit comments

Comments
 (0)
0