私たちのアプリケーションは、Windows アプリケーションで MonoDevelop.Components.Docking フレームワークを使用しています。最後に最新バージョンに更新したのは 2010 年 11 月です。次の状況で発生する興味深い動作に遭遇しました。
DockGroupType.Tabbed ParentGroup の最初のパネルの自動非表示ボタンを押します
展開されるまで、折りたたまれたパネルの上にマウスを置きます
パネルをタブ付きグループの中央にドラッグして (元の場所に戻します)、ドロップします。
この時点で、パネルは、パネルがドロップされる場所を示す青い四角形のサイズにサイズ変更され、メイン ウィンドウからドッキング解除されて、そのサイズでフロートします。これは、タブ グループの最初の項目でのみ発生します。DockGroupItem.cs (行 112、GetDockTarget(..)) でコメント アウトされたコード セクションを見つけました。ただし、定義されていない DockPosition タイプの CenterAfter を参照しています。メソッドは以下のとおりです。コメントアウトされた部分は太字で示しています。
public bool GetDockTarget (DockItem item, int px, int py, Gdk.Rectangle rect, out DockDelegate dockDelegate, out Gdk.Rectangle outrect)
{
dockDelegate = null;
if (item != this.item && this.item.Visible && rect.Contains (px,py)) {
int xdockMargin = (int) ((double)rect.Width * (1.0 - DockFrame.ItemDockCenterArea)) / 2;
int ydockMargin = (int) ((double)rect.Height * (1.0 - DockFrame.ItemDockCenterArea)) / 2;
DockPosition pos;
/* if (ParentGroup.Type == DockGroupType.Tabbed) {
rect = new Gdk.Rectangle (rect.X + xdockMargin, rect.Y + ydockMargin,rect.Width - xdockMargin*2, rect.Height - ydockMargin*2);
pos = DockPosition.CenterAfter;
}
*/ if (px <= rect.X + xdockMargin && ParentGroup.Type != DockGroupType.Horizontal) {
outrect = new Gdk.Rectangle (rect.X, rect.Y, xdockMargin, rect.Height);
pos = DockPosition.Left;
}
else if (px >= rect.Right - xdockMargin && ParentGroup.Type != DockGroupType.Horizontal) {
outrect = new Gdk.Rectangle (rect.Right - xdockMargin, rect.Y, xdockMargin, rect.Height);
pos = DockPosition.Right;
}
else if (py <= rect.Y + ydockMargin && ParentGroup.Type != DockGroupType.Vertical) {
outrect = new Gdk.Rectangle (rect.X, rect.Y, rect.Width, ydockMargin);
pos = DockPosition.Top;
}
else if (py >= rect.Bottom - ydockMargin && ParentGroup.Type != DockGroupType.Vertical) {
outrect = new Gdk.Rectangle (rect.X, rect.Bottom - ydockMargin, rect.Width, ydockMargin);
pos = DockPosition.Bottom;
}
else {
outrect = new Gdk.Rectangle (rect.X + xdockMargin, rect.Y + ydockMargin, rect.Width - xdockMargin*2, rect.Height - ydockMargin*2);
pos = DockPosition.Center;
}
dockDelegate = delegate (DockItem dit) {
DockGroupItem it = ParentGroup.AddObject (dit, pos, Id);
it.SetVisible (true);
ParentGroup.FocusItem (it);
};
return true;
}
outrect = Gdk.Rectangle.Zero;
return false;
}
私はいくつかの小さなことを試しましたが、これまでのところ動作に影響を与えるものは何もありません. これを適切に機能させるために何を編集できるかについてのアイデアはありますか? ありがとう!