Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

2008-04-10 Mike Kestner <mkestner@novell.com>

	* src/BannerItem.cs: 
	* src/HeadingItem.cs: 
	* src/LabelItem.cs: 
	* src/LinkItem.cs: 
	* src/MarkupItem.cs: 
	* src/RemarksItem.cs: 
	* src/SummaryTableItem.cs: Layout tweaks adapting to ink rect 
	offsets.

svn path=/trunk/monodoc-widgets/; revision=100359
  • Loading branch information...
commit a5bfee9abe58d28aa12edfb55e11bee9f2ea1460 1 parent 2713cb9
@mkestner mkestner authored
View
11 ChangeLog
@@ -1,5 +1,16 @@
2008-04-10 Mike Kestner <mkestner@novell.com>
+ * src/BannerItem.cs:
+ * src/HeadingItem.cs:
+ * src/LabelItem.cs:
+ * src/LinkItem.cs:
+ * src/MarkupItem.cs:
+ * src/RemarksItem.cs:
+ * src/SummaryTableItem.cs: Layout tweaks adapting to ink rect
+ offsets.
+
+2008-04-10 Mike Kestner <mkestner@novell.com>
+
* src/DocView.cs : add size request support to enable scrolling.
2008-04-03 Mike Kestner <mkestner@novell.com>
View
2  src/BannerItem.cs
@@ -66,7 +66,7 @@ public override void Update (int width)
height += view.LineHeight;
heading.Update (width);
heading.Location = new Gdk.Point (Padding, height);
- sz.Height = height + heading.Size.Height + 2 * Padding;
+ sz.Height = height + heading.Size.Height + Padding;
}
protected override void OnPaint (Gdk.Drawable win, Gdk.Point offset, Gdk.Rectangle clip)
View
5 src/HeadingItem.cs
@@ -53,6 +53,8 @@ public HeadingItem (DocView view, string heading)
}
}
+ Gdk.Point ink_offset;
+
public override void Update (int width)
{
Layout layout = view.Layout;
@@ -62,6 +64,7 @@ public override void Update (int width)
layout.SetText (heading);
Rectangle ink, log;
layout.GetPixelExtents (out ink, out log);
+ ink_offset = new Gdk.Point (ink.X, ink.Y);
layout.FontDescription = null;
sz.Width = ink.Width;
sz.Height = ink.Height;
@@ -74,7 +77,7 @@ protected override void OnPaint (Gdk.Drawable win, Gdk.Point offset, Gdk.Rectang
layout.Alignment = Pango.Alignment.Left;
layout.Width = -1;
layout.SetText (heading);
- win.DrawLayout (view.Style.TextGC (0), Location.X + offset.X, Location.Y + offset.Y, layout);
+ win.DrawLayout (view.Style.TextGC (0), Location.X + offset.X - ink_offset.X, Location.Y + offset.Y - ink_offset.Y, layout);
layout.FontDescription = null;
}
View
5 src/LabelItem.cs
@@ -63,10 +63,12 @@ protected override void OnPaint (Gdk.Drawable win, Gdk.Point offset, Gdk.Rectang
layout.Alignment = Pango.Alignment.Left;
layout.Width = -1;
layout.SetText (text);
- win.DrawLayout (view.Style.TextGC (0), Location.X + offset.X, Location.Y + offset.Y, layout);
+ win.DrawLayout (view.Style.TextGC (0), Location.X + offset.X - ink_offset.X, Location.Y + offset.Y - ink_offset.Y, layout);
layout.FontDescription = null;
}
+ Gdk.Point ink_offset;
+
public override void Update (int width)
{
Layout layout = view.Layout;
@@ -76,6 +78,7 @@ public override void Update (int width)
layout.SetText (text);
Rectangle ink, log;
layout.GetPixelExtents (out ink, out log);
+ ink_offset = new Gdk.Point (ink.X, ink.Y);
layout.FontDescription = null;
sz.Width = ink.Width;
sz.Height = ink.Height;
View
5 src/LinkItem.cs
@@ -64,6 +64,8 @@ public override void Event (EventInfo info)
}
}
+ Gdk.Point ink_offset;
+
protected override void OnPaint (Gdk.Drawable win, Gdk.Point offset, Gdk.Rectangle clip)
{
Pango.Layout layout = view.Layout;
@@ -71,7 +73,7 @@ protected override void OnPaint (Gdk.Drawable win, Gdk.Point offset, Gdk.Rectang
layout.Width = -1;
layout.SetText (caption);
layout.Attributes = Attrs;
- win.DrawLayout (view.Style.TextGC (0), Location.X + offset.X, Location.Y + offset.Y, layout);
+ win.DrawLayout (view.Style.TextGC (0), Location.X + offset.X - ink_offset.X, Location.Y + offset.Y - ink_offset.Y, layout);
layout.Attributes = null;
}
@@ -84,6 +86,7 @@ public override void Update (int width)
layout.SetText (caption);
Rectangle ink, log;
layout.GetPixelExtents (out ink, out log);
+ ink_offset = new Gdk.Point (ink.X, ink.Y);
sz.Width = ink.Width;
sz.Height = ink.Height;
layout.Attributes = null;
View
5 src/MarkupItem.cs
@@ -109,6 +109,8 @@ void InsertSeeAttrs (uint start, uint end)
attrs.Insert (attr);
}
+ Gdk.Point ink_offset;
+
public override void Update (int width)
{
sz.Width = width;
@@ -120,6 +122,7 @@ public override void Update (int width)
layout.SetText (text);
Rectangle ink, log;
layout.GetPixelExtents (out ink, out log);
+ ink_offset = new Gdk.Point (ink.X, ink.Y);
sz.Height = ink.Height;
layout.Attributes = null;
}
@@ -132,7 +135,7 @@ protected override void OnPaint (Gdk.Drawable win, Gdk.Point offset, Gdk.Rectang
if (attrs != null)
layout.Attributes = attrs;
layout.SetText (text);
- win.DrawLayout (view.Style.TextGC (0), Location.X + offset.X, Location.Y + offset.Y, layout);
+ win.DrawLayout (view.Style.TextGC (0), Location.X + offset.X - ink_offset.X, Location.Y + offset.Y - ink_offset.Y, layout);
layout.Attributes = null;
}
View
3  src/RemarksItem.cs
@@ -42,7 +42,6 @@ public RemarksItem (DocView view, XmlElement elem)
contents = new KitchenSinkItem (view, elem);
}
- const int text_padding = 6;
const int item_offset = 14;
public override void Update (int width)
@@ -51,7 +50,7 @@ public override void Update (int width)
label.Update (width);
label.Location = Gdk.Point.Zero;
width -= item_offset;
- int height = label.Size.Height + text_padding;
+ int height = label.Size.Height + Padding;
contents.Update (width);
contents.Location = new Gdk.Point (item_offset, height);
sz.Height = height + contents.Size.Height;
View
2  src/SummaryTableItem.cs
@@ -161,7 +161,7 @@ public override void Update (int width)
protected override void OnPaint (Gdk.Drawable win, Gdk.Point offset, Gdk.Rectangle clip)
{
Gdk.Point adj = Globalize (offset);
- Gtk.Style.PaintExpander (view.Style, win, Gtk.StateType.Normal, clip, view, null, adj.X + 10, adj.Y + 10, expanded ? Gtk.ExpanderStyle.Expanded : Gtk.ExpanderStyle.Collapsed);
+ Gtk.Style.PaintExpander (view.Style, win, Gtk.StateType.Normal, clip, view, null, adj.X + 10, adj.Y + 6, expanded ? Gtk.ExpanderStyle.Expanded : Gtk.ExpanderStyle.Collapsed);
label.Paint (win, adj, clip);
if (!expanded)
Please sign in to comment.
Something went wrong with that request. Please try again.