Browse Source

Fixed SD2-1081: Start up project doesn't show its node text bolded.

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@2028 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
Daniel Grunwald 19 years ago
parent
commit
859db0967a
  1. 102
      src/Main/Base/Project/Src/Gui/Components/ExtTreeView/ExtTreeNode.cs
  2. 2
      src/Main/Base/Project/Src/Gui/Pads/ProjectBrowser/ProjectBrowserControl.cs
  3. 41
      src/Main/Base/Project/Src/Gui/Pads/ProjectBrowser/TreeNodes/ProjectNode.cs
  4. 4
      src/Main/Base/Project/Src/Project/IProject.cs
  5. 10
      src/Main/Base/Project/Src/Project/Solution/AbstractSolutionFolder.cs
  6. 4
      src/Main/Base/Project/Src/Project/Solution/ISolutionFolder.cs
  7. 4
      src/Main/Base/Project/Src/Project/Solution/ISolutionFolderContainer.cs
  8. 9
      src/Main/Base/Project/Src/Project/Solution/Solution.cs
  9. 18
      src/Main/Base/Project/Src/Project/Solution/SolutionPreferences.cs
  10. 2
      src/Main/Base/Project/Src/TextEditor/Bookmarks/Pad/BookmarkPad.cs
  11. 10
      src/Main/Base/Project/Src/TextEditor/Bookmarks/Pad/Nodes/BookmarkFolderNode.cs
  12. 8
      src/Main/Base/Project/Src/TextEditor/Bookmarks/Pad/Nodes/BookmarkNode.cs
  13. 10
      src/Main/Base/Project/Src/TextEditor/SearchAndReplace/Pad/Nodes/SearchFolderNode.cs
  14. 16
      src/Main/Base/Project/Src/TextEditor/SearchAndReplace/Pad/Nodes/SearchResultNode.cs
  15. 6
      src/Main/Base/Project/Src/TextEditor/SearchAndReplace/Pad/Nodes/SearchRootNode.cs
  16. 2
      src/Main/Base/Project/Src/TextEditor/SearchAndReplace/Pad/SearchResultPanel.cs
  17. 18
      src/Main/Core/Project/Src/Services/ResourceService/ResourceService.cs

102
src/Main/Base/Project/Src/Gui/Components/ExtTreeView/ExtTreeNode.cs

@ -221,7 +221,7 @@ namespace ICSharpCode.SharpDevelop.Gui @@ -221,7 +221,7 @@ namespace ICSharpCode.SharpDevelop.Gui
#endregion
#region Drawing routines
protected bool drawDefault = true;
protected bool drawDefault = true;
public bool DrawDefault {
get {
@ -232,10 +232,12 @@ namespace ICSharpCode.SharpDevelop.Gui @@ -232,10 +232,12 @@ namespace ICSharpCode.SharpDevelop.Gui
protected virtual void DrawBackground(DrawTreeNodeEventArgs e)
{
Graphics g = e.Graphics;
int width = MeasureItemWidth(e);
int width = MeasureItemWidth(e) + 2;
Rectangle backRect = new Rectangle(e.Bounds.X, e.Bounds.Y, width, e.Bounds.Height);
if ((e.State & TreeNodeStates.Selected) == TreeNodeStates.Selected) {
if ((e.State & (TreeNodeStates.Selected | TreeNodeStates.Focused)) == TreeNodeStates.Selected) {
g.FillRectangle(SystemBrushes.Control, backRect);
} else if ((e.State & TreeNodeStates.Selected) == TreeNodeStates.Selected) {
g.FillRectangle(SystemBrushes.Highlight, backRect);
} else {
g.FillRectangle(SystemBrushes.Window, backRect);
@ -244,7 +246,15 @@ namespace ICSharpCode.SharpDevelop.Gui @@ -244,7 +246,15 @@ namespace ICSharpCode.SharpDevelop.Gui
if ((e.State & TreeNodeStates.Focused) == TreeNodeStates.Focused) {
backRect.Width--;
backRect.Height--;
g.DrawRectangle(SystemPens.HighlightText, backRect);
using (Pen dottedPen = new Pen(SystemColors.WindowText)) {
dottedPen.DashStyle = System.Drawing.Drawing2D.DashStyle.Dot;
g.DrawRectangle(dottedPen, backRect);
Color h = SystemColors.Highlight;
dottedPen.Color = Color.FromArgb(255 - h.R, 255 - h.G, 255 - h.B);
dottedPen.DashOffset = 1;
g.DrawRectangle(dottedPen, backRect);
}
g.DrawLine(SystemPens.WindowText, backRect.Right + 1, backRect.Y, backRect.Right + 1, backRect.Bottom);
}
}
@ -266,24 +276,32 @@ namespace ICSharpCode.SharpDevelop.Gui @@ -266,24 +276,32 @@ namespace ICSharpCode.SharpDevelop.Gui
// Helper routines
protected int MeasureTextWidth(Graphics g, string text, Font font)
{
SizeF size = g.MeasureString(text, font);
SizeF size = g.MeasureString(text, font);
return (int)size.Width;
}
protected void DrawText(Graphics g, string text, Brush brush, Font font, ref float x, int y)
const TreeNodeStates SelectedAndFocused = TreeNodeStates.Selected | TreeNodeStates.Focused;
protected void DrawText(DrawTreeNodeEventArgs e, string text, Brush brush, Font font)
{
float x = e.Bounds.X;
DrawText(e, text, brush, font, ref x);
}
protected void DrawText(DrawTreeNodeEventArgs e, string text, Brush brush, Font font, ref float x)
{
if (IsSelected) {
brush = BrushRegistry.GetBrush(SystemColors.HighlightText);
if ((e.State & SelectedAndFocused) == SelectedAndFocused) {
brush = SystemBrushes.HighlightText;
}
g.DrawString(text, font, brush, new PointF(x, y));
e.Graphics.DrawString(text, font, brush, new PointF(x, e.Bounds.Y));
SizeF size = g.MeasureString(text, font);
SizeF size = e.Graphics.MeasureString(text, font);
x += size.Width;
}
protected Color GetTextColor(TreeNodeStates state, Color c)
{
if ((state & TreeNodeStates.Selected) == TreeNodeStates.Selected) {
if ((state & SelectedAndFocused) == SelectedAndFocused) {
return SystemColors.HighlightText;
}
return c;
@ -291,57 +309,67 @@ namespace ICSharpCode.SharpDevelop.Gui @@ -291,57 +309,67 @@ namespace ICSharpCode.SharpDevelop.Gui
#endregion
#region fonts
static Font font;
static Font boldFont;
static Font italicFont;
static Font monospacedFont;
static Font boldMonospacedFont;
static Font italicMonospacedFont;
static Font regularBigFont, boldBigFont, italicBigFont;
static Font boldMonospacedFont, italicMonospacedFont;
static Font boldDefaultFont, italicDefaultFont;
public static Font RegularMonospacedFont {
get {
return ResourceService.DefaultMonospacedFont;
}
}
public static Font BoldMonospacedFont {
get {
return boldMonospacedFont;
return boldMonospacedFont
?? (boldMonospacedFont = ResourceService.LoadDefaultMonospacedFont(FontStyle.Bold));
}
}
public static Font ItalicMonospacedFont {
get {
return italicMonospacedFont;
return italicMonospacedFont
?? (italicMonospacedFont = ResourceService.LoadDefaultMonospacedFont(FontStyle.Italic));
}
}
public static Font MonospacedFont {
public static Font RegularDefaultFont {
get {
return monospacedFont;
return TreeView.DefaultFont;
}
}
public static Font Font {
public static Font BoldDefaultFont {
get {
return font;
return boldDefaultFont
?? (boldDefaultFont = ResourceService.LoadFont(RegularDefaultFont, FontStyle.Bold));
}
}
public static Font BoldFont {
public static Font ItalicDefaultFont {
get {
return boldFont;
return italicDefaultFont
?? (italicDefaultFont = ResourceService.LoadFont(RegularDefaultFont, FontStyle.Italic));
}
}
public static Font ItalicFont {
public static Font RegularBigFont {
get {
return italicFont;
return regularBigFont
?? (regularBigFont = ResourceService.LoadFont("Tahoma", 9));
}
}
static ExtTreeNode()
{
font = ResourceService.LoadFont("Tahoma", 9);
boldFont = ResourceService.LoadFont("Tahoma", 9, FontStyle.Bold);
italicFont = ResourceService.LoadFont("Tahoma", 9, FontStyle.Italic);
monospacedFont = ResourceService.DefaultMonospacedFont;
boldMonospacedFont = ResourceService.LoadDefaultMonospacedFont(FontStyle.Bold);
italicMonospacedFont = ResourceService.LoadDefaultMonospacedFont(FontStyle.Italic);
public static Font BoldBigFont {
get {
return boldBigFont
?? (boldBigFont = ResourceService.LoadFont("Tahoma", 9, FontStyle.Bold));
}
}
public static Font ItalicBigFont {
get {
return italicBigFont
?? (italicBigFont = ResourceService.LoadFont("Tahoma", 9, FontStyle.Italic));
}
}
#endregion

2
src/Main/Base/Project/Src/Gui/Pads/ProjectBrowser/ProjectBrowserControl.cs

@ -352,7 +352,7 @@ namespace ICSharpCode.SharpDevelop.Project @@ -352,7 +352,7 @@ namespace ICSharpCode.SharpDevelop.Project
public void ViewSolution(Solution solution)
{
AbstractProjectBrowserTreeNode solutionNode = new SolutionNode(solution);
treeView.Nodes.Clear();
treeView.Clear();
solutionNode.AddTo(treeView);
foreach (object treeObject in solution.Folders) {

41
src/Main/Base/Project/Src/Gui/Pads/ProjectBrowser/TreeNodes/ProjectNode.cs

@ -6,10 +6,12 @@ @@ -6,10 +6,12 @@
// </file>
using System;
using System.Drawing;
using System.IO;
using System.Windows.Forms;
using ICSharpCode.Core;
using ICSharpCode.SharpDevelop.Gui;
namespace ICSharpCode.SharpDevelop.Project
{
@ -63,6 +65,45 @@ namespace ICSharpCode.SharpDevelop.Project @@ -63,6 +65,45 @@ namespace ICSharpCode.SharpDevelop.Project
OpenedImage = ClosedImage = IconService.GetImageForProjectType(project.Language);
}
Tag = project;
project.ParentSolution.Preferences.StartupProjectChanged += OnStartupProjectChanged;
OnStartupProjectChanged(null, null);
}
public override void Dispose()
{
base.Dispose();
project.ParentSolution.Preferences.StartupProjectChanged -= OnStartupProjectChanged;
}
bool isStartupProject;
void OnStartupProjectChanged(object sender, EventArgs e)
{
bool newIsStartupProject = (this.project == project.ParentSolution.Preferences.StartupProject);
if (newIsStartupProject != isStartupProject) {
isStartupProject = newIsStartupProject;
drawDefault = !isStartupProject;
if (this.TreeView != null) {
this.TreeView.Invalidate(this.Bounds);
}
}
}
protected override int MeasureItemWidth(DrawTreeNodeEventArgs e)
{
if (isStartupProject) {
return MeasureTextWidth(e.Graphics, this.Text, BoldDefaultFont);
} else {
return base.MeasureItemWidth(e);
}
}
protected override void DrawForeground(DrawTreeNodeEventArgs e)
{
if (isStartupProject) {
DrawText(e, this.Text, SystemBrushes.WindowText, BoldDefaultFont);
}
}
public override void ActivateItem()

4
src/Main/Base/Project/Src/Project/IProject.cs

@ -24,8 +24,8 @@ namespace ICSharpCode.SharpDevelop.Project @@ -24,8 +24,8 @@ namespace ICSharpCode.SharpDevelop.Project
Module
}
public interface IProject : ISolutionFolder, IDisposable, IMementoCapable,
ICSharpCode.SharpDevelop.Dom.IDomProject
public interface IProject
: ISolutionFolder, IDisposable, IMementoCapable, ICSharpCode.SharpDevelop.Dom.IDomProject
{
List<ProjectItem> Items {
get;

10
src/Main/Base/Project/Src/Project/Solution/AbstractSolutionFolder.cs

@ -22,6 +22,16 @@ namespace ICSharpCode.SharpDevelop.Project @@ -22,6 +22,16 @@ namespace ICSharpCode.SharpDevelop.Project
string location = null;
string name = null;
[Browsable(false)]
public virtual Solution ParentSolution {
get {
if (parent != null)
return parent.ParentSolution;
else
return null;
}
}
[Browsable(false)]
public string IdGuid {
get {

4
src/Main/Base/Project/Src/Project/Solution/ISolutionFolder.cs

@ -19,6 +19,10 @@ namespace ICSharpCode.SharpDevelop.Project @@ -19,6 +19,10 @@ namespace ICSharpCode.SharpDevelop.Project
set;
}
Solution ParentSolution {
get;
}
string TypeGuid {
get;
set;

4
src/Main/Base/Project/Src/Project/Solution/ISolutionFolderContainer.cs

@ -15,6 +15,10 @@ namespace ICSharpCode.SharpDevelop.Project @@ -15,6 +15,10 @@ namespace ICSharpCode.SharpDevelop.Project
/// </summary>
public interface ISolutionFolderContainer
{
Solution ParentSolution {
get;
}
List<ProjectSection> Sections {
get;
}

9
src/Main/Base/Project/Src/Project/Solution/Solution.cs

@ -111,6 +111,10 @@ namespace ICSharpCode.SharpDevelop.Project @@ -111,6 +111,10 @@ namespace ICSharpCode.SharpDevelop.Project
}
}
/// <summary>
/// Returns the startup project. If no startup project is set in the solution preferences,
/// returns any project that is startable.
/// </summary>
[Browsable(false)]
public IProject StartupProject {
get {
@ -166,6 +170,11 @@ namespace ICSharpCode.SharpDevelop.Project @@ -166,6 +170,11 @@ namespace ICSharpCode.SharpDevelop.Project
}
#region ISolutionFolderContainer implementations
[Browsable(false)]
public override Solution ParentSolution {
get { return this; }
}
public override ProjectSection SolutionItems {
get {
foreach (SolutionFolder folder in Folders) {

18
src/Main/Base/Project/Src/Project/Solution/SolutionPreferences.cs

@ -11,7 +11,7 @@ using ICSharpCode.Core; @@ -11,7 +11,7 @@ using ICSharpCode.Core;
namespace ICSharpCode.SharpDevelop.Project
{
public class SolutionPreferences : IMementoCapable
public sealed class SolutionPreferences : IMementoCapable
{
Solution solution;
Properties properties = new Properties();
@ -41,10 +41,22 @@ namespace ICSharpCode.SharpDevelop.Project @@ -41,10 +41,22 @@ namespace ICSharpCode.SharpDevelop.Project
return null;
}
set {
startupProject = (value != null) ? value.IdGuid : "";
SetStartupProject((value != null) ? value.IdGuid : "");
}
}
void SetStartupProject(string value)
{
if (value != startupProject) {
startupProject = value;
if (StartupProjectChanged != null) {
StartupProjectChanged(this, EventArgs.Empty);
}
}
}
public event EventHandler StartupProjectChanged;
public string ActiveConfiguration {
get {
return activeConfiguration;
@ -82,7 +94,7 @@ namespace ICSharpCode.SharpDevelop.Project @@ -82,7 +94,7 @@ namespace ICSharpCode.SharpDevelop.Project
/// </summary>
void IMementoCapable.SetMemento(Properties memento)
{
startupProject = memento.Get("StartupProject", "");
SetStartupProject(memento.Get("StartupProject", ""));
string configuration = memento.Get("ActiveConfiguration", activeConfiguration);
string platform = memento.Get("ActivePlatform", activePlatform);

2
src/Main/Base/Project/Src/TextEditor/Bookmarks/Pad/BookmarkPad.cs

@ -51,7 +51,7 @@ namespace ICSharpCode.SharpDevelop.Bookmarks @@ -51,7 +51,7 @@ namespace ICSharpCode.SharpDevelop.Bookmarks
bookmarkTreeView.Dock = DockStyle.Fill;
bookmarkTreeView.CheckBoxes = true;
bookmarkTreeView.HideSelection = false;
bookmarkTreeView.Font = ExtTreeNode.Font;
bookmarkTreeView.Font = ExtTreeNode.RegularBigFont;
bookmarkTreeView.IsSorted = false;
ToolStrip toolStrip = ToolbarService.CreateToolStrip(this, "/SharpDevelop/Pads/BookmarkPad/Toolbar");

10
src/Main/Base/Project/Src/TextEditor/Bookmarks/Pad/Nodes/BookmarkFolderNode.cs

@ -56,8 +56,8 @@ namespace ICSharpCode.SharpDevelop.Bookmarks @@ -56,8 +56,8 @@ namespace ICSharpCode.SharpDevelop.Bookmarks
protected override int MeasureItemWidth(DrawTreeNodeEventArgs e)
{
Graphics g = e.Graphics;
int x = MeasureTextWidth(g, fileNameText, Font);
x += MeasureTextWidth(g, occurences, ItalicFont);
int x = MeasureTextWidth(g, fileNameText, RegularBigFont);
x += MeasureTextWidth(g, occurences, ItalicBigFont);
if (icon != null) {
x += icon.Width;
}
@ -69,10 +69,10 @@ namespace ICSharpCode.SharpDevelop.Bookmarks @@ -69,10 +69,10 @@ namespace ICSharpCode.SharpDevelop.Bookmarks
float x = e.Bounds.X;
if (icon != null) {
g.DrawImage(icon, x, e.Bounds.Y, icon.Width, icon.Height);
x += icon.Width;
x += icon.Width + 2;
}
DrawText(g, fileNameText, Brushes.Black, Font, ref x, e.Bounds.Y);
DrawText(g, occurences, Brushes.Gray, ItalicFont, ref x, e.Bounds.Y);
DrawText(e, fileNameText, SystemBrushes.WindowText, RegularBigFont, ref x);
DrawText(e, occurences, SystemBrushes.GrayText, ItalicBigFont, ref x);
}
public void AddMark(SDBookmark mark)

8
src/Main/Base/Project/Src/TextEditor/Bookmarks/Pad/Nodes/BookmarkNode.cs

@ -85,9 +85,9 @@ namespace ICSharpCode.SharpDevelop.Bookmarks @@ -85,9 +85,9 @@ namespace ICSharpCode.SharpDevelop.Bookmarks
{
Graphics g = e.Graphics;
float x = e.Bounds.X;
DrawText(g, positionText, Brushes.Black, Font, ref x, e.Bounds.Y);
DrawText(e, positionText, SystemBrushes.WindowText, RegularBigFont, ref x);
spaceSize = g.MeasureString("-", Font, new PointF(0, 0), StringFormat.GenericTypographic);
spaceSize = g.MeasureString("-", RegularBigFont, new PointF(0, 0), StringFormat.GenericTypographic);
if (line != null) {
DrawLine(g, line, e.Bounds.Y, x, e.State);
@ -132,7 +132,7 @@ namespace ICSharpCode.SharpDevelop.Bookmarks @@ -132,7 +132,7 @@ namespace ICSharpCode.SharpDevelop.Bookmarks
xPos += DrawDocumentWord(g,
word.Word,
new PointF(xPos, yPos),
word.Bold ? BoldMonospacedFont : MonospacedFont,
word.Bold ? BoldMonospacedFont : RegularMonospacedFont,
GetTextColor(state, word.Color)
);
logicalX += word.Word.Length;
@ -143,7 +143,7 @@ namespace ICSharpCode.SharpDevelop.Bookmarks @@ -143,7 +143,7 @@ namespace ICSharpCode.SharpDevelop.Bookmarks
DrawDocumentWord(g,
bookmark.Document.GetText(line),
new PointF(xPos, yPos),
MonospacedFont,
RegularMonospacedFont,
GetTextColor(state, Color.Black)
);
}

10
src/Main/Base/Project/Src/TextEditor/SearchAndReplace/Pad/Nodes/SearchFolderNode.cs

@ -53,8 +53,8 @@ namespace SearchAndReplace @@ -53,8 +53,8 @@ namespace SearchAndReplace
protected override int MeasureItemWidth(DrawTreeNodeEventArgs e)
{
Graphics g = e.Graphics;
int x = MeasureTextWidth(g, fileName, Font);
x += MeasureTextWidth(g, occurences, ItalicFont);
int x = MeasureTextWidth(g, fileName, RegularBigFont);
x += MeasureTextWidth(g, occurences, ItalicBigFont);
if (icon != null) {
x += icon.Width;
}
@ -66,10 +66,10 @@ namespace SearchAndReplace @@ -66,10 +66,10 @@ namespace SearchAndReplace
float x = e.Bounds.X;
if (icon != null) {
g.DrawImage(icon, x, e.Bounds.Y, icon.Width, icon.Height);
x += icon.Width;
x += icon.Width + 2;
}
DrawText(g, fileName, Brushes.Black, Font, ref x, e.Bounds.Y);
DrawText(g, occurences, Brushes.Gray, ItalicFont, ref x, e.Bounds.Y);
DrawText(e, fileName, SystemBrushes.WindowText, RegularBigFont, ref x);
DrawText(e, occurences, SystemBrushes.GrayText, ItalicBigFont, ref x);
}
protected override void Initialize()

16
src/Main/Base/Project/Src/TextEditor/SearchAndReplace/Pad/Nodes/SearchResultNode.cs

@ -62,7 +62,7 @@ namespace SearchAndReplace @@ -62,7 +62,7 @@ namespace SearchAndReplace
positionText = "(" + (startPosition.Y + 1) + ", " + (startPosition.X + 1) + ") ";
LineSegment line = document.GetLineSegment(startPosition.Y);
drawableLine = new DrawableLine(document, line, MonospacedFont, BoldMonospacedFont);
drawableLine = new DrawableLine(document, line, RegularMonospacedFont, BoldMonospacedFont);
drawableLine.SetBold(0, drawableLine.LineLength, false);
if (startPosition.Y == endPosition.Y) {
drawableLine.SetBold(startPosition.X, endPosition.X, true);
@ -84,7 +84,7 @@ namespace SearchAndReplace @@ -84,7 +84,7 @@ namespace SearchAndReplace
if (ShowFileName) {
float tabWidth = drawableLine.GetSpaceSize(g).Width * 6;
x = (int)((int)((x + 2 + tabWidth) / tabWidth) * tabWidth);
x += MeasureTextWidth(g, FileNameText, ItalicFont);
x += MeasureTextWidth(g, FileNameText, ItalicBigFont);
}
return x;
}
@ -93,10 +93,10 @@ namespace SearchAndReplace @@ -93,10 +93,10 @@ namespace SearchAndReplace
{
Graphics g = e.Graphics;
float x = e.Bounds.X;
DrawText(g, positionText, Brushes.Black, Font, ref x, e.Bounds.Y);
DrawText(e, positionText, SystemBrushes.WindowText, RegularBigFont, ref x);
if (specialText != null) {
DrawText(g, specialText, Brushes.Black, Font, ref x, e.Bounds.Y);
DrawText(e, specialText, SystemBrushes.WindowText, RegularBigFont, ref x);
} else {
x -= e.Bounds.X;
drawableLine.DrawLine(g, ref x, e.Bounds.X, e.Bounds.Y, GetTextColor(e.State, Color.Empty));
@ -105,11 +105,11 @@ namespace SearchAndReplace @@ -105,11 +105,11 @@ namespace SearchAndReplace
float tabWidth = drawableLine.GetSpaceSize(g).Width * 6;
x = (int)((int)((x + 2 + tabWidth) / tabWidth) * tabWidth);
x += e.Bounds.X;
DrawText(g,
DrawText(e,
FileNameText,
Brushes.Gray,
ItalicFont,
ref x, e.Bounds.Y);
SystemBrushes.GrayText,
ItalicBigFont,
ref x);
}
}

6
src/Main/Base/Project/Src/TextEditor/SearchAndReplace/Pad/Nodes/SearchRootNode.cs

@ -68,13 +68,11 @@ namespace SearchAndReplace @@ -68,13 +68,11 @@ namespace SearchAndReplace
protected override int MeasureItemWidth(DrawTreeNodeEventArgs e)
{
return MeasureTextWidth(e.Graphics, GetText(), BoldFont);
return MeasureTextWidth(e.Graphics, GetText(), BoldBigFont);
}
protected override void DrawForeground(DrawTreeNodeEventArgs e)
{
Graphics g = e.Graphics;
float x = e.Bounds.X;
DrawText(g, GetText(), Brushes.Black, BoldFont, ref x, e.Bounds.Y);
DrawText(e, GetText(), SystemBrushes.WindowText, BoldBigFont);
}
}
}

2
src/Main/Base/Project/Src/TextEditor/SearchAndReplace/Pad/SearchResultPanel.cs

@ -168,7 +168,7 @@ namespace SearchAndReplace @@ -168,7 +168,7 @@ namespace SearchAndReplace
instance = this;
resultTreeView.Dock = DockStyle.Fill;
resultTreeView.Font = ExtTreeNode.Font;
resultTreeView.Font = ExtTreeNode.RegularBigFont;
resultTreeView.IsSorted = false;
toolStrip = ToolbarService.CreateToolStrip(this, "/SharpDevelop/Pads/SearchResultPanel/Toolbar");
toolStrip.Stretch = true;

18
src/Main/Core/Project/Src/Services/ResourceService/ResourceService.cs

@ -301,6 +301,24 @@ namespace ICSharpCode.Core @@ -301,6 +301,24 @@ namespace ICSharpCode.Core
return SystemInformation.MenuFont;
}
}
/// <summary>
/// The LoadFont routines provide a safe way to load fonts.
/// </summary>
/// <param name="baseFont">The existing font from which to create the new font.</param>
/// <param name="newStyle">The new style of the font.</param>
/// <returns>
/// The font to load or the baseFont (if the requested font couldn't be loaded).
/// </returns>
public static Font LoadFont(Font baseFont, FontStyle newStyle)
{
try {
return new Font(baseFont, newStyle);
} catch (Exception ex) {
LoggingService.Warn(ex);
return baseFont;
}
}
#endregion
static Hashtable Load(string fileName)

Loading…
Cancel
Save